Hello,

I've been using the Struts framework for a couple of months
now and have really fancied it. I try as much as possible
to adhere to the MVC guidelines, but have run into a couple
of problems I've not been able to solve.

I have a form which is validated by Struts-validator. One
of the form's properties is a pull-down menu which contains
list of selectable items. These list of selectable items
are generated dynamically (by being called from an EJB).
The problem I have is when an error in the form occurs
Struts brings back the form page, but the servlet container
(Tomcat) then reports a "no such bean" error -- this bean
containing the list of items that populate the pull-down
menu.

The bean is stored in a request-level scope by the
controller servlet. Now when the form is submitted (new
request), and an error is found, the form is displayed
again. But because the bean was stored in a request-level
scope, the bean is no longer found.

What is the "propery" way of fixing this? Currently, I've
implemented a tag which generates this list (it basically
calls the EJB) and stores it in a page-level scope, so the
servlet no longer bothers storing this in any scope. But
doesn't doing this "break" the "separate logic from the
view" rule? I don't want to store it in the session-level
scope as well as the list _can_ be updated frequently.
Granted, the session-scope seems to be the ideal solution,
though.

What are your thoughts on this? I'd appreciate help on the
matter, as I'm weeding out "non-conforming" implementations
in my code. :)

Thanks for your help in advance.

=====


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

Reply via email to