This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pojo Action in struts 2" Watch "Pojo Action in struts 2" New topic

Pojo Action in struts 2

Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Posts: 57

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

Joe Ess

Joined: Oct 29, 2001
Posts: 9154

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.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Pojo Action in struts 2
jQuery in Action, 3rd edition