• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

VO issue - Struts question!!

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!!
I am a newbie to struts.
I want to validate my undertsanding of the basic
Struts framework viz a viz the VO issue that i will explain thereafter.
My understanding of the flow using struts and EJB is as follows:
Browser -> ActionServlet -> populates FormBean and
instantiates the Action Class (based on
struts-config.xml entries)->calls EJB-> calls DAO->accesses DB.
The DAO creates a VO that is passed back to the EJB which in turn passes it back to the Action class.
Now, How is this VO data used by the next view (JSP)defined. What is the mechanism?
For eample, in page1.html I have an id which is passed all the way to the DAO. The DAO fetches the data from the DB based on this ID and returns a collection (maybe a vector of objects/resultset).
Now how does the next page i.e. the DetailPage.jsp get this data and how to use this to show it in a tabular form.
I know it is a very basic question.. would appreciate an easy to understand(newbie context) answer.
Thanks in advance,
Rajat
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Struts Forum - also known as the Frameworks Forum .
 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The DAO creates a VO that is passed back to the EJB which in turn passes it back to the Action class.
Now, How is this VO data used by the next view (JSP)defined. What is the mechanism?


Hi there,
There are a number of things you can do at this point:
1. You can have the DAO method or Action class store the VO in the request object. The resulting JSP can then retrieve the contents of the VO bean as appropriate.
2. If you wish to pre-populate a form with the contents of the VO class, you can use the DAO method or action class to create a new form bean and populate its attributes with values in the VO object. As long as the form bean is associated with the target JSP page via the action mappings in the struts-config.xml file, the JSP page should render it no problem.
Just two of the many options available!
Cheers,
Darryl
 
Rajat Nayer
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what are the other options.
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rajat,
There's no finite list to choose from. You use them as dictated by your needs, chosen architecture, programming style, etc.
Darryl
[ June 26, 2003: Message edited by: Darryl A. J. Staflund ]
 
This tiny ad will self destruct in five seconds.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic