Dave Newton wrote:
Laurie Harper wrote:
There's a couple of ways to do this better ;-) Firstly, you can reference the URL pattern matches ({1} etc) in the 'parameter' attribute of the action mapping, so you can pass stuff along that way.

Yeah, I didn't want to parse the parameter, plus I'm already using it. Putting properties-like into the parameter seems gimpy.

Not like re-parsing the URL... :D

I didn't like the overloading of parameter much either, which was why I was so happy to get the second option... :)

More usefully, you can use the <attribute> element within your action mapping to do the same thing (this requires a post-1.2.7 build so if you don't want to use a nightly build you'll need to wait for the upcoming 1.3 to use this).

Yeah, I was locked into the Struts version so I couldn't do that either... *sigh*

I think the changes are quite small; you could, perhaps, patch them into the version of Struts you're using, if using a patched build is any more acceptable than switching versions altogether (seems like a long-shot...)

    <attribute name="param1" value="{1}"/>
    <attribute name="param2" value="{2}"/>

Then your action has setParam1(String), etc. methods and you can avoid re-parsing the URL.

That's so much nicer. Thanks for teasing me with something I can't use! ;)

You're most welcome ;-)

--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to