📄 mypreferences.jsp
字号:
<%--
* @author Umesh Kulkarni
* @version 1.0
*
* Development Environment : Oracle9i JDeveloper
*
* Name of the File : MyPreferences.jsp
*
* Creation/Modification History :
* Umesh 26-Apr-2002 Created
*
* Overview of Application :
*
* This page is part of the IBFBS application.
* This page displays a form where the user can add a Stock Symbol as a Preference Stock Symbol.
* User can specify whether he/she is interested in Financial News about the Symbol or Stock Rates
* of the symbole or both. These preferences are used to display customized information when user
* logs in this FBS.
*
--%>
<%@page contentType="text/html;charset=WINDOWS-1252" language="java" %>
<%@page import="oracle.otnsamples.ibfbs.usermanagement.ejb.PreferencesInfo" %>
<%@page import="java.util.Collection" %>
<%@page import="java.util.HashMap" %>
<%@page import="java.util.Iterator" %>
<html>
<head>
<title>OTN Financial Brokerage System : My Preferences Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1252">
<link rel="stylesheet" href="includes/contents.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!--
document.write("<SCRIPT LANGUAGE='JavaScript1.2' SRC='includes/tab.js' TYPE='text/javascript'><\/SCRIPT>");
//-->
</SCRIPT>
<script language="JavaScript">
<!--
function validateEditForm() {
formObj = document.PREFS;
x = document.PREFS.elements.length;
noSelection = true;
x = x - 2;
if ( x != 0) {
for(i=0; i <= x; i++) {
if (formObj.SYMBOL[i].checked == true) {
noSelection = false;
}
}
} else {
if (formObj.SYMBOL.checked == true) {
noSelection = false;
}
}
if (noSelection) {
alert("Select a Symbol and Click Change")
return;
} else
formObj.submit();
}
function validateAddForm() {
formObj = document.PREFS1;
if (formObj.SYMBOL.value == "") {
alert("Enter Proper Non Empty Symbol Value");
return;
} else
formObj.submit();
}
// This function resets the form
function resetAddForm() {
document.PREFS1.reset();
}
function showSymbols(frmName) {
var settings = "width=400,height=320,resizable=no,menubar=no,toolbar=no,"+
"directories=no,location=no,scrollbars=no,status=no";
window.open("controllerservlet?EVENTNAME=SYMBOLLOOKUP&FORMNAME="+frmName,"symbollookup",settings);
}
//-->
</script>
</head>
<body bgcolor="#FFFFEA" onLoad="MM_preloadImages('images/myhome.gif','images/profile.gif','images/personalize.gif','images/portfolio.gif','images/logout.gif')">
<jsp:include page="Header.jsp?TABIMAGE=personalize.gif" flush="TRUE"/>
<jsp:include page="ShowError.jsp" flush="TRUE"/>
<%
String tab = request.getParameter("EVENTNAME");
HashMap hm = (java.util.HashMap) session.getAttribute("PREFS.RESPONSE");
Collection prefCollection = (Collection)hm.get("PREFERENCESINFO");
%>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bgcolor="#FFFFEA" bordercolor="#008000" height="80%">
<tr>
<td width="10%" bordercolor="#FFFFEA" valign="center" bgcolor="#FFFFD5">
<table width="100%" height="100%" border="0" bgcolor="#FFFFD5" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr >
<td>
<a href="controllerservlet?EVENTNAME=PREFS" style="Text-Decoration : None">
<font face="Arial, Helvetica, sans-serif" color="#990000" size="2">
<img src="images/gemgreen.gif" width="10" height="10" border="0"><b> Preferences</b>
</font></a>
</td>
</tr>
<tr>
<td height="17">
<a href="controllerservlet?EVENTNAME=ALERTS" style="Text-Decoration : None">
<font face="Arial, Helvetica, sans-serif" color="#006200" size="2">
<img src="images/gemgreen.gif" width="10" height="10" border="0"><b> Alerts</b>
</font></a>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
<%
String type = request.getParameter("PREFTYPE");
%>
<td bordercolor="#FFFFEA" width="50%" align="center" valign="top">
<br>
<div align="center">
<font face="Verdana, Times New Roman, Times, serif" color="#990000" size="2">
<b>Preferences</b></font></div>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<form name="PREFS" method="post" action="controllerservlet">
<table width="80%" border="0">
<tr>
<th class="tabHead" bgcolor="#008000">Select</th>
<th class="tabHead" bgcolor="#008000">Symbol</th>
<th class="tabHead" bgcolor="#008000">Preference Type</th>
</tr>
<%
Iterator prefIter = prefCollection.iterator();
String color1 = "#FFFFCC";
String color2 = "#CCFFCC";
String color = color2;
while (prefIter.hasNext()) {
PreferencesInfo pif = (PreferencesInfo)prefIter.next();
// Alternate between color1 and color2
color = (color.equals(color2))?color1:color2;
%>
<tr bgcolor="<%=color%>">
<td align="center">
<input type="radio" name="SYMBOL" value="<%= pif.getSymbol() %>">
</td>
<td class="tableText" height="30"> <%= pif.getSymbol() %></td>
<td class="tableText" height="30">
<%
String ptype = pif.getPreferenceType();
if (ptype.equals("N")) {
%>
News
<%
} else if (ptype.equals("S")) {
%>
Stock Prices
<%
} else if (ptype.equals("B")) {
%>
News and Stock Prices
<% } %>
</td>
</tr>
<% } %>
</table>
<br>
<input type="hidden" name="EVENTNAME" value="EDITPREFERENCEPAGE">
<img src="images/change.gif" alt="Edit Selected Preference" onMouseUp="validateEditForm()">
</form>
</td>
<td align="center" valign="top">
<form name="PREFS1" method="post" action="controllerservlet">
<table width="80%" border="0">
<tr>
<th class="leftHead" align="right" height="30">Symbol </th>
<td>
<input type="text" name="SYMBOL">
<a href="javascript:showSymbols('PREFS1')"><img src="images/lookup.gif"
alt="List of Symbols" border="0"></a>
<input type="hidden" name="EVENTNAME" value="ADDPREFERENCE">
<input type="hidden" name="CALLOUT_EVENT" value=<%= request.getParameter("EVENTNAME") %>>
</td>
</tr>
<tr>
<th class="leftHead" align="right" height="30">Preference Type </th>
<td>
<select name="PREFTYPE">
<option value="N">News</option>
<option value="S">Stock Prices</option>
<option value="B">News and Stock Prices</option>
</select>
</td>
</tr>
</table>
<br>
<img src="images/addnew.gif" alt="Add New Preference" onMouseUp="validateAddForm();">
<img src="images/reset.gif" alt="Reset" onMouseUp="resetAddForm();" >
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<jsp:include page="Footer.jsp" flush="false"/>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -