• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sendRedirect issue

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends
Iam coding an administration module in jsp. I take data in login.html , check if user is valid from database in logger.jsp and then sendRedirect to index.jsp. This consistently works with netscape but in ie6 it shows two pages in the same browser window with the http header contents between them. Iam not get a break through. Please help.
Iam using tomcat3.2.1 on linux
thanks
[ August 17, 2002: Message edited by: Gholkar Raja ]
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raja
I m not experienced with sendRedirect concept. I would like to suggest u to use <jsp:forward page:"<pagename>" />.This ll work fine 4 both
HIH
Regards
Vishal
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gholkar,
With respect to response.sendRedirect("new_url"), what is actually happening is that it is making a round trip back to the client window (IE or Netscape) and simulating the user/client actually typing in another URL and hitting ENTER.
Normally, you can't see it unless you're on a slow speed dial-up connection or the internet is hiccuping. The <jsp:forward> that was suggested to you by the previous response is in actuality a "RequestDispatcher forward" command which does not make a round trip to the client. The redirect with "RequestDispatcher forward" occurs on the server side. However, it is not "back" button friendly since if the user hits "back" on his/her browser, they are returned to the previous URL in their history, which is not the last page.
Jerome
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to try following the MVC architecture (see Jakarta Struts). Instead of putting your login logic in a JSP page, put it in a JavaBean and access that bean using a servlet (or Struts action bean). If the JavaBean successfully logs in the user, forward the request to your index.jsp page. If not, forward back to your login form.
Otherwise, you might want to try using the built-in login functionality in the servlet specificiation by adding security-constraint, login-config, and security-role elements to your web.xml file. Hope this helps.
 
Don't MAKE me come back there with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic