ssh web.xml beans.xml applicationContext.xml struts.xml
2011-11-26 22:27
447 查看
<!-- ==================================================web.xml===========================================================================================--> <?xml version="1.0" encoding="utf-8"?> <web-app 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" version="2.4"> <!-- <servlet> <servlet-name>do_login</servlet-name> <servlet-class>com.diqye.system.DoLogin</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>do_login</servlet-name> <url-pattern>/do_login</url-pattern> </servlet-mapping> <filter> <filter-name>qx</filter-name> <filter-class>com.diqye.filter.QuanXian</filter-class> </filter> <filter-mapping> <filter-name>qx</filter-name> <url-pattern>/guan_li/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>qx</filter-name> <url-pattern>/chaoshi_guanli.jsp</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- spring --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> <!-- default: WEB-INF/applicationContext.xml --> classpath:beans.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app>
beans.xml
<?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:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="mySessionFactory"></property> </bean> <bean id="userDao" class="com.diqye.dao.imp.UserDaoImp"> <property name="hibernateTemplate" ref="hibernateTemplate"></property> </bean> <bean id="userService" class="com.diqye.service.imp.UserMangerImp"> <property name="ud" ref="userDao"></property> </bean> <bean id="userAction" class="com.diqye.action.UserAction" scope="prototype"> <property name="um" ref="userService"></property> </bean> --> <!-- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:jdbc.properties</value> </property> </bean> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="annotatedClasses"> <list> <value>com.diqye.entity.User</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> </props> </property> </bean> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <tx:method name="save" propagation="REQUIRED"/> <tx:method name="existByName" propagation="REQUIRED"/> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="fooServiceOperation" expression="execution(* com.diqye.service..*(..))"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="fooServiceOperation"/> </aop:config> </beans> -->
strust.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="struts" extends="struts-default"> <action name="/" class="bean"> <result name="success">upload.jsp</result> <result name="fail">fail.jsp</result> </action> </package> </struts>
相关文章推荐
- ssh整合!Struts.xml、hibernate与spring整合的applicationContext.xml、web.xml文件的配置!
- 【引用】ssh配置文件(web.xml,struts.xml,applicationContext.xml,persistence.xml,log4j.properties)
- ssh整合源码一:配置Spring之applicationContext.xml和web.xml
- SSH中 applicationcontext.xml与web.xml的配置
- SSH中action、applicationContext.xml和struts.xml中各种对应
- SSH整合配置applicationContext.xml/hibernate.cfg.xml/struts.xml
- SSH三大框架整合问题--Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- SpringMVC的三个XML(web.xml、application-context.xml、context-dispatcher.xml)
- javaWeb服务详解【客户端调用】(含源代码,测试通过,注释) ——applicationContext.xml
- 关于Spring MVC的详细步骤(包括web.xml;applicationContext.xml;dispatcher-servlet.xml)
- 配置文件:persistence.xml-----beans.xml----jdbc.properties----log4j.properties---oscache----paoding---struts.config---web.xml
- java.lang.NoSuchMethodError: org.springframework.web.context.support.XmlWebApplication的错误
- 小读spring ioc源码(三)——XmlWebApplicationContext初始化的整体过程
- ssh项目applicationContext.xml出错
- 【Spring整合Struts2】Could not open ServletContext resource [/WEB-INF/application.xml]错误解决
- 异常: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContex
- 求助:Parse error in application web.xml file at jndi:/localhost/ssh/WEB-INF/web.xml
- SSH - 基础篇 - applicationContext.xml
- SSH-Could not open ServletContext resource [/WEB-INF/action-servlet.xml]