You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tim Sawyer <Ti...@PanCredit.com> on 2002/02/11 18:35:52 UTC

Pre and Post Processing

Hello.

I'm new to struts, and I'm having a discussion with one of our designers
about pre and post processing in web pages.

Previously, we have used the standard JSP way of creating pages, with lots
of code in the top and body of pages, in order to access functionality we
have exposed in some Java beans.  These Java beans wrapper XML services
provided by our Forte 4GL back end.

Say we have a form which accepts customer details.  I can see how the Struts
mechanism allows us to put the code that was previously at the top of the
next JSP page into an ActionHandler, which decouples the flow of pages quite
nicely, and we have a nice way of doing post processing on the contents of a
page.

However, if we have a page that has to display a list of addresses for a
customer, and we have to run some code to get the list before we can display
it, where should this code live?  Should it be in the ActionHandler with the
previous page's post processing, or is there a better place to put it?  Or
would you suggest writing a custom tag to perform the pre-processing?

Thanks for any thoughts,

Tim.


This e-mail and its attachments are for the use of the addressee only.
It may contain information that is legally privileged, confidential and 
exempt from  disclosure.  It is not a contract, and prices, data 
and other information are not warranted as to completeness or accuracy.  
Any comments or statements  made herein do not necessarily 
reflect those of PanCredit Systems Limited. If you are not the intended 
recipient you must not copy, distribute or disseminate this e-mail 
or attachments to anyone other than the addressee.  
If you receive this communication in error please advise us by telephone 
at once. 
PanCredit Systems Limited 
Tel:	+44 113 250 0260 
Fax:	+44 113 250 0621 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Pre and Post Processing

Posted by Nick Pellow <ni...@cortexebusiness.com.au>.
> Say we have a form which accepts customer details.  I can see how the
Struts
> mechanism allows us to put the code that was previously at the top of the
> next JSP page into an ActionHandler, which decouples the flow of pages
quite
> nicely, and we have a nice way of doing post processing on the contents of
a
> page.

You will find that for pages with a form on it, the neatest way to split up
the code
that was on your JSP is to use two actions. The first action simply gets the
data
needed for displaying the page (including the form), the second one will
process the form.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Pre and Post Processing

Posted by Keith Bacon <ke...@yahoo.com>.
In your Action class. Once you know you want that page sent get the list & put it in the request
for the JSP to access.
People with bigger systems split their action processing.
I think if you search the www.mail-archive.com (bit slow at the moment) for DispatchAction you'll
get some relevant discussion.
k.


--- Tim Sawyer <Ti...@PanCredit.com> wrote:
> Hello.
> 
> I'm new to struts, and I'm having a discussion with one of our designers
> about pre and post processing in web pages.
> 
> Previously, we have used the standard JSP way of creating pages, with lots
> of code in the top and body of pages, in order to access functionality we
> have exposed in some Java beans.  These Java beans wrapper XML services
> provided by our Forte 4GL back end.
> 
> Say we have a form which accepts customer details.  I can see how the Struts
> mechanism allows us to put the code that was previously at the top of the
> next JSP page into an ActionHandler, which decouples the flow of pages quite
> nicely, and we have a nice way of doing post processing on the contents of a
> page.
> 
> However, if we have a page that has to display a list of addresses for a
> customer, and we have to run some code to get the list before we can display
> it, where should this code live?  Should it be in the ActionHandler with the
> previous page's post processing, or is there a better place to put it?  Or
> would you suggest writing a custom tag to perform the pre-processing?
> 
> Thanks for any thoughts,
> 
> Tim.
> 
> 
> This e-mail and its attachments are for the use of the addressee only.
> It may contain information that is legally privileged, confidential and 
> exempt from  disclosure.  It is not a contract, and prices, data 
> and other information are not warranted as to completeness or accuracy.  
> Any comments or statements  made herein do not necessarily 
> reflect those of PanCredit Systems Limited. If you are not the intended 
> recipient you must not copy, distribute or disseminate this e-mail 
> or attachments to anyone other than the addressee.  
> If you receive this communication in error please advise us by telephone 
> at once. 
> PanCredit Systems Limited 
> Tel:	+44 113 250 0260 
> Fax:	+44 113 250 0621 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>