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

    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
    Posts
    41
    Rep Power
    0

    Default

    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 java.io
    Replies: 0
    Last Post: 04-04-2008, 02:36 PM
  2. post and redirect from within an applet
    By gtriant in forum Java Applets
    Replies: 0
    Last Post: 03-18-2008, 05:42 PM
  3. Replies: 0
    Last Post: 03-11-2008, 12:25 PM
  4. How to redirect the output
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 10-04-2007, 09:30 PM
  5. how to redirect the browser
    By simon in forum Java Applets
    Replies: 1
    Last Post: 08-02-2007, 05: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
  •