index.jsp源代码如下:
*****错误好像发生在这里******************
<%@ page import="Converter,ConverterHome,javax.ejb.*,javax.naming.*, javax.rmi.PortableRemoteObject,java.rmi.RemoteException,java.math.*" %>
****************************************
<%!
private Converter converter = null;
public void jspInit() {
try
{
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/ejb/TheConverter");
ConverterHome home =
(ConverterHome)PortableRemoteObject.narrow(
objRef, ConverterHome.class);
converter = home.create();
} catch(javax.naming.NamingException ne)
{ }
catch(javax.ejb.CreateException ce)
{
}
catch(java.rmi.RemoteException re)
{
}
}%>
<html>
<head>
<title>Converter</title>
</head><body bgcolor="white">
<h1><center>Converter</center></h1>
<hr>
<p>Enter an amount to convert:</p>
<form method="get">
<input type="text" name="amount" size="25">
<br>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
<%
String amount = request.getParameter("amount");
if ( amount != null && amount.length() > 0 ) {
BigDecimal d = new BigDecimal (amount);
%>
<p><%= amount %> dollars are
<%= converter.dollarToYen(d) %> Yen.
<p><%= amount %> Yen are
<%= converter.yenToEuro(d) %> Euro.
<%
}
%>
</body>
</html>
*****错误好像发生在这里******************
<%@ page import="Converter,ConverterHome,javax.ejb.*,javax.naming.*, javax.rmi.PortableRemoteObject,java.rmi.RemoteException,java.math.*" %>
****************************************
<%!
private Converter converter = null;
public void jspInit() {
try
{
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/ejb/TheConverter");
ConverterHome home =
(ConverterHome)PortableRemoteObject.narrow(
objRef, ConverterHome.class);
converter = home.create();
} catch(javax.naming.NamingException ne)
{ }
catch(javax.ejb.CreateException ce)
{
}
catch(java.rmi.RemoteException re)
{
}
}%>
<html>
<head>
<title>Converter</title>
</head><body bgcolor="white">
<h1><center>Converter</center></h1>
<hr>
<p>Enter an amount to convert:</p>
<form method="get">
<input type="text" name="amount" size="25">
<br>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
<%
String amount = request.getParameter("amount");
if ( amount != null && amount.length() > 0 ) {
BigDecimal d = new BigDecimal (amount);
%>
<p><%= amount %> dollars are
<%= converter.dollarToYen(d) %> Yen.
<p><%= amount %> Yen are
<%= converter.yenToEuro(d) %> Euro.
<%
}
%>
</body>
</html>
解决方案 »
- 项目中,Spring注入问题
- 请问在建立web项目的时候选择java ee5还是1.4有什么区别啊
- ssh结合的时候遇到org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session
- Hibernate OneToMany新建对象问题
- 中文错误(struts1.2+hibernate3.1)
- 我需要一个金钱的表单验js,如输入格式必须为00.00格式的
- javaWebStudio+tomcat+oracle的问题,感激
- 用B/S的方式,如何在B端运行S端的exe
- struts部署问题问题,高分求教
- 什么时候用实体bean,什么时候用会话bean。
- 困扰我很久啦,再不解决ejb就无法再学下去啦(解决后马上给分)
- jb9+jboss3.2.2调试jsp
"Jsp2.jsp": java.lang.NoSuchMethodException: com.borland.jbuilder.webserverglue.weblogic.jsp.NadaJavac does not define 'public static int compile(String[], java.io.PrintWriter)'[Compilation errors : ]
"Jsp2.jsp": java.lang.Exception: [Compilation errors : ]
Exception in thread "main"
但我只发现了这个包jbuilder.jar\com\borland\jbuilder\web\weblogic,而没有上面那个包。难道是我jbuilder有问题?大家说个话呀,帮我顶一下也行。