File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Context path independency Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Context path independency" Watch "Context path independency" New topic
Author

Context path independency

Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Hi,
We have an application built using struts, and we need to show it to our clients. So we deployed it to a server that can be accesed form internet.
The war name is aaa.war so, when deployed to tomcat, it generates a aaa folder.
The problem is that the url that is visible from the internet has to be www.oururl.com/aaa_bb/, not aaa. So, as Struts prepends the context to forms' action when it renders them to html, all the forms fail.



becomes



We can change the name of the war to aaa_bb to make it work. But it would be good if our forms were independent of the context.
Is there any way to do this?
Thanks a lot.
Pablo


2B || !2B
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Your Struts forms are independent of the context. If you change the context externally, they still work. The problem you're dealing with has to do with the fact that you're using a "virtual host" to access the application from an external network, and when you set up that host, you're using a different context name than the one used to access the application locally.

The only solution I'm aware if is just to make sure that the context name is the same for both local and external users.


Merrill
Consultant, Sima Solutions
Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Ok, thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Context path independency