File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes How to redirect URL to external page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "How to redirect URL to external page?" Watch "How to redirect URL to external page?" New topic
Author

How to redirect URL to external page?

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi JSP Specialists,

I would like to redirect a menu on web page such as the About menu which essentially points to http://abc.com/reporting-school/about.

The content of $HOME/tomcatProd/webapps/reporting-school/WEB-INF/jsps/about.jsp is as follows:



However, I would like to redirect this About menu to another external website such as http://hobbies.com/about instead but has failed to do so with
the following example:



I am not familiar with JSP or the Apache Tomcat Spring, Solaris 10 development platform, where this application has been developed.

Any assistance would be much appreciated.

Thanks,

jack
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

What library or framework is <app:page> from? It's not a standard JSP action.

Why are you trying to use a JSP as a redirect? A JSP is for creating views. Doing anything else is a misuse of the technology. And putting Java code in a JSP is an obsolete practice from over 10 years ago.

Back up a bit and explain what you are actually trying to accomplish. You haven't made it clear. (For example you mention "menu" yet I see no evidence of anything menu-like.)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Bear,

I have no idea what library but isn’t Spring the framework? This application was delivered to us by external developers who are no longer contactable.

Do you have any suggestion on how to redirect a menu called “About us” on the application to an external “About us” page? The content of target about.jsp is incorrect according to your observation. Would a simple HTML redirect URL command be able to achieve this?

Hope this help. I am just as lost due to my limited understanding of how the application was developed.

Thanks again,

Jack
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

If you simply want to go to another page when "About us" is clicked, you'd simple make it a link with an <a> tag.
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Bear,

Below is a working pure XHTML page that successfully:



However, the URL redirection failed when placed this file (about.htm) in $HOME/tomcatProd/webapps/reporting-school/WEB-INF/jsps because this Spring application is looking for about.jsp instead of about.htm. As a result, would you know which configuration / property file to change the lookup file name if possible?

Thanks a lot again,

Jack
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

is your dispatcher in your web.xml mapped to /?

If so what does the controller code that has a handler for about_us.htm look like?

also that custom tag lib you quoted earlier is not Spring either. You will have to ask someone on your team if you are not familiar with it.


[How To Ask Questions][Read before you PM me]
Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi Bear Bibeault & Bill Gorder,

I have found another consultant who is familiar with this technologies to resolve this issue for us.

Thanks for all your help anyhow,

Jack
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to redirect URL to external page?