Simon (we meet again)..

Sounds very interesting, but I'm not quite there: 
Firstly I'm not entirely sure what you mean by separating view and edit pages. I'm 
actually trying to write what I think of as an edit page (it basically is setting up 
some 
parameters for a graph). But I need to load default parameters (well its worse than 
that I actually load an existing "user" session bean as the page parameter, as this 
contains all the stuff I need).

Secondly, I do see what you mean by having a PreAction and a PostAction, but I 
don't see how I would set that up in the struts-config. Can you hold my hand a bit 
here, as it where?

One more thing... how does the PreAction actually call the associated JSP. I seem to 
have a problem with this!

Cheers... Howard

On 15 Oct 2002 at 15:35, Chappell, Simon P wrote:

> Howard,
> 
> Remember what I said about Scriptlets? Well, calling an action with a mode is worse 
>and you'll be forced to watch Emmerdale farm until the cows come home as punishment! 
>(Gotta give these folks some humour, even if they won't understand it :-)
> 
> Here's what I do, for what it's worth:
> 
> When I have view and edit pages, I separate them. Better to have two pages that 
>don't have a bunch of <logic:equal> tags in them IMNSHO. e.g. fooDisplay.jsp and 
>fooEdit.jsp
> 
> When I have a page foo.jsp, I create two actions: fooPreAction and fooPostAction. 
>The fooPreAction does whatever it takes to setup for the foo.jsp (mostly sticking 
>data into fooForm) and the fooPostAction does the actual processing. In our recent 
>project we observed this pattern and naming 
convention and it worked quite well for us.
> 
> Simon
> 
> -----------------------------------------------------------------
> Simon P. Chappell                     [EMAIL PROTECTED]
> Java Programming Specialist                      www.landsend.com
> Lands' End, Inc.                                   (608) 935-4526
> 
> 
> 
> >-----Original Message-----
> >From: Howard Miller [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, October 15, 2002 3:27 PM
> >To: [EMAIL PROTECTED]
> >Subject: (sigh!) another pre-populate question
> >
> >
> >Sorry if I keep asking variatons on the same question.
> >
> >I have a JSP called "dosomething" and an associated action 
> >called "dosomething 
> >Action".
> >
> >I want to pre-load the form, but this page can be called from 
> >all over the place, so my 
> >previous page calls the action for the "dosomething" page 
> >directly, having a link that 
> >looks like "/dosomething.do?action=new". The action creates 
> >and pre-populates the 
> >bean for the form. 
> >
> >Question: (a) is this a sensible way to proceed (as far as I 
> >can tell it is similar to the 
> >method in the struts-example). and (b) How do I correctly call 
> >the "dosomething.jsp" 
> >page from the "dosomethingAction"??
> >
> >Problem is I am using "mapping.getInput()" and all I get is an 
> >empty page with just 
> >headers - no errors - weird! 
> >
> >HM
> >
> >--
> >To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to