Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pojo Action in struts 2

 
Prashant Saraf
Ranch Hand
Posts: 57
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can we make a pojo as action. if yes then how? can someone give an example of it.

Regards
Prashant
 
Joe Ess
Bartender
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic