You lost me with that page too. The use of the word widget threw me
completely because I am used to seeing it reference to a concrete
component :)

I understand how to write the struts tag. Let's step back a bit. I'll
see if I can explain this better.

My question is how do I reference the collection for use in the when
it is stored via an attribute in the servlet context - ie the
ServletContext.setAttribute(attributeName, attributeValue) method
without using a scriptlet.

I have a servlet, loaded on startup, that in the init(ServletConfig)
method, creates a List of beans containing state information - name
and abbreviation. I have added this to the servlet context under the
attribute name of "states".

The value for the name attribute in the html:optionsCollection tag
would be "application" - the implicit JSP variable that refers to the
servlet context that the page is in.

Now the problem lies in the value for the property attribute of the
html:optionsCollection. It is supposed to be a property of "name" such
that is just a getBlah() method. However this is impossible on the
servlet context, because the collection resides as part of the
attribute map within the session context. The attribute name in the
map is "states", but I can't use "states" as the property value
because there is no getStates() method under ServletContext.

How do I retrieve this collection out of the servlet context attribute
map for use in the html:optionsCollection tag WITHOUT using a
scriptlet to make the collection available as some page scoped
collection? Is this possible? I don't want scriptlets exposed in the
JSP page itself. If I have to use one I will just write a tag to do
it.

Chris

On 3/1/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
> On 3/1/06, Chris Cheshire <[EMAIL PROTECTED]> wrote:
> > Michael,
> >
> > Thanks for the reference, but it doesn't explain very much.
> >
> > Yes the widget looks like what I want, but is it something I download?
>
> You lost me.
>

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

Reply via email to