你的tld文件中的属性名和你的表单中的属性名是一样的吗?
解决方案 »
- 修改jar里代码;求教最后一步如何生成jar
- com.microsoft.sqlserver.jdbc.SQLServerException: TDS 协议流无效。
- 怎样用生气了语句将sqlserver2000的某个数据库权限改为多用户
- javaee Hibernate 入门提问
- aaa
- 问一个tomcat下的JasperException异常的问题
- servlet文件上传过大提示
- 多个主健情况下的查询。hibernate
- 急,在线请教送100分
- Hibernate中怎样截获查询结果记录集ResultSet
- struts初学,想问一下,如果不用struts自己的表单验证方式行吗?(初级问题,请大家帮帮我)
- 求hibernate api文档,在线的不方便啊?
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
你的34行是什么?
看一下struts-html.tld里面是怎么写的,要对上。
写错的那个标签就在index.jsp的34行。
<html:form action="Lookup" name="lookupForm" type="wiley.LookupForm">struts-html.tld内容很多,要和哪个对上?刚接触struts,不好意思
需要怎么该呢?
<tag>
<name>form</name>
<tagclass>org.apache.struts.taglib.html.FormTag</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>action</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>acceptCharset</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>enctype</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>focus</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>focusIndex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>method</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>onreset</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>onsubmit</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>scriptLanguage</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>styleClass</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>styleId</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
把name="lookupForm"删掉
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.index_jsp._jspService(index_jsp.java:71)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:711)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:86)
org.apache.jsp.index_jsp._jspService(index_jsp.java:63)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
struts-config.xml
------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config
PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts.config_1_1.dtd"><struts-config>
<message-resources parameter="wiley.ApplicationResources"/>
<form-beans>
<form-bean name="lookupForm" type="wiley.LookupForm"/>
</form-beans>
<action-mappings>
<action path="/Lookup"
type="wiley.LookupAction"
name="lookupForm"
input="/index.jsp">
<forward name="success" path="quote.jsp">
<forward name="failure" path="index.jsp">
</action-mappings>
</struts-config>index.jsp
----------------------------
<%@page language="java"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
...
<html:form action="Lookup" name="lookupForm" type="wiley.LookupForm">
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit/></td>
</tr>
</table>
</html:form>
...
修改成<html:form action="/Lookup">2、在你的action path里面加上这个formbean的有效范围,scope="request"。
<action path="/Lookup"
type="wiley.LookupAction"
name="lookupForm"
scope="request"
input="/index.jsp">
<forward name="success" path="quote.jsp">
<forward name="failure" path="index.jsp">
</action>
把这里的name和type去掉试一下
...
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
...就是第二次贴的那个错误信息
:(
是不是struts版本的问题啊,我用的是sturts1.2.4
书上的例子是struts1.1的
1.2.4中action标签没有name和type属性
1.1的我下载不到,不知道是不是有<html:form action="Lookup" name="lookupForm" type="wiley.LookupForm">
<html:form action="Lookup" >
<html:form action="/Lookup" >
<html:form action="Lookup.do">
都试过了,都不行!
第一中情况结果是:Attribute name invalid for tag form according to TLD
后面三种情况结果是:ActionMappings or ActionFormBeans 我在struts-html.tld中加上name属性,运行错误是name没有setter方法,看来struts的action标签中确实没有name属性
郁闷中...
[email protected]
jakarta-struts-1.2.4-src\web\example