struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: Can I pass an object through request object from Action class
Date Wed, 25 Jun 2003 06:10:23 GMT
Yes, you can put the resultset into a request attribute, forward to the jsp
(make sure its a non-redirecting forward!), and have the code/tags in your
jsp access the resultset.

It is considered better practice to extract/wrap the resultset data with
javabeans and forward these in the request attributes and access them via
tags in the jsp, as this allows you to seperate your model (the data) from
its persistence implementation (relational databases) so later if you
switched to some other persistence mechanism you would not need to refactor
your view rendering code. In the action you would also want to hide the ugly
sql details behind some kind of model layer / facade for the same reason.

-----Original Message-----
Sent: Wednesday, 25 June 2003 14:02
Subject: Can I pass an object through request object from Action class
Importance: High


   Already I raised this question to this list. But no reply.

   Let me rephrase the question again.

   I need to execute and show the reports using struts.

   I have input jsp, action class and action form associated to that. In
the action class I will generate the sql based on the input from jsp
page/action form, create a result set. Now I need to pass the resultset
to the report generation code.

   Can I put the resultset object in the request object and pass the
resultset to the success page defined for the action?

   If this approach is not good/possible, please let me know with the
correct approach.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message