Skip to Content
author's profile photo Former Member
Former Member

A problem

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2005 at 04:00 AM

    Hi Louis

    Looks fine try

    http://localhost:50000/aaa/

    or

    http://localhost:50000/aaa/aaa.jsp

    Regards

    Pran

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2005 at 10:25 AM

    Hi Louis

    Could you tell what you have specified in your web.xml

    Regards

    Pran

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Louis

      I tried to reproduce yoru error the only way I could achieve it is by placing a servlet-name that has not been defined , otherwise with the xml file u have shown all the three urls seem to be valid

      Regards

      Pran

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.