struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <...@Germuska.com>
Subject Re: Report4Format: Setter on Property (of type Map) Not Getting Called After Form Submit
Date Mon, 09 Feb 2004 02:37:56 GMT
At 7:00 PM -0500 2/8/04, Patrick J. Nolan, Jr. wrote:
>The bean that I am working with is NOT an ActionForm - just a POJO - 
>I don't think this should matter. I see that the "getter" method is 
>getting called correctly by checking my System.out statements. 
>However, when I submit the form, the "setter" method does not 
>execute. I get no error message. Any ideas?

The only bean population Struts does is upon the the ActionForm 
object linked to the request action (via the action-mapping 'name' 
attribute).

It would be possible to use Commons BeanUtils and 
request.getParameterMap() to achieve what you want, but you'd need to 
write your own code to do it.  Since ActionForm is a class, not an 
interface, there's no way in the current Struts framework to have 
Struts automatically populate a non-ActionForm bean.

Using the "name" attribute on an html:* tag is purely for populating 
the contents of the form element on display; it has nothing to do 
with the processing of the request.

Hope this helps.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
       "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
             -- Jef Raskin

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message