struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
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.

<note>
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.
</note>

-----Original Message-----
From: thirumalai.veeraswamy@polaris.co.in
[mailto:thirumalai.veeraswamy@polaris.co.in]
Sent: Wednesday, 25 June 2003 14:02
To: struts-user@jakarta.apache.org
Subject: Can I pass an object through request object from Action class
Importance: High


Hi,

   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.

Thanks,
Thiru



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message