This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes redirect issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "redirect issues" Watch "redirect issues" New topic
Author

redirect issues

shreehari nair
Greenhorn

Joined: Mar 05, 2008
Posts: 1
I have created a redirect component

when the system finds a missing page, it will throw a 301 ( Moved Permanently ) and redirect to a page

I am implementing the redirect as shown below






but when i use the above code,

if you specify



and when you give




why is it so , am i missing something ? is there any better way to throw 301 and redirect ?

master's .. please help me
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Have you checked the HTTP headers in the response?

I am wondering if the first is being detected by the container as a directory request and is being automatically redirected to the welcome file, rather than running through your '301' code.

The correct behaviour when a resource is not available is to return 404. Doing otherwise may have unforeseen consequences.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: redirect issues
 
Similar Threads
response.sendRedirect
Server side redirect (301) - JSP :: How to set time delay before page redirect using
response.Status codes
problem in HTTP response redirect
problem in HTTP response redirect