Bug 131756 - Drop lists currently have to be added as Session variables
Summary: Drop lists currently have to be added as Session variables
Alias: None
Product: Red Hat Network
Classification: Red Hat
Component: RHN/R&D   
(Show other bugs)
Version: RHN Devel
Hardware: All Linux
Target Milestone: ---
Assignee: Mike McCune
QA Contact: Red Hat Satellite QA List
: 137431 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2004-09-03 22:39 UTC by Mike McCune
Modified: 2007-04-18 17:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-12-06 07:15:12 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Mike McCune 2004-09-03 22:39:13 UTC
All our other UI widgets are added as request attributes.  But because
of struts we have to add them to the Session.

Comment 1 Mike McCune 2004-09-03 22:39:40 UTC
EMAIL Conversation about the issue:

Yeah, I wasn't pleased with this either, I didn't want to use a
session variable for a widget.  Not something that should go in the

So, the reason its there is I did the following while getting
validation to work (this was a few weeks ago, so I could be getting
some of the details off):

1) Started out treating it like a standard request variable:


This works fine if your form is a:


2) Switched the form over to a:


Then, upon hitting the page I got a nasty stacktrace:

javax.servlet.ServletException: Cannot find bean under name

I was like, WTF, what is broken in DynaValidatorForm that makes it no
longer able to recognize Objects within the request when using the:

          <html:options collection="availablePrefixes"
            labelProperty="label" />

tag.  I did lots of digging and messing around.  I tried the following:

a) Adding the collection on the form class as a <form-property> in the
struts-config.  This did nothing, lame.  Same error.

b) Adding the above collection in step a) and also did a <bean:define>
above the <html:options> tag so it would force it to be available to
the JSP.  This sort of worked but once you submitted the page, the
list would become empty.

c) Added it to the session.  This worked, but made me feel dirty.

After spending about a day on this annoying problem I felt it was time
to move onto other things.  This problem only seems to be related to
the usage of html:options.  All the other components on the pages
behaved the same once validation was turned on.  One way around it
would be to re-write our own html:options tag, but that seemed a bit
over the top.

It would be interesting to try this with Struts 1.2 and leaving it as
a request variable to see if it was any different.

If anyone else has thoughts on how to *not* use a session variable to
solve this problem, I'd definitely appreciate it.


Chip Turner wrote:

> EditAddressAction uses a setSession to set the list of available
> countries for a user; is this absolutely necessary?  It makes sense to
> put something like this at the -request- scope, but session scope
> means it'll last around foreverandever... is that what we really want?
> Likewise for prefixes on the CreateUserAction?
> There is a comment that says struts throws them away if validation
> fails, but when validation fails, shouldn't it be sending a failure to
> a page that has as its pre-render-action the code that sets these up
> at the request scope?  I'm not quite following the flow of what
> breaks.
> Chip

Comment 2 Mike McCune 2004-12-03 18:13:08 UTC
*** Bug 137431 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.