aspose file tools*
The moose likes Struts and the fly likes <html:link/> not working with inbuilt ForwardAction class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "<html:link/> not working with inbuilt ForwardAction class" Watch "<html:link/> not working with inbuilt ForwardAction class" New topic
Author

<html:link/> not working with inbuilt ForwardAction class

Anuj Singh
Ranch Hand

Joined: May 04, 2007
Posts: 47
Hey guys.I am using 1.1.In my jsp somewhere I have written <html:link action="regn">SignUp</html:link>.Also in the struts-config I have my action mapping as:
<action path="/regn"
type="org.apache.struts.actions.ForwardAction"
parameter="/regnform.jsp">
</action>
On clicking on the hyperlink SignUp,its not going to the regnform.jsp as on clicking on the hyperlink,the URL is coming as http://localhost:8080/JavaBondCom/regn.
It should come as regn.do.But the suffix .do is not getting attached on the URL generation.
Moreover in one of the book,its written "When you use the action attribute instead of the page attribute in
<html:link>, you need not specify the “.do” explicitly.".
P.S:If in the URL bar,if I add the ".do" explicitly,it works fine!!THe regn.jsp is displayed.

So now how to resolve this problem?How will I add the suffix do in the generated URL after clicking the hyperlink??

Thanks
Anuj


SJCP 1.5 with 93%.Preparing for WCD
Shailesh Kumar Saxena
Greenhorn

Joined: Dec 15, 2012
Posts: 25

Hi Anuj....

You are right ..when you are using struts built-in tags , need not to add .do in action but you should write action starting with /
like

.....Its all I know. make me right , if I am wrong.

Thanks & Regards.


Shailesh Saxena,
Pilibhit, U.P. INDIA
Shailesh Kumar Saxena
Greenhorn

Joined: Dec 15, 2012
Posts: 25

Hi Anuj....

You are right ..when you are using struts built-in tags , need not to add .do in action but you should write action starting with /
like

.....Its all I know. make me right , if I am wrong.

Thanks & Regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <html:link/> not working with inbuilt ForwardAction class