• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html:link causing exception

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic