wood burning stoves 2.0*
The moose likes Struts and the fly likes Pojo Action in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pojo Action in struts 2" Watch "Pojo Action in struts 2" New topic
Author

Pojo Action in struts 2

Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Posts: 52

Hi,
Can we make a pojo as action. if yes then how? can someone give an example of it.

Regards
Prashant
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

There's no big secret. Just declare it in struts.xml like you would any other action:

SomePOJO has to have a no-argument constructor so it can be instantiated by reflection and someMethod should return a String.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
wood burning stoves
 
subject: Pojo Action in struts 2