Jakarta Struts relative path question on form submit

Discussion in 'Java' started by Stratocaster, Feb 3, 2004.

  1. Stratocaster

    Stratocaster Guest

    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
    Stratocaster, Feb 3, 2004
    #1
    1. Advertising

  2. Stratocaster

    bo123 Guest

    carmine,
    Have you tried Controller attribute forwardPattern in Struts 1.1?
    bo123, Nov 18, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ronald Fischer

    Struts: module relative path puzzle

    Ronald Fischer, Jul 25, 2003, in forum: Java
    Replies:
    0
    Views:
    1,020
    Ronald Fischer
    Jul 25, 2003
  2. Ronald Fischer
    Replies:
    0
    Views:
    506
    Ronald Fischer
    Aug 28, 2003
  3. D Godwin
    Replies:
    2
    Views:
    580
    D Godwin
    Apr 21, 2006
  4. untung
    Replies:
    0
    Views:
    433
    untung
    Oct 7, 2009
  5. Megha Vishwanath
    Replies:
    3
    Views:
    668
    Megha Vishwanath
    Jul 20, 2004
Loading...

Share This Page