wood burning stoves 2.0*
The moose likes Struts and the fly likes Model object is not populated directly in struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Model object is not populated directly in struts2" Watch "Model object is not populated directly in struts2" New topic
Author

Model object is not populated directly in struts2

Arulselvan Dharmalingam
Greenhorn

Joined: Mar 31, 2011
Posts: 2
Hi,
I am new to struts2. i tried to populate model object from action class directly.when i run the application the null pointer exception thrown.this mean struts is not populated the form values into model object.i used spring for dependency injection.please go through the following files and let me know.thanks

MY Action class


Struts.xml


aplicationContext.xml for spring


jsp
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

Welcome to the JavaRanch.
Please UseCodeTags in the future. They preserve your formatting and make your code easier to read.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
krishna bala
Ranch Hand

Joined: Jul 20, 2009
Posts: 61

Pleaase go through following sites,you'll get good examples
struts2 sample code
www.vaannila.com,
Arulselvan Dharmalingam
Greenhorn

Joined: Mar 31, 2011
Posts: 2
Hi Krishna,
it's working fine.
mistake in name property username
<s:textfield name="user.username" label="Username"/>
 
Don't get me started about those stupid light bulbs.
 
subject: Model object is not populated directly in struts2