www.webdeveloper.com
Results 1 to 4 of 4

Thread: JSP Page Forwarding Problem

  1. #1
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    10

    JSP Page Forwarding Problem

    Hello to everyone,

    I have been in a boring situation in my project.. I can't forward to a jsp page from my servlet.. I found many codes; but none of them worked.. The URL adress never changes.. (Always stays at the same page)

    Here's some of codes I tried:

    Code:
    RequestDispatcher rd = request.getRequestDispatcher("/admin.jsp");
    rd.forward(request, response);
    or

    Code:
    getServletConfig().getServletContext().getRequestDispatcher("/admin.jsp").forward(request, response);
    or

    Code:
    response.setHeader("Location","/admin.jsp");
    I need ur helps.. Thanx in advance..
    Talha

  2. #2
    Join Date
    Jul 2009
    Location
    Lunar City
    Posts
    1
    Hi

    All forward does is pass the request on to another page. It does not redirect the user.

    You want to use JavaScript or a meta tag to redirect the user to a different URL (that's the only way you can change the location bar).

    http://www.web-source.net/html_redirect.htm

  3. #3
    Join Date
    Jan 2009
    Posts
    3,346
    You can do an http header redirect just like in asp, php, and others.

    http://www.exampledepot.com/egs/java.../redirect.html

  4. #4
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    10
    I'm grateful for ur helps.. Thanx a lot.. I'm going to apply ur recommends..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles