请教一个用S2SH注册的问题

caixuanbin 2011-10-05 10:45:12
我用S2SH整合,弄一个注册的小程序,但老提示说找不到路径,不知道怎么回事,各位帮我看看吧。
下面是regist.jsp
${user.msg}
<s:form action="regist" method="post">
用户名:<s:textfield name="user.username" size="20"/><br/>
密码:<s:password name="user.userpassword" size="20"/><br/>
<s:submit value="注册"/>
</s:form>

下面是web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

下面是application.xml
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
</bean>

<bean id="userDAOImpl" class="dao.UserDAOImpl">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>

<bean id="userService" class="service.UserServiceImpl2">
<property name="userDAO">
<ref local="userDAOImpl"/>
</property>
</bean>

<bean id="Regist" class="action.Regist">
<property name="userService">
<ref local="userService"/>
</property>
</bean>

下面是struts.xml
<struts>
<constant name="struts.devMode" value="true"/>
<package name="Regist11" extends="struts-default" namespace="/my">
<action name="regist" class="Regist">
<result name="success">/regist.jsp</result>

</action>
</package>
</struts>


dao层
package dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import entity.User;

public class UserDAOImpl extends HibernateDaoSupport implements UserDAO {


public boolean exist(User user) {
System.out.println("正在验证数据......");
String hql="from User u where u.username='"+user.getUsername()+"'and u.userpassword='"+user.getUserpassword()+"'";
List userList=this.getHibernateTemplate().find(hql);
System.out.println("共找到数据:"+userList.size());
if(userList.size()>0&&userList!=null){
return true;
}else{
return false;
}
}

public void saveUser(User user) {
this.getHibernateTemplate().save(user);

}

}

下面是服务层
package service;

import dao.UserDAO;
import entity.User;

public class UserServiceImpl2 implements UserService2 {


private UserDAO userDAO;

public UserDAO getUserDAO() {
return userDAO;
}

public void setUserDAO(UserDAO userDAO) {
this.userDAO = userDAO;
}

public boolean exist(User user) {
return userDAO.exist(user);
}

public void saveUser(User user) {
userDAO.saveUser(user);

}











}

下面是实体类
package entity;

import java.io.Serializable;

public class User implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;

private String msg="";
private Integer userid;
private String username;
private String userpassword;
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getUserpassword() {
return userpassword;
}
public void setUserpassword(String userpassword) {
this.userpassword = userpassword;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}

}

配置文件:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="entity">
<class name="User" table="WL_USER">
<!--定义id-->
<id name="userid" column="USERID">
<generator class="increment"/>
</id>
<!--定义用户名-->
<property name="username" type="string" column="USERNAME"/>
<!--定义密码-->
<property name="userpassword" type="string" column="PASSWORD"/>
</class>
</hibernate-mapping>

hibernate.cfg.xml
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">jdbc:mysql://localhost/mytestdb</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>

<mapping resource="entity/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>

下面是action
package action;

import service.UserService2;

import com.opensymphony.xwork2.ActionSupport;

import entity.User;


public class Regist extends ActionSupport{

private String msg="";

private User user;

private UserService2 userService;



public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public UserService2 getUserService() {
return userService;
}

public void setUserService(UserService2 userService) {
this.userService = userService;
}

public String execute() throws Exception {
if(userService.exist(user)){
msg="注册成功";
user.setMsg(msg);
userService.saveUser(user);
}else{
msg="注册失败";
user.setMsg(msg);
};
return "success";
}

// public String getMsg() {
// return msg;
// }


}

我访问的路径是http://localhost:8080/testWeb/my/regist.jsp
但老是说找不到路径,怎么回事
...全文
121 点赞 收藏 18
写回复
18 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
caixuanbin 2011-10-06
[Quote=引用 14 楼 gmemai 的回复:]
引用 8 楼 caixuanbin 的回复:

引用 5 楼 niuniu20008 的回复:
http://localhost:8080/testWeb
404吗?
是的,肯定会出现404的啊XML code
<struts>
<constant name="struts.devMode" value="true"/>
<package name="Regist11" exten……
[/Quote]我想说的是,现在已经不是404 的问题了,再说了,我在web的配置文件里面已经设置为默认regist.jsp的,
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>

<welcome-file-list>
<welcome-file>regist.jsp</welcome-file>
</welcome-file-list>
</web-app>
回复
小V小V志 2011-10-06
启动报错了,肯定出现404,估计和spring配置有关
回复
caixuanbin 2011-10-06
[Quote=引用 12 楼 gmemai 的回复:]
首先想说的是访问action的格式是:http://localhost:8080/testWeb/my/regist.action或者是http://localhost:8080/testWeb/my/regist,而不是你所访问的http://localhost:8080/testWeb/my/regist.jsp
[/Quote]你的方法我也试过的,如果是按照你的方法来做的话,就会出现以下异常
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
dao.UserDAOImpl.exist(UserDAOImpl.java:14)
service.UserServiceImpl2.exist(UserServiceImpl2.java:20)
action.Regist.execute(Regist.java:37)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:613)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:270)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.8 logs.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.8
回复
caixuanbin 2011-10-06
[Quote=引用 14 楼 gmemai 的回复:]
引用 8 楼 caixuanbin 的回复:

引用 5 楼 niuniu20008 的回复:
http://localhost:8080/testWeb
404吗?
是的,肯定会出现404的啊XML code
<struts>
<constant name="struts.devMode" value="true"/>
<package name="Regist11" exten……
[/Quote]我的默认是跳转到regist.jsp的
回复
gmemai 2011-10-06
[Quote=引用 8 楼 caixuanbin 的回复:]

引用 5 楼 niuniu20008 的回复:
http://localhost:8080/testWeb
404吗?
是的,肯定会出现404的啊XML code
<struts>
<constant name="struts.devMode" value="true"/>
<package name="Regist11" extends="struts-default"……
[/Quote]
应该是没有index.jsp这个文件
回复
gmemai 2011-10-06

${user.msg}
<s:form action="regist" method="post">
用户名:<s:textfield name="user.username" size="20"/><br/>
密码:<s:password name="user.userpassword" size="20"/><br/>
<s:submit value="注册"/>
</s:form>

你这里的action的namespace没有写明my这个my这个namespaces
回复
gmemai 2011-10-06
首先想说的是访问action的格式是:http://localhost:8080/testWeb/my/regist.action或者是http://localhost:8080/testWeb/my/regist,而不是你所访问的http://localhost:8080/testWeb/my/regist.jsp
回复
caixuanbin 2011-10-06
问题已经解决了,是缺少一个spring-struts2包,还有就是把struts配置文件里面的namspace=“/my”改为namespace=“/”,不过还是有点不理解,为什么不能用namespace="/my",一旦用namespace它就报异常,说在namespace=“/my”下面没有相对应的action映射,不知道怎么回事,下面是异常,也就是但我namespace="/my"就出现的,但改成namespace="/"问题就解决了不知道是什么原因,大家帮小弟看一下是怎么回事啊。
08:39:23,353  WARN Dispatcher:60 - Could not find action or result
There is no Action mapped for namespace / and action name my. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1684)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:717)
回复
caixuanbin 2011-10-05
[Quote=引用 2 楼 jq_ii_qc 的回复:]
异常贴下啊
[/Quote]没有异常,就是访问不到而已,我贴出来给大家看看
HTTP Status 404 - 

--------------------------------------------------------------------------------

type Status report

message

description The requested resource () is not available.


--------------------------------------------------------------------------------

Apache Tomcat/7.0.8
回复
caixuanbin 2011-10-05
[Quote=引用 1 楼 wby13579 的回复:]
http://localhost:8080/testWeb/my/regist.jsp


[/Quote]有问题吗,我项目的名称是testWeb啊,我访问我的regist.jsp页面,但是老是说找不到啊
回复
异常贴下啊
回复
wby13579 2011-10-05
http://localhost:8080/testWeb/my/regist.jsp


回复
ylovep 2011-10-05
楼主的目录结构是什么 贴图看看
回复
caixuanbin 2011-10-05
已启动tomcat就出现下面的异常是怎么回事呢
15:41:00,177 ERROR Dispatcher:38 - Dispatcher initialization failed
Unable to load configuration. - action - file:/C:/Program%20Files/ApacheSoftwareFoundation/Tomcat7.0/webapps/testWeb/WEB-INF/classes/struts.xml:32:42
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4461)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5133)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5128)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:717)
Caused by: Action class [Regist] not found - action - file:/C:/Program%20Files/ApacheSoftwareFoundation/Tomcat7.0/webapps/testWeb/WEB-INF/classes/struts.xml:32:42
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:420)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 16 more
2011-10-5 15:41:00 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Unable to load configuration. - action - file:/C:/Program%20Files/ApacheSoftwareFoundation/Tomcat7.0/webapps/testWeb/WEB-INF/classes/struts.xml:32:42
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4461)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5133)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5128)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:717)
Caused by: Unable to load configuration. - action - file:/C:/Program%20Files/ApacheSoftwareFoundation/Tomcat7.0/webapps/testWeb/WEB-INF/classes/struts.xml:32:42
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
... 14 more
Caused by: Action class [Regist] not found - action - file:/C:/Program%20Files/ApacheSoftwareFoundation/Tomcat7.0/webapps/testWeb/WEB-INF/classes/struts.xml:32:42
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:420)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:479)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
... 16 more
2011-10-5 15:41:00 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
2011-10-5 15:41:00 org.apache.catalina.core.StandardContext startInternal
严重: Context [/testWeb] startup failed due to previous errors
2011-10-5 15:41:00 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2011-10-5 15:41:00 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/testWeb] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2011-10-5 15:41:00 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/testWeb] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
2011-10-5 15:41:00 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["http-apr-8080"]
2011-10-5 15:41:00 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
2011-10-5 15:41:00 org.apache.catalina.startup.Catalina start
信息: Server startup in 24042 ms
回复
caixuanbin 2011-10-05
[Quote=引用 5 楼 niuniu20008 的回复:]
http://localhost:8080/testWeb
404吗?
[/Quote]是的,肯定会出现404的啊
<struts>
<constant name="struts.devMode" value="true"/>
<package name="Regist11" extends="struts-default" namespace="/my">
<action name="regist" class="Regist">
<result name="success">/regist.jsp</result>

</action>
</package>
</struts>


回复
caixuanbin 2011-10-05
[Quote=引用 6 楼 yexiongmybh 的回复:]
你的URL里面这个my是什么意思,,还有,你项目名称是testWeb,而你的发布名称是不是这个呢,,如果你没有改的话,那就是和项目名称一样。。

你可以在web.xml里面直接设置这个register.jsp为默认的页面也可以的啊。


话说,你访问http://localhost:8080/testWeb会出现404吗?
[/Quote]是会出现404的,那个my是命名空间的意思啊
<struts>
<constant name="struts.devMode" value="true"/>
<package name="Regist11" extends="struts-default" namespace="/my">
<action name="regist" class="Regist">
<result name="success">/regist.jsp</result>

</action>
</package>
</struts>


回复
yexiongMYBH 2011-10-05
你的URL里面这个my是什么意思,,还有,你项目名称是testWeb,而你的发布名称是不是这个呢,,如果你没有改的话,那就是和项目名称一样。。

你可以在web.xml里面直接设置这个register.jsp为默认的页面也可以的啊。


话说,你访问http://localhost:8080/testWeb会出现404吗?
回复
niuniu20008 2011-10-05
http://localhost:8080/testWeb
404吗?
回复
相关推荐
发帖
Java EE
创建于2007-09-28

6.7w+

社区成员

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
申请成为版主
帖子事件
创建了帖子
2011-10-05 10:45
社区公告
暂无公告