Hi,

There are two ways of calling a servelt method from a jsp:

1.      for any public method on the servlet, you can call getServlet() from
the JSP for any servlet within the same container specifying the name of the
servlet as specified in the web.xml. This will however bypass the http call
interposition that is done by the container and you are responsible for any
synchronisation or any call interposition requirement. Not recommended.
2.       You can make a URLConnection to the servlet from your JSP and call
doGet() or doPost(). The logic should be there in these two methods.

Of course, you can use request dispatcher for mundane uses.

Hope this helps.

Regards,
Partha

        ----------
        From:  Sireesha Beeram [SMTP:[EMAIL PROTECTED]
        Sent:  Wednesday, June 16, 2004 4:29 PM
        To:  [EMAIL PROTECTED]
        Subject:  Re: communicate servlet from jsp

        To send the call to the servlet page:

        1.In your jsp page, put
        <FORM action="aa" method="post">-->"aa" servlet's doPost() method
will be
        called. From here you can direct the call to different places

        or
        2. You can include java beans in the jsp page using->
        <jsp:usebean id="bean" class="bb"..>
        and you can call methods on this included bean
        ${bean.property}

        You can also check:
        http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag.html

        hope this is what  you are asking for..





        >From: Shiva Kumar <[EMAIL PROTECTED]>
        >Reply-To: "A mailing list for discussion about Sun Microsystem's
Java
        >         Servlet API Technology." <[EMAIL PROTECTED]>
        >To: [EMAIL PROTECTED]
        >Subject: communicate servlet from jsp
        >Date: Wed, 16 Jun 2004 01:29:22 -0600
        >
        >hi all,
        >
        >my servlet has some methods,and it has deployed in webserver .i
want to
        >call that servlet methods from a jsp page.
        >plz help me how to call servlet methods from a jsp.
        >the path is like this.webapps is webserver root folder.
        >individual jsp files and servlets are working fine.
        >
        >webapps--->*.jsp
        >webapps-->WEB-INF-->web.xml    (description of all servlets)
        >webapps-->WEB-INF-->classes-->*.class    (servlet classes)
        >
        >
        >
        >thanks in advance
        >shiva kumar
        >

>___________________________________________________________________________
        >To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
        >of the message "signoff SERVLET-INTEREST".
        >
        >Archives:
http://archives.java.sun.com/archives/servlet-interest.html
        >Resources:
http://java.sun.com/products/servlet/external-resources.html
        >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

        _________________________________________________________________
        Getting married? Find great tips, tools and the latest trends at MSN
Life
        Events. http://lifeevents.msn.com/category.aspx?cid=married


___________________________________________________________________________
        To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
        of the message "signoff SERVLET-INTEREST".

        Archives:
http://archives.java.sun.com/archives/servlet-interest.html
        Resources:
http://java.sun.com/products/servlet/external-resources.html
        LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to