You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Namasivayam, Sudhakar (Cognizant)" <NS...@chn.cognizant.com> on 2004/02/01 11:30:19 UTC

Navigating back

Hi ,
 What is the simplest way to navigate back?
Like....
On exception on any page I forward to a error page and then i want a link in the error page that forwards back to the previous page.

Thanks and regards,
Sudhakar

Re: html link tag

Posted by Geeta Ramani <ge...@cmpco.com>.
Hi!  Replace <html:link page="/do/myaction">Add An Employee</html:link> by
<html:link page="/myaction.do">Add An Employee</html:link>
and it should work..

Regards,
Geeta

struts fox wrote:

> I just did an example strust project in JBuilder, and it works.
> I have a jsp with a form that issues an action that forwards to itself and it works.
>
> Now I wanted to just do a html link to call the action from a new generic jsp page and it doesn't work.
>
> <html:link page="/do/myaction">Add An Employee</html:link>
>
> but it says error resource not available.  From what I read a form or link can call an action, and this action, called myaction, being a servlet should just be able to be called.
> So what do I have wrong with my syntax?
>
>
>
> Below is the struts config and the form that does work.
>
>  <action-mappings>
>     <action name="empForm" path="/myaction" scope="session" type="strutstest1.Myaction">
>       <forward name="forward" path="/myjsp.jsp" redirect="true" />
>     </action>
>   </action-mappings>
>
>
>
>  Below is the form code that does work:
>
> <html:form action="/myaction.do" method="POST">
> <html:text property="name"/>
> <html:submit property="submit" value="Submit"/><br>
> </html:form>
>
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail SpamGuard - Read only the mail you want.

html link tag

Posted by struts fox <st...@yahoo.com>.
I just did an example strust project in JBuilder, and it works.
I have a jsp with a form that issues an action that forwards to itself and it works.

Now I wanted to just do a html link to call the action from a new generic jsp page and it doesn't work.

<html:link page="/do/myaction">Add An Employee</html:link>

but it says error resource not available.  From what I read a form or link can call an action, and this action, called myaction, being a servlet should just be able to be called.
So what do I have wrong with my syntax?

 

Below is the struts config and the form that does work.

 <action-mappings>
    <action name="empForm" path="/myaction" scope="session" type="strutstest1.Myaction">
      <forward name="forward" path="/myjsp.jsp" redirect="true" />
    </action>
  </action-mappings>

 

 Below is the form code that does work:

<html:form action="/myaction.do" method="POST">
<html:text property="name"/>
<html:submit property="submit" value="Submit"/><br>
</html:form>

 

 


---------------------------------
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

AW: Navigating back

Posted by Oliver Thiel <th...@gmx.de>.
Hi Sudhakar,
 
 
If you can/want use JavaScript:
<html:link href="javascript:history.back()" titleKey="back.title">
previous page </html:link>
 
 
Oliver
 
-----Ursprüngliche Nachricht-----
Von: Namasivayam, Sudhakar (Cognizant)
[mailto:NSudhakar@chn.cognizant.com] 
Gesendet: Sonntag, 1. Februar 2004 11:30
An: struts-user@jakarta.apache.org
Betreff: Navigating back
 
 
Hi , 
 What is the simplest way to navigate back? 
Like.... 
On exception on any page I forward to a error page and then i want a
link in the error page that forwards back to the previous page.
Thanks and regards, 
Sudhakar