Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to call ejb-session bean with jsp

591068Aug 1 2007 — edited Aug 2 2007
I had wrote a very simple session bean named HelloWorld fellow the Demo.It can be accessed by java client successfully. I want to access the session bean from a jsp file, but it's give a error said "cann't find the name",please the professor give me a way to solve the problem. My jsp file is like this:
InitialContext ctx;
ctx=new InitialContext(p);
HelloWorldSession helloWorld=(HelloWorldSession)ctx.lookup("HelloWorldSessionBean/remote");
out.println(helloWorld.sayHello("World"));

The jsp test file and the session bean are in the same project.
TKS for you help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2007
Added on Aug 1 2007
2 comments
518 views