Another way to go, as MerrilG mentioned, is to define an Action for each
of these locations, and use the mapping's parameter property to pass the
loca=x part. 

<action path="/displayAvailBoston.do"
            type="app.whatever" <!--same handler class-->
             ...
            parameter="1"> <!-- parameter no1-->

<action path="/displayAvailChicago.do"
            type="app.whatever" <!--same handler class-->
             ...
            parameter="2"> <!-- parameter no1-->

The displayAvail action can then check the mapping parameter for the
location 

String loca = mapping.getParameter();

If the parameter is null, you can fall back to the original behavior.

This is the same basic idea as setting the parameter to the session, but
puts it all in the action mapping.

A real advantage here is that an implementation detail, like loca=1, is
not being embedded into the view. If this should change for any reason,
you can change the configuration without touching the presentation page.
Also, whatever locations are available for display becomes documented in
the Struts configuration, and so the presentation API now refers to the
locations by name. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Antony Stace wrote:
> 
> Opps, I should have mentioned I have a number of these links on the page, ie I have 
>links on the page to
> 
> http://localhost:8180/testapp/displayAvail.do?loca=1
> http://localhost:8180/testapp/displayAvail.do?loca=2
> http://localhost:8180/testapp/displayAvail.do?loca=3
> http://localhost:8180/testapp/displayAvail.do?loca=4
> 
> and if the user clicks on any of these links they should just get
> 
> http://localhost:8180/testapp/displayAvail.do
> 
> displayed in their browser.
>

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

Reply via email to