This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 8836
    
    7

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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Pojo Action in struts 2
 
Similar Threads
Struts 1.0.1 using Wsad
Using Shell script to call struts Action
program flow problem
Design struts 2
Struts2 annotation validation