File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes html:link causing exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:link causing exception" Watch "html:link causing exception" New topic
Author

html:link causing exception

Sreedevi Vinod
Ranch Hand

Joined: Jan 17, 2005
Posts: 117
hi,

I'm a beginner in Struts. My index.jsp is causing a NullPointerException when I use <html:link> to link to another jsp. This is the code I used.


If I replace the line containing html:link with
<a href="success.jsp" >Customer Form</a>
then it works fine. I tried removong the slash before success.jsp,
but still it is not working. Both the JSPs are in the same directory.
Please advise.

Thanks
Devi
[ March 03, 2006: Message edited by: Sreedevi Vinod ]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Often, if standard html works then there is no reason to use one of the Struts custom tags. One thing I would say is to look at the source html generated ("view source" in your browser) and see what URL it is generating. It is correct? You could also try href instead of page. From the docs at http://struts.apache.org/struts-taglib/tagreference-struts-html.html#html:link:

href - Use the value of this attribute unchanged.
page - Use the value of this attribute as a module-relative URI, and generate a server-relative URI by including the context path and module prefix.

BTW...I am not sure how the html:base tag fits into this. It depends a little on how your application is deployed and your directory structure.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:link causing exception
 
Similar Threads
Cannot find message resources
Struts Error
"/tags/struts-logic" not found
problem in accessing a list through a iterate tag.
For Struts developers