Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sendRedirect problem with absolute URL

843841May 31 2006 — edited May 31 2006
Hello all,
I am having trouble with the sendRedirect method

The URL im trying to redirect is on another server.
A fragment code of my servlet is the following

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
......

try{
response.sendRedirect(URL);}
catch (Exception e) {logger.debug("Error in redirection"+e.getMessage());}
}
,I get nothing and no exceptions.
When I tried redirecting to a relative url (a jsp in my webapp) the redirection works fine.
I havent found anything saying that sendRedirect works only with relative URLs.

Is there something more i have to do for the redirection to work?

Is there any other way of redirecting to another server?

Thanks,
Panagiotis
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2006
Added on May 31 2006
1 comment
419 views