Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect issues

 
shreehari nair
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic