You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by struts fox <st...@yahoo.com> on 2004/02/18 20:40:52 UTC
html link tag
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.
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.