File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes can we change sendRedirect() method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "can we change sendRedirect() method?" Watch "can we change sendRedirect() method?" New topic

can we change sendRedirect() method?


Joined: Apr 03, 2002
Posts: 3
I have enormous amount of servlet code in which i am ocassionally redirecting to *.jhtml files. But now all *.jhtml 's are changed to *.jsp. So instead of going to each and every servlet to change .jhtml to .jsp can i change the sendRedirect(String url) method as :
if (url.indexOf(".jhtml") != 0)
url = url.replaceString();
where replaceString is some method which changes the .jhtml to .jsp
martin samm
Ranch Hand

Joined: Nov 09, 2000
Posts: 31
how about using perl & regexp across all you .java files or if you're using Apache have a 404 handler which redirects X.jhtml to .jsp?

martin samm<BR>
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Please read the Javaranchnaming policy and change your display name if you wish to continue posting here. Thanks.

Matthew Phillips
I agree. Here's the link:
subject: can we change sendRedirect() method?
It's not a secret anymore!