Jakarta Struts relative path question on form submit

S

Stratocaster

Hi All,

Any help is greatly appreciated!

I have a curious problem. Before I get into the details let me
discribe my environment. We have an IPlanet server listening on port
80 and redirecting all traffic to our WebLogic server listening on
port 8022. The IPlanet server is acting as a traffic cop. We have a
rule set up in the IPlanet obj.conf file as follows:

<Object name="Omega" ppath="*/omega/*">
Service fn="wl_proxy" WebLogicHost="ourdomain.com" WebLogicPort="8022"
PathTrim="/omega"
</Object>

So when a request comes in,
http://ourdomain.com/omega/EnrollApp/enrollform.jsp
it trims the "omega" and adds the port "8022" and redirects it to
http://ourdomain.com:8022/EnrollApp/enrollform.jsp

In the browser the url still appears as
http://ourdomain.com/omega/EnrollApp/enrollform.jsp

The omega portion is there just to compartmentalize the applications
IPlanet is trafficking. As you can see it isn't part of the
application deploy in weblogic.


The application uses the Struts framework. The enrollform.jsp's form
action is as follows:

<html:form action="enroll">

In my struts-config.xml file my action mapping is as follows:

<action path="/enroll"
type="org.strato.caster.EnrollAction"
name="EnrollForm"
scope="request"
input="/enrollform.jsp"
validate="true">
<forward name="thankyou" path="/ThankYou.jsp"/>
</action>

Everything works fine if I bypass IPlanet and go directly to the url:
http://ourdomain.com:8022/EnrollApp/enrollform.jsp

If I use the IPlanet url:
http://ourdomain.com/omega/EnrollApp/enrollform.jsp
the initial form comes up ok, but when I submit the form it trims the
"omega" portion and attempts to post to this url:
http://ourdomain.com/EnrollApp/enrollform.jsp
Then we get the standard page cannot be found.

After the form is initially rendered in the browser doing a view
source I see that the form tag is as follows:

<form name="EnrollForm" method="POST" action="/EnrollApp/enroll.do">

The problem is the leading slash in the action. How can I tell struts
to use a relative path, without the leading slash, so that it will
include the "omega" part and not start from the root?

If I save the "view source" to a static html file and remove the
leading slash from the form action, it posts correctly (it includes
the "omega" part).

It seems no matter what I do Struts is always adding the leading slash
onto the form action in the generated html.


Thanks a bunch.
carmine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top