别人的项目struts2+spring3.1+hibernate3,开始是说loginAction找不到名为success的result,但是在struts.xml中有login的action配置,也有result,于是把这个action配置删了,竟然还能调用到原来的LoginAction类,最后把struts.xml都删了,还能调到这个LoginAction类!!!
已经把Eclipse重启、Tomcat下webapps和work里的项目清空、重新发布、重新启动Tomcat、清空IE缓存做了N次了,还不行,为啥?有什么默认的login配置么?
已经把Eclipse重启、Tomcat下webapps和work里的项目清空、重新发布、重新启动Tomcat、清空IE缓存做了N次了,还不行,为啥?有什么默认的login配置么?
解决方案 »
- The requested resource (/JSPExample/registerServlet) is not available
- 关于服务器调优监测工具
- 请高手指导
- 通过一个多月的学习,把struts2学了一部分。
- 请问各位高手,如何将j2ee加入Myeclipse
- 恶心了一下午,关于compass
- 50分求解jsf简单问题
- 大家来救急:hibernate程序在TOMCAT中能运行,在WEBLOGIC中却不行?
- 窗体JFrame的更新----各位仁兄帮忙 ---> 进入
- 输入http://127.0.0.1弹出这个弹窗
- 请教大虾:JSF web 应用 上写Junit
- 跪求tc4ntiis.zip现在csdn上面的都是死链。在线等!
web.xml是万物之源!!!
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>sessionClose</filter-name>
<filter-class>com.lntu.filters.SessionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sessionClose</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sessionClose</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<!-- session关闭过滤器 --> <!-- 配置log4j -->
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>personmanager.root</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- 配置log4j结束 --> <!-- 配置jfreechart -->
<servlet>
<servlet-name>DisplayChart</servlet-name>
<servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DisplayChart</servlet-name>
<url-pattern>/servlet/DisplayChart</url-pattern>
</servlet-mapping>
<!-- 配置jfreechart 结束 --> <!-- 配置spring -->
<!-- 如果不指定contextConfigLocation, 则默认从/EWB-INF/下查找applicationContext.xml文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:applicationContext*.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置spring结束 --> <!-- 配置dwr -->
<!-- 需要配置文件dwr-servlet.xml,其中dwr和servlet-name相同 -->
<!-- <servlet> <servlet-name>dwr</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern> </servlet-mapping> -->
<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
<!-- 使用org.directwebremoting.spring.DwrSpringServlet,不需要原来的dwr-servlet.xml配置文件 -->
<!-- 使用org.directwebremoting.spring.DwrSpringServlet,下面四行必须有,否则会报错Access
to debug pages is denied. -->
<!-- dwr的配置信息直接放applicationContext.xml中 -->
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<!-- 配置dwr结束 -->
<!-- 定义编码过滤器 -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 定义编码过滤器结束 -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:applicationContext*.xml
</param-value>
</context-param>
很明显,下一个查找对象是这个..
<?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"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache-3.1.xsd"> <!-- 使用Spring的Annotation -->
<context:annotation-config />
<context:component-scan base-package="com.lntu.admin">
</context:component-scan> <dwr:configuration />
<dwr:annotation-config />
<dwr:url-mapping />
<dwr:annotation-scan scanRemoteProxy="true"
base-package="com.*" /> <!-- 部署项目时, 请把debug设为false -->
<dwr:controller id="dwrController" debug="true" /> <cache:annotation-driven cache-manager="cacheManager" /> <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
<property name="caches">
<set>
<bean
class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean"
p:name="default" />
<bean
class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean"
p:name="andCache" />
</set>
</property>
</bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="net.sourceforge.jtds.jdbc.Driver" />
<property name="jdbcUrl"
value="jdbc:jtds:sqlserver://localhost:1433/PersonSystem" />
<property name="user" value="sa" />
<property name="password" value="tft7600" />
<property name="maxPoolSize" value="40" />
<property name="minPoolSize" value="1" />
<property name="initialPoolSize" value="1" />
<property name="maxIdleTime" value="20" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="mappingResources">
<list>
…… </list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
</bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"
abstract="false" lazy-init="default" autowire="default">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="genericDAOImpl" class="com.lntu.admin.dao.impl.HibernateGenericDAOImpl"
abstract="false" lazy-init="default" autowire="default">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate" />
</property>
</bean></beans>零配置也得有配置啊,annotation?aop?都得有线索啊?
<context:annotation-config />
<context:component-scan base-package="com.lntu.admin">
</context:component-scan>
注解啊,这个有点汗啊,包就是这个com.lntu.admin,去相应包下看看吧,估计就在那个类的头上标着呢.....