• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing an object to action class

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a requirement like

1. I have a List<someDO> resultList; in my form bean.
2. In the jsp, I search based on certain criteria and in the action class, i set the the list in the form bean
3. Using <logic:iterate> i display the resultList in a table.
4. In each row of the table, I have an edit (link or button) .
5. On clicking the edit (link or button), I want to pass the whole object (DO) to the action class so that i can show a separate Edit jsp with all the corresponding values populated.

How to do it??

solution needed urgently. Thanks in advance
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Include some data that will identify the DO in the link to the DO edit action. This is usually the primary key of the DO in the database. In the action which populates the DO edit form, read the DO from the database.
 
sivaraman subbiah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe. But is there some way to pass the bean as such through html:link , or any other way like setting the bean in request scope inside the logic:iterate itself ??
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope.
See The Secret Life of JavaServer Pages by Bear Bibeault

If you are using a component based framework like Wicket or Tapestry, you could write code like that, because they do a lot of 'magic' under the covers to hide the request - response nature of HTTP. But Struts or other action based frameworks don't provide this kind of functionality.
 
reply
    Bookmark Topic Watch Topic
  • New Topic