照着别的ssh写的一个程序,别人的能出来,本人的404错误

J2EE 码拜 8年前 (2016-03-18) 1209次浏览
积分没有了,大家帮帮忙
applicationContext.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!– 指定Spring配置文件的Schema信息 –>
<beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:aop=”http://www.springframework.org/schema/aop”
xmlns:tx=”http://www.springframework.org/schema/tx”
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd”>
<!– 定义数据源Bean,使用C3P0数据源实现 –>
<bean id=”dataSource” class=”com.mchange.v2.c3p0.ComboPooledDataSource”
destroy-method=”close”>
<!– 指定连接数据库的驱动 –>
<property name=”driverClass” value=”com.mysql.jdbc.Driver”/>
<!– 指定连接数据库的URL –>
<property name=”jdbcUrl” value=”jdbc:mysql://localhost/javaee”/>
<!– 指定连接数据库的用户名 –>
<property name=”user” value=”root”/>
<!– 指定连接数据库的密码 –>
<property name=”password” value=”`1234″/>
<!– 指定连接数据库连接池的最大连接数 –>
<property name=”maxPoolSize” value=”40″/>
<!– 指定连接数据库连接池的最小连接数 –>
<property name=”minPoolSize” value=”1″/>
<!– 指定连接数据库连接池的初始化连接数 –>
<property name=”initialPoolSize” value=”1″/>
<!– 指定连接数据库连接池的连接的最大空闲时间 –>
<property name=”maxIdleTime” value=”20″/>
</bean>
<!– 定义Hibernate的SessionFactory –>
<bean id=”sessionFactory”
class=”org.springframework.orm.hibernate3.LocalSessionFactoryBean”>
<!– 依赖注入数据源,注入正是上面定义的dataSource –>
<property name=”dataSource” ref=”dataSource”/>
<!– mappingResouces属性用来列出全部映射文件 –>
<property name=”mappingResources”>
<list>
<!– 以下用来列出Hibernate映射文件 –>
<value>entity/P.hbm.xml</value>
</list>
</property>
<!– 定义Hibernate的SessionFactory的属性 –>
<property name=”hibernateProperties”>
<!– 配置Hibernate属性 –>
<value>
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.hbm2ddl.auto=update
hibernate.show_sql=true
hibernate.format_sql=true;
</value>
</property>
</bean>
<!– 定义DAO Bean–>
<bean id=”perso” class=
“DaoImp.perso”>
<!– 注入持久化操作所需的SessionFactory –>
<property name=”sessionFactory” ref=”sessionFactory”/>
</bean>
<!– 配置一个业务逻辑组件 –>
<bean id=”service” class=
“serviec.impl.implS”>
<!– 注入持久化访问所需的DAO组件 –>
<property name=”perso” ref=”perso”/>
</bean>
<bean id = “Regist” class = “action.RegistAction”>
<property name=”s” ref = “service”></property>
</bean>

</beans>
web.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” version=”2.5″>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<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>
</web-app>
struts .xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!– 指定Struts 2配置文件的DTD信息 –>
<!DOCTYPE struts PUBLIC
“-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN”
“http://struts.apache.org/dtds/struts-2.1.7.dtd”>
<!– Struts 2配置文件的根元素 –>
<struts>
<!– 配置了系列常量 –>
<constant name=”struts.i18n.encoding” value=”GBK”/>
<constant name=”struts.devMode” value=”true”/>
<package name=”xqh” extends=”struts-default”>
<!– 定义处理用户请求的Action,指定该Action的实现类–>
<action name=”registPro”
class=”Regist”>
<!– 为两个逻辑视图配置视图页面 –>
<result name=”error”>/error.jsp</result>
<result name=”success”>/welcome.jsp</result>
</action>
<!– 让用户直接访问该应用时列出全部视图页面 –>
<action name=”*”>
<result>/{1}.jsp</result>
</action>
</package>
</struts>
照着别的ssh写的一个程序,别人的能出来,本人的404错误

解决方案

10

把错误日志贴出来啊,上面这么多代码怎么看。

10

404错误就是url路径问题,你看看是不是大小写的关系。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明照着别的ssh写的一个程序,别人的能出来,本人的404错误
喜欢 (0)
[1034331897@qq.com]
分享 (0)