0

I am using a proxy to connect to a Struts 2 application hosted on Tomcat. The context used in the URL through the proxy is different from the context path used by Tomcat. I have submit buttons like the one below that will write the URL as "/tomcat-context/search" instead of "/proxy-context/search".

<s:submit cssClass="btn" action="search" value="Confirm" />

Really, I just want a relative path. So ideally I'd like it to just be "search". Is there any way to change how struts assembles this button's action path or the request context it uses?

Thanks.

  • Well... Isn't `search` already relative (to the current location)? So just `search` might as well be enough. If not, you can always get a hold of the request object and then `request.getContextPath() + "/search"`, right? – kaqqao Dec 14 '17 at 16:20
  • You won't wire different context to the application unless you may use some url rewriting technique accepted by the tomcat environment. – Roman C Dec 14 '17 at 16:52

0 Answers0