你可以檢查你的struts-config的部件是否齊全,如<data-sources>....<form-beans>...
解决方案 »
- 软件设计模式速查手册
- 一个数据库连接问题,为什么抛出异常啊
- 请问sun.misc.包里面的东西和其他rt.jar的类有什么不一样吗
- myeclipse自带的maven无法更新依赖
- hiernate org.hibernate.LazyInitializationException: could not initialize proxy
- 如何用java 读取存在ACCESS里的bmp图像
- 孙卫琴的helloapp例子中的HelloAction.java编译通不过。。。
- 大家帮忙解答一下,
- 高分求JavaMail邮件发送问题答案!!(200)(UP有分)
- 再问Struts一个问题:那个cancel按钮究竟是怎么一回事呢?
- 刚出道,应该选择做那样呢(技术)
- IE打印模版LAYOUTRECT的问题
看看"/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml
这两个xml文件的语法有没有错误,validator的jar 包有没有加进去
另:
<data-sources>不是必须的,因为一般的项目是有专门的DAO层,并不是由struts管理的
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<data-sources></data-sources>
<form-beans>
<form-bean name="UserInfo" type="Form.HelloForm">
<form-property name="userName" type="java.lang.String"></form-property>
</form-bean>
<form-bean name="registerForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="username" type="java.lang.String"></form-property>
<form-property name="phone" type="java.lang.String"></form-property>
<form-property name="zip" type="java.lang.String"></form-property>
<form-property name="age" type="java.lang.String"></form-property>
<form-property name="email" type="java.lang.String"></form-property>
</form-bean>
</form-beans>
<global-exceptions></global-exceptions>
<global-forwards></global-forwards>
<action-mappings>
<action
path="/HelloWorld"
type="Action.HelloAction"
name="UserInfo"
scope="request"
validate="false"
input="/page/hello.jsp">
<forward name="success" path="/page/hello.jsp"></forward>
</action>
<action
path="/regaction"
type="Action.RegisterAction"
name="registerForm"
scope="session"
validate="true"
input="/page/register.jsp">
<forward name="success" path="/page/success.jsp"></forward>
</action>
</action-mappings>
<controller contentType="text/html;charset=gb2312"
locale="true">
</controller>
<message-resources parameter="app.application"></message-resources>
<message-resources parameter="app.applicationregister"></message-resources>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in></struts-config>
所有的包都加进去了的.
出现了以下的严重错误
严重: Servlet /TEST threw load() exception
javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'严重: The element type "form-validation" must be terminated by the matching end-tag "</form-validation>".
javax.servlet.ServletException: The element type "form-validation" must be terminated by the matching end-tag "</form-validation>".
但是都有</form-validation>严重: Parse error in application web.xml
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name action
javax.servlet.ServletException: The element type "form-validation" must be terminated by the matching end-tag "</form-validation>".
---------------------
你把这两个xml文件用QQ传给我吧,贴出来太难看,但是我保证是这里面的问题
我的QQ:8781835