RE: response.sendRedirect problem

2001-06-14 Thread Simon Kitching
Title: SV: response.sendRedirect problem



Hi 
Rafael,

I 
don't think Patrik's suggestion is the answer; you should be able to sendf
 ully-qualified URLs in redirects
(forwards, on the other hand, do need to be within the same serveri
 nstance).

I 
suggest that you try connecting to orion via telnet, to see exactly what isb
 eing sent back, ie

telnet 
your-orion-host your-orion-port (eg telnet localhost 8080)
GET 
/your-page-which-does-redirect (yes, in your case you might have to temporarily 
modify your code, 
unless 
you can figure out how to simulate a POST).

One 
problem I have struck when using sendRedirect in jsp pages is that it is 
necessary to put a return
statement after the sendRedirect. Forgetting this may cause the page to 
output other stuff to the client 
that 
prevents the redirect from happening.

Hope 
this helps,

Simon

  -Original Message-From: Patrik Andersson 
  [mailto:[EMAIL PROTECTED]]Sent: 14 June 2001 
  09:08To: Orion-InterestSubject: SV: 
  response.sendRedirect problem
  Don't write a full URL In the sendRedirect(param) call. Use an 
  URI instead. Do: 
  response.sendRedirect("/some/place/file.html"); 
  instead of: 
  response.sendRedirect("http://host.domain:port/some/place/file.html"); 
  
  -Ursprungligt meddelande- Från: Rafael Alvarez [mailto:[EMAIL PROTECTED]] 
  Skickat: den 14 juni 2001 00:44 Till: 
  Orion-Interest Ämne: response.sendRedirect 
  problem 
  Hi all, 
  this is the scenary: I have a 2 jsp pages and 2 servlet. The 
  flow is: 
  pag1.jsp --(via Post)--  --servlet1 --(via forward) 
  --  --servlet2 
  --(via response.sendRedirect) --  
  -- pag2.jsp 
  when viewed using some browsers in Mac (IE and Netscape
  alike), the redirect sends the url http://hostname/servlet/servlet2/http//hostname/servlet/servlet2 
  
  and I got a 400 Bad Request Error, no matter which url I use 
  in the response.sendRedirect (as I recall, my last was 
  "foobar/whatever") 
  On windows and unix browsers works fine. 
  Any ideas? 
  -- Best regards, Rafael 
  mailto:[EMAIL PROTECTED] 
  

___
This communication contains  information which  is confidential and
may also be privileged. It is for the exclusive use of the intended
recipient. If you are  not the intended recipient, please note that
any form of distribution, copying or  use of this  communication or
the information in it is strictly prohibited. If  you have received
this communication  in  error,  please  return  it  with  the title
"received in error"  to  [EMAIL PROTECTED]  then  delete the
email and destroy any copies of it. Please contact our Helpdesk  on
0162876 if you need assistance. Thank you for your cooperation.
___



Re: response.sendRedirect problem

2001-06-14 Thread john_haasbeek



The path you provide to response.sendRedirect should be run through
response.encodeRedirectURL first.  This may help solve the problem because it
will generate an absolute, fully qualified URL.

John H.




Rafael Alvarez [EMAIL PROTECTED]@orionserver.com on 06/13/2001 05:43:35 PM

Please respond to Orion-Interest [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   Orion-Interest [EMAIL PROTECTED]
cc:

Subject:  response.sendRedirect problem


Hi all,

this is the scenary: I have a 2 jsp pages and 2 servlet. The flow is:

pag1.jsp --(via Post)--
  --servlet1 --(via forward) --
  --servlet2 --(via response.sendRedirect) --
  -- pag2.jsp

when viewed using some browsers in Mac (IE and Netscape alike), the
redirect sends the url
http://hostname/servlet/servlet2/http//hostname/servlet/servlet2

and I got a 400 Bad Request Error, no matter which url I use in the
response.sendRedirect (as I recall, my last was foobar/whatever)


On windows and unix browsers works fine.

Any ideas?

--
Best regards,
 Rafaelmailto:[EMAIL PROTECTED]