• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts:Complete reference book error

 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run the first struts miniHR program on chapter 2. I downloaded the src code from online. I am using netbeans and added the struts library to the project. The errors I get are:


org.apache.jasper.JasperException: Exception in JSP: /index.jsp:14

11: <hr width="100%" noshade="true">
12:
13: • Add an Employee<br>
14: • <html:link forward="search">Search for Employees</html:link><br>
15:
16: </body>
17: </html>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


root cause

java.lang.NullPointerException
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:428)
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:311)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:463)
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:341)
org.apache.jsp.index_jsp._jspx_meth_html_link_0(index_jsp.java:93)
org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you define a global forward named search in your struts-config.xml file?
 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I shutdown and restarted Netbeans and it magically worked.
Thanks
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic