⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 currexchangebean.jsp

📁 j2ee专业项目实例开发.附有三个项目源码
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<jsp:useBean id="calc" class="sas.calc" scope="session" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Money Banks公司 现金转换</title>
</head>
<body bgproperties="fixed" bgcolor="#CCCCFF">
<form action="Home_page.htm">
<table border="0" width="100%" height="42">
  <tr>
    <td width="50%" height="24">
    	<b><font size="5" ><i>Money Banks 公司</i></font></b>
    </td>
    <td width="50%" height="36"></td>
  </tr>
</table>

<p align="center"><b><font size="4" >现金转换</font></b></p>

<p ><font >将 </font>
	<% request.setCharacterEncoding("utf-8"); %>
	<%= request.getParameter("frmCurr")%>
    <% String frCrr[]={"美元", "英镑", "加元", "欧元", "澳元"};
	String crr=request.getParameter("frmCurr");
	int ctr=0;
	while(!(crr.equals(frCrr[ctr])))
	{
		ctr++; 
		if( ctr >= 5 )
			break;
	}
    %>
    <jsp:setProperty name="calc" property="fromCurr" value="<%= ctr%>"/>
	<font >转换成</font>  <%= (String)request.getParameter("toCurrency") %>	
	<% String toCrr[]={"美元", "英镑", "加元", "欧元", "澳元"};
	String tocrr=request.getParameter("toCurrency");
	int ctr1=0;
	while(!(tocrr.equals(toCrr[ctr1])))
	ctr1++; 
	%>
    <jsp:setProperty name="calc" property="toCurr" value="<%= ctr1%>"/>
    <p ><font >金额: </font>
    <%= (String)request.getParameter("amount") %>
    <% 
    	int amnt=0;
     	String str1;
     	str1=request.getParameter("amount");
     	str1=str1.trim();
     	amnt=Integer.parseInt(str1,10);
	%>
    <jsp:setProperty name="calc" property="amt" value="<%= amnt%>"/>
    <p ><font >结果: </font>    
    <%
		double res=calc.calculate();	
		out.println(res);
	%>
   <p align="center">
		<input type="submit" value="确认" name="OK">
   </p>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -