wood burning stoves
The moose likes Struts and the fly likes Forms delete part of the URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Forms delete part of the URL" Watch "Forms delete part of the URL" New topic

Forms delete part of the URL

Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
We're deploying our apps to a demo server (Tomcat5.5.23) to be shown to our customers.
In our LAN the address for the server is so the apps are at, etc
So to show them outside, whe mapped http://www.oururl.com/test/
This way if we go to
http://www.oururl.com/test/app1, http://www.oururl.com/test/app2, we can access our application though the Internet. This works great until I submit a struts form.
For example, this form, extracted from app1

Should go to

But it removes the /test part of the url, it goes to
So, every form fails.
This is the mapping for that particular form... the rest are done the same way.

Is there any way to keep the complete url when submiting a form?

2B || !2B
Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
I'm sorry for insisting, but I still have this error and I don't know how to fix it...
If any further explanation of the problem is needed, please tell me.
Kevin N Shah

Joined: Sep 24, 2006
Posts: 4
How the context path is set? The action path is not getting prefixed with contextpath! Look in to server.xml!

Hope this helps.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you set up a virtual host such as


it just plain isn't going to work with Struts. The reason it won't work is that you've set up an additional context "/test" that the web application doesn't know anything about.

If you set up a virtual host such as:


It will work.

Consultant, Sima Solutions
Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Thanks for your replies!!!
Merrill, I'll try the virtual host like that.
Kevin, could you give me some more detail? What should I look for?
Thanks again,
I agree. Here's the link: http://aspose.com/file-tools
subject: Forms delete part of the URL
It's not a secret anymore!