tem.out.println("中文转换失败!");
}
}
return results;
}
}
5.JSP页面的开发:针对Session Bean,我编写了一个JSP页面。
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.text.*" %>
<%@page import="java.util.*"%>
<%@page import="java.sql.*" %>
<%@page import="javax.naming.*" %>
<%@page import="java.lang.*" %>
<%@page import="javax.rmi.PortableRemoteObject" %>
<%@page import="javax.ejb.* "%>
<%@page import="cacdsystem.*"%>
<html>
<head>
<title>产品技术需求提取</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form id=form name=form1 method=post>
<input type=hidden id=pageFlag name=pageFlag value=''input''>
<table cellSpacing=0 cellPadding=0 width="98%" border=0 align=center >
<tr height=30 class=titleFont>
<td><font color=''#0058a5''> 您所在位置:产品技术需求提取</font></td>
</tr>
<tr height=1 class=titleFont>
<td></td>
</tr>
</table>
<table width="98%" border="0" bgcolor=''#999999'' align=center>
<tr>
<td><b> <font color="#ffffff">产品技术需求提取</font></b></td>
</tr>
</table>
<table width="98%" border="1" align=center bgcolor="#f0f0f0" bordercolor=''#ffffff'' cellspacing=0 cellpadding=0 class=titleFont>
<tr bgcolor=''#e0e8f8''>
<td> </td>
</tr>
<%
InitialContext ctx = new InitialContext();
VocHome vocHome =
(VocHome)PortableRemoteObject.narrow(ctx.lookup("Voc"),VocHome.class);
Voc voc = vocHome.create();
Collection collection = voc.getVocTechnique();
if(collection.size() > 0)
{
Iterator iters = collection.iterator();
int i = 0;
while(iters.hasNext())
{
++i;
%>
<tr>
<td><input type=''checkbox'' name=<%= "select"+i %>
value=<%= i %>><%= (String)iters.next() %><br></td>
</tr>
<%
}
}
%>
<%
voc.remove();
%>
<tr bgcolor=''#e0e8f8'' align=middle>
<td>
<p align=left></p>
</td>
</tr>
<tr align=middle>
<td>
<input type=submit id=submit1 name=submit1 value="提 交">
<input type=reset id=submit1 name=submit value="重 置">
</td>
</tr>
</table>
</form>
</body>
</html>
EJB技术之旅(二)(5)
时间:2010-12-10
6.系统Deploy: 到现在为止,我们实现了Entity Bean、Session Bean、JSP,从而实现了该实例所需要的代码。为使我们测试代码的正确性,我们来Deploy到服务器上。首先,由于在Session Bean中引用了Entity Bean,所以需要申明。
<session>
<display-name>Voc</display-name>
<ejb-name>Voc</ejb-na
|