struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Pilgrim" <peter.pilg...@db.com>
Subject RE: Extra Path Info Problem!!! HELP!!!
Date Wed, 06 Mar 2002 11:03:01 GMT

Well this would solve some URL: design problems. FInally
mapped URL `http://jcorporate.com/products/expresso' can become a reality.

More seriously where is this <path-mappings> XML coming from?
I have never seen this grammar before.

--
Peter Pilgrim                       ++44 (0)207-545-9923

............................................ Swamped under electronic mails


---------------------------------------- Message History ----------------------------------------


From:  "Michael Nash" <mike@coralwave.com> on 05/03/2002 14:48 EST

Please respond to "Struts Users Mailing List" <struts-user@jakarta.apache.org>

To:    "Struts Users Mailing List" <struts-user@jakarta.apache.org>
cc:
Subject:    RE: Extra Path Info Problem!!! HELP!!!


Ted:

I've been experimenting with a way of doing mappings from "normal" URL's to
Action URI's, and wonder if it's the right approach. If so, I'd be happy to
drop it in for inclusion in a release when/if appropriate, or set it up as
an optional-add on.

I took the simple approach, and added a configuration like this:

<path-mappings>
        <path-mapping>
           <url-pattern>/form/*</url-pattern>
           <path>/application/Something.do</path>
           <fixed-param>
              <param-name>someParamName</param-name>
              <param-value>someParamValue</param-value>
           </fixed-param>
           <param>
              <param-number>1</param-number>
              <param-name>firstParam</param-name>
           </param>
           <param>
              <param-number>2+</param-number> <!-- the + means take
everything from param 2 onwards -->
              <param-name>secondParam</param-name>
           </param>
       </path-mapping>
    </path-mappings>

Then I have a servlet called "PathHandler", which I map to "/do/*", and...

if you issue a URL like:

/application/do/form/message/here/is/a/path

it would then simply issue a forward to:

/application/Something.do?someParamName=someparamValue&firstParam=message&se
condParam=here/is/a/path

Comments on whether or not this is the right way to go much appreciated, as
I need this functionality myself soon :-)

Mike





--

This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material
in this e-mail is strictly forbidden.



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message