Results 1 to 4 of 4

Thread: Unable to send request to Servlets

  1. #1
    Join Date
    Feb 2009
    Posts
    105

    Unable to send request to Servlets

    Hi,

    I have two servlets; /Login and /ShoppingCart

    I make a POST request to the login servlet. The post method of the login servlet does some username-userpassword checking on the database and if successful, forwards the request onto the shoppingcart servlet.

    I've been using the RequestDispatcher.forward(request, response) method to forward the request onto the shoppingcart servlet but it keeps going to the POST method of the shoppingcart servlet (I want to forward to the GET method).

    I've seen a few solutions to this problem and it seems to be to just call the 'doGet' method in the doPost method but I cannot do this as I have an implementation for the POST method.

    Can anyone point me to a solution to my problem? Thanks in advance

  2. #2
    Join Date
    Dec 2008
    Posts
    183

    Re: Unable to send request to Servlets

    I got it to work by puttiing the program DBHandler in package: forms and added the following to the web.xml file in Norms/WEB-INF/

    Code:
     <servlet>
          <servlet-name>          DBHandler      </servlet-name>
          <servlet-class>         forms.DBHandler      </servlet-class>
        </servlet>
    
    
        <servlet-mapping>
            <servlet-name>        DBHandler          </servlet-name>
            <url-pattern>        /servlet/DBHandler  </url-pattern>
    The path to the class file is:
    "C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\Norms\WEB-INF\classes\forms\DBHandler.class"

  3. #3
    Join Date
    Dec 2008
    Posts
    93

    Re: Unable to send request to Servlets

    As a rule, you can only forward between components in the same web container. Since the IPlanet servlet and the Weblogic JSP are in different JVMs, the forward operation fails.

    If possible, I suggest you switch to a client-side redirect: response.sendRedirect(). That should work regardless of where the components are located.

  4. #4
    Join Date
    Dec 2008
    Posts
    128

    Re: Unable to send request to Servlets

    If you can forward to a "real" JSP in weblogic, why don't you create a "/signatureok.jsp" JSP, and then have the JSP forward to your servlet. That way, your forward operation happens in a single container.

Similar Threads

  1. Replies: 5
    Last Post: 18-02-2011, 10:07 PM
  2. Replies: 3
    Last Post: 08-02-2011, 02:26 PM
  3. A request to send or receive data disallowed error
    By Madhuparna in forum Technology & Internet
    Replies: 6
    Last Post: 30-06-2010, 12:03 AM
  4. Send Http Request In Java
    By ramsun in forum Software Development
    Replies: 5
    Last Post: 26-02-2010, 09:55 PM
  5. How to send HTTP request from specific IP?
    By ANSEL in forum Technology & Internet
    Replies: 4
    Last Post: 28-01-2010, 08:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,394,921.65859 seconds with 16 queries