我只是尝试在 jsp 页面中包含一个带有 struts 提供标签的文本框。但它的表现非常典型。
在职的
<html:text property="name" value=""></html:text>
不工作
<html:text property="name"></html:text>
所以,没有财产'value'
,它就不起作用。请帮帮我。
注意:使用tomcat 6.0
bean,逻辑运行良好,并且在 html 中,大多数逻辑运行正常。广播、文本区域、文本是一些引起问题的原因。
JSP文件
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Registration Form</title>
</head>
<body>
<html:text property="name"></html:text>
</body>
</html>
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 14
11: <title>Registration Form</title>
12: </head>
13: <body>
14: <html:text property="name"></html:text>
15: </body>
16: </html>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.index_jsp._jspService(index_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
javax.servlet.jsp.JspException: Cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:864)
org.apache.struts.taglib.html.BaseFieldTag.prepareValue(BaseFieldTag.java:126)
org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(BaseFieldTag.java:102)
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:80)
org.apache.jsp.index_jsp._jspx_meth_html_005ftext_005f0(index_jsp.java:96)
org.apache.jsp.index_jsp._jspService(index_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.18