Keith,

I will need global forwards to jsp pages anyway.
I have to forward to a JSP page in perform() method of my action class.
Otherwise nothing
will be returned/displayed to client.


<forward   name="edit"       path="/EditEntry.do"/>
<forward   name="editShow"   path="/entry.jsp"/>


In perform method of EditEntry action class I need to do this.

return (mapping.findForward("editShow"));


Maris



-----Original Message-----
From: Keith Bacon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 13, 2001 5:08 PM
To: Struts Users Mailing List
Subject: Re: forward to jsp or to do ?


It's best to forward to an action (to a do). In fact I
suspect it's the normally accepted way to do it.
Instead of your jsp being run directly, the struts
action servlet will create the form bean defined for
the action & call your action classes perform method
first.
You can set properties of the form so those values
will be displayed.
You can add beans to the request so the jsp can use
them.
Your jsp gets data from the from bean & from the
request not directly from databases etc. Slightly
indirect but means all links between your jsp &
business logic are via action classes - valuable
de-coupling in large systems.

Probably other advantages too. Search the archives Ted
Husted has discussed this many times before!
Keith,

--- Maris Orbidans <[EMAIL PROTECTED]> wrote:
> 
> What' s the difference between a forward to jsp or
> to do ?
> 
> In case of forward to jsp  just servlet compiled
> from the jsp file will
> be called. Am I right ?
> 
> What will happen if I forward to *.do ?
> 
> regards,
> Maris
> 
> 
> <global-forwards>
>     <forward   name="logon"      path="/logon.jsp"/>
>     <forward   name="logoff"     path="/logoff.do"/>
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
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