| 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: 8263
|
|
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: 48
|
|
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"/>
|
 |
 |
|
|
subject: Model object is not populated directly in struts2
|
|
|