on 08-06-2005 7:29 AM
Hi,everybody.I have a questioon is below (can i call a session bean directly in a .jsp file without through a javabean?)
I had made a test. I create a simple jsp file is aaa.jsp(just present some words).
And i deployed it and typed the url http://localhost:50000/aaa/aaa with IE. It can display.
But when I add some source code in jsp. There are some errors. The ie error message is below
(The request can't be processed.
Details: The requested resource ( aaa/servlet/aaa.jsp ) is not found)
Why it needs a servlet? I didn`t create a servlt!!
The source i added is below
try {
public Sessionccc ccc;
InitialContext ctx = new InitialContext();
Object ob = ctx.lookup
("java:comp/env/ejb/SessioncccBean");
SessioncccHome home =(SessioncccHome)
PortableRemoteObject.narrow
(ob,SessioncccHome.class);
ccc = home.create();
} catch (Exception e) {
throw new Exception("Error instantiating
Calculator EJB" + e.toString());
}
Please help me.Thx a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Louis
Could you tell what you have specified in your web.xml
Regards
Pran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It`s my web.xml
<display-name>WEB APP</display-name>
<description>WEB APP description</description>
<servlet>
servlet-name>aaa.jsp</servlet-name>
<jsp-file>/aaa.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>aaa.jsp</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<ejb-ref>
<ejb-ref-name>ejb/SessioncccBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>zxcvboy.SessioncccHome</home>
<remote>zxcvboy.Sessionccc</remote>
<ejb-link>ccc.jar#SessioncccBean</ejb-link>
</ejb-ref>
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.