You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rajiv mulay <mr...@applabs.net> on 2001/06/11 13:35:13 UTC

forward attribute

HI,

How do i forward attributes from Action class, which can be accessed in the jsp page. so that specific error can be displayed


mapping.findForward("failure");


<forward name="failure" path="/examp/logon.jsp" />


thanks rajiv

Re: forward attribute

Posted by Oleg V Alexeev <go...@penza.net>.
Hello rajiv,

Monday, June 11, 2001, 3:35:13 PM, you wrote:

rm> How do i forward attributes from Action class, which can be
rm> accessed in the jsp page. so that specific error can be displayed

rm> mapping.findForward("failure");


rm> <forward name="failure" path="/examp/logon.jsp" />

Add redirect attribute to the forward mapping to avoid "true" jump to
the forward page -

<forward name="failure" path="/examp/logon.jsp" redirect="false"/>

In Action class create objects, store it in request context and return
forward to the failure page. In failure page you can access all stored
early objects via bean-access tags - struts related or jsp:useBean.

-- 
Best regards,
 Oleg                            mailto:gonza@penza.net



Re: Where should I use .do and where .jsp for the same file

Posted by Oleg V Alexeev <go...@penza.net>.
Hello Eda,

Monday, June 11, 2001, 11:39:58 AM, you wrote:

ESE> Hi
ESE> Here is a small doubt. Please inform me where should I call a
ESE> file with .do extension and where should I call the same file
ESE> with .jsp extension.

*.do is not file - web.xml maps all requests to this extension to the
ActionServlet. ActionServlet uses information from struts-config to
process such request and uses to this purpose Action classes -

    <action    path="/news"
               type="com.sv.action.BaseViewAction"/>

Each Action class contains perform method. ActionServlet call this one
and it returns ActionForward class to switch to appropriate page
(*.jsp) to display result of processing or error page or another
purpose page.

Another words - *.do is mapping to the Action class to perform some
activity at server and *.jsp is view to display result of such
activity.
               
-- 
Best regards,
 Oleg                            mailto:gonza@penza.net



Re: Where should I use .do and where .jsp for the same file

Posted by Eda Srinivasareddy Eda <ed...@yahoo.com>.
 Hi 
The main utilization of .do arises with the <html:link...> tag. '.do' is used only to call a mapping not to call a jsp. If u wanted to call a mapping through a link we can't call it as '/mappingname'.We can  call it only as '/mappingname.do' . For clarity see the following code.
<html:link page="/iterate" style="text-decoration:none" target="_self"> is WRONG
<html:link page="/iterate.do" style="text-decoration:none" target="_self"> is CORRECT.
But with the submit button we can call a mapping as '/mappingname'. Here no need to use .do extension.
Are there any more points regarding this with any one of u pals.
Eda
 
  Eda Srinivasareddy Eda <ed...@yahoo.com> wrote: 
Hi 
Here is a small doubt. Please inform me where should I call a file with .do extension and where should I call the same file with .jsp extension. 
Looking forward 
Srinivas



---------------------------------
Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.


---------------------------------
Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.

Where should I use .do and where .jsp for the same file

Posted by Eda Srinivasareddy Eda <ed...@yahoo.com>.
Hi 
Here is a small doubt. Please inform me where should I call a file with .do extension and where should I call the same file with .jsp extension.
Looking forward
Srinivas



---------------------------------
Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.