Didn't see this go through...resending...sorry for the duplicates...
________________________________
Hello,
I'm fairly new to struts development (actually a non-UI developer trying
to do some UI development) I'm trying to find an answer to a problem
that I am having with Struts 1.2.9 and proxy webservers.
I'm trying to set up a configuration as follows:
1. machine1: Apache WebServer with SSL using URL rewrite and proxy
redirect
Maps the following pattern:
https://machine1/proxy/machine2/3333/* ->
http://machine2:3333/context/*
2. machine2: Apache Tomcat 5.0 with Struts 1.2.9
The incoming requests are working fine. But my problem is that outgoing
URLs are not correct.
First problem is with URL redirects. I have an index.jsp in the root,
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<logic:redirect forward="main"/>
The URL in the Location HTTP header looks like
http://machine2:3333/context/application/main.do.
Second, sometimes URLs are relative
So, in the login.jsp page, we have a form element
<html:form action="/login.do">
<input type="hidden" name="j_username" value="<%=cookieUsername%>"/>
<input type="hidden" name="j_password" value="<%=cookiePassword%>"/>
</html:form>
What I see generated is the following...
<form name="loginForm" method="post" action="/interlace/login.do">
...
</form>
In my configuration, I can specify the url prefix for the proxy
webserver, so I do have that information somewhere. Is there a way to
make struts rewrite the URL so that a) It is always absolute and b) It
uses my external url prefix. Can I build a plugin to do this? I tried
writing a filter to rewrite the URLs but then I ran into the relative
URL issue.
Thanks,
Anil