Results 1 to 2 of 2
  1. #1
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Rep Power

    Default How can I redirect in servlet?

    I have a servlet that stores data given via parameters in a data base. If the executeUpdate() method returns 0 I want to redirect to another servlet when it returns a value > 0.
    How can I do this?

  2. #2
    paty is offline Member
    Join Date
    Jul 2007
    Rep Power


    try that:
    Java Code:
    RequestDispatcher dispatcher = request.getRequestDispatcher("servlet");
    dispatcher.forward(request, response);

Similar Threads

  1. How to redirect the output
    By Java Tip in forum
    Replies: 0
    Last Post: 04-04-2008, 03:36 PM
  2. post and redirect from within an applet
    By gtriant in forum Java Applets
    Replies: 0
    Last Post: 03-18-2008, 06:42 PM
  3. Replies: 0
    Last Post: 03-11-2008, 01:25 PM
  4. How to redirect the output
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 10-04-2007, 10:30 PM
  5. how to redirect the browser
    By simon in forum Java Applets
    Replies: 1
    Last Post: 08-02-2007, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts