HTML标签问题
Web.xml中已经配好了HTML,
<taglib>
<taglib-uri>/struts-html</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
</taglib>
a.jsp:
<%@page contentType="text/html;charset=gb2312"%>
<%@taglib uri="/struts-html" prefix="html"%>
<html:html locale="true">
<html:base/>
<html:button property="testb" value="提交"/><br>
<html:file property="user" value="浏览"/><br>
<html:messages id="test_m" message="abcdefghijklmn"/><br>
<html:link page="/a.jsp">aaa</html:link><br>---------------------------报错
UserName:<html:text property="usera"/><br>-----------------------------报错
</html:html>
为什么上面2处报错啊,其他却正常啊??
错误提示:
org.apache.jasper.JasperException: Exception in JSP: /File/a.jsp:10
7: <html:button property="testb" value="提交"/><br>
8: <html:file property="user" value="浏览"/><br>
9: <html:messages id="test_m" message="abcdefghijklmn"/><br>
10: <html:link page="/a.jsp">aaa</html:link><br>
11: UserName:<html:text property="usera"/><br>
12: </html:html>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(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:802)
root cause
java.lang.NullPointerException org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1056)
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:448)
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.File.a_jsp._jspx_meth_html_link_0(a_jsp.java:205)
org.apache.jsp.File.a_jsp._jspService(a_jsp.java:112)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
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:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
------解决方案--------------------<html:link page="/a.jsp">
================================
路径错了?
------解决方案--------------------我感觉是因为你没有<html:form></html:form>的问题吧
------解决方案--------------------