日期:2014-05-17 浏览次数:20976 次
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<!--下述语句是将struts2交给spring管理 -->
<constant name="struts.objectFactory" value="spring" />
<package name="ssh" extends="struts-default">
<!--
例如与用户登录相关的LoginAction,配置如下,其中,class值与applicationContext.xml文件中该action的id值相对应,name值作为标识
-->
<action name="loginAction" class="LoginAction">
<!--result元素设置页面跳转值,其中name值为目标页面的字符串标识,,成功时,转向success.jsp页面-->
<result name="success">/index.jsp</result>
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- 配置LoginAction.java类文件 -->
<bean id="LoginAction" class="com.action.LoginAction" scope="prototype">
</bean>
</beans>
情報: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
2014/02/04 15:44:31 org.apache.catalina.core.ApplicationContext log
情報: Set web app root system property: 'webapp.root' = [D:\apache-tomcat-6.0.20\apache-tomcat-6.0.20\webapps\mySSH\]
2014/02/04 15:44:31 org.apache.catalina.core.ApplicationContext log
情報: Initializing log4j from [D:\apache-tomcat-6.0.20\apache-tomcat-6.0.20\webapps\mySSH\WEB-INF\log4j.properties]
2014/02/04 15:44:42 org.apache.catalina.core.StandardContext filterStart
致命的: フィルタ struts2 の起動中の例外です
Unable to load configuration. - http://struts.apache.org/dtds/struts-2.3.dtd:1:2
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
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.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java