Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect()

 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi guys
i want to do response.sendRedirect() in jsp level i have written the
following scripplet

is this a correct way .iam not getting any error in console but this page is not displayed properly
if their is some other way to do this please suggest me

regards
amir
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Is the code executed? Meaning, do you see the "u null" in the log file?
 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Report post to moderator
yes iam getting ulf
[ June 03, 2008: Message edited by: Amirtharaj Chinnaraj ]
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Report post to moderator
Whats the location of the redirected File?

Assuming its in same directory as the jsp file then use

From Servlet API
the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root.

Hope it helps
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Duplicate of:
http://www.coderanch.com/t/365796/Servlets/java/response-sendRedirect

Please don't ask the same question in multiple fora.
It wastes people's time.
 
    Bookmark Topic Watch Topic
  • New Topic