You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matt Koidin <mk...@smartixs.com> on 2001/12/20 17:17:13 UTC

Passing Value With A Forward?

I am using a basic index.jsp page as the intro page to my web application.
The index.jsp page forwards controls to a simple Struts application class.

Currently the only entry in the index.jsp file is:

<logic:forward name="applicationLoad"/>

Where applicationLoad is an action that "preps" the web site.

I'd like to pass in a parameter from this file? Does anyone know how to do
this? I tried adding :

<bean:define id="CLIENT_ID" scope="session" value="1"/>
<logic:forward name="applicationLoad"/>

But when I went to read the CLIENT_ID variable in the action it was null:

       HttpSession session = request.getSession();
       String clientId = (String) session.getAttribute("CLIENT_ID");

Is there anyway to pass a parameter in with a forward and read it in the
action?

Thanks,
Matt


----- Original Message -----
From: "Siggelkow, Bill" <bi...@mirant.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, December 14, 2001 3:52 PM
Subject: RE: How to list options in order?


> I see two primary options ...
> (1) use a TreeMap instead of a Hashtable
> However, to me this be unnecessary if the sorting is purely for
presentation
> purposes, or
> (2) Create a JavaBean that holds two lists ... one for the option values
and
> one for the option labels ... sorted according to the labels.
>
> I have done this on numerous occasions where I have a collection of things
> that contain IDs for use as values and then names for use as labels ...
> Basically, I first sort the collection according to the field I want
> (typically, I do this using a Comparator) then I create two lists one for
> the values and one for the labels.
>
> Of course, if you are accessing the data from a database and can do the
> sorting there it is preferable then sorting in the middle tier.
>
> BTW, I am using Struts 1.0 -- there may be features in the nightly build
> that make this easier.
>
> -----Original Message-----
> From: Sue Deng [mailto:sdeng@covalent.net]
> Sent: Friday, December 14, 2001 3:20 PM
> To: struts-user@jakarta.apache.org
> Subject: How to list options in order?
>
>
> Hi,
>
> I am using html:select and html:options like this:
>
>                <html:select property="key">
>                  <html:options collection="organizations" property="key"
> labelProperty="value"/>
>                </html:select>
>
> The organization is a collection of Hashtable.
>
> Is there any way I can list the options in labelProperty order?
>
> Thanks,
>
> -Sue
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>