I temporarily disabled SiteMesh completely for other reasons today. It did not change the OpenSessionInViewFilter behavior. I am currently out of ideas, but I'll post my config files - maybe you can see what is wrong.
web.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"
>
<web-app>
<display-name>Ausbildungsplatzboerse</display-name>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter>
<filter-name>hibernate</filter-name>
<filter-class>org.springframework.orm.hibernate.support.OpenSessionInViewFilter</filter-class>
<!--init-param>
<param-name>singleSession</param-name>
<param-value>false</param-value>
</init-param-->
</filter>
<!--filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/abp/action/*</url-pattern>
</filter-mapping-->
<filter-mapping>
<filter-name>hibernate</filter-name>
<url-pattern>/abp/action/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>abploader</servlet-name>
<servlet-class>myproject.web.servlet.LoaderServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/abp/action/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/lib/struts-bean-el.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/lib/struts-html-el.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/core</taglib-uri>
<taglib-location>/WEB-INF/lib/c-1_0.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/display</taglib-uri>
<taglib-location>/WEB-INF/lib/displaytag-el-12.tld</taglib-location>
</taglib>
</web-app>
struts-config.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<!-- ======================================== Form Bean Definitions -->
<form-beans>
<form-bean name="jobOfferForm"
type="myproject.struts.form.JobOfferForm"/>
</form-beans>
<!-- =================================== Global Forward Definitions -->
<global-forwards>
<forward name="corpaccessdenied" path="/WEB-INF/pages/welcome.jsp"/>
</global-forwards>
<!-- =================================== Action Mapping Definitions -->
<action-mappings>
<action path="/welcome"
forward="/WEB-INF/pages/welcome.jsp" />
<action path="/corpOverview"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/WEB-INF/pages/corp/overview.jsp"/>
</action>
<action path="/createOffer"
name="jobOfferForm"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/WEB-INF/pages/corp/createoffer.jsp"/>
</action>
<action path="/submitOffer"
name="jobOfferForm"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/WEB-INF/pages/corp/editoffer.jsp"/>
</action>
<action path="/saveOffer"
type="org.springframework.web.struts.DelegatingActionProxy">
</action>
<action path="/requestActivation"
type="org.springframework.web.struts.DelegatingActionProxy">
</action>
</action-mappings>
<!-- ================================ Message Resources Definitions -->
<message-resources parameter="application"/>
<message-resources parameter="job" key="jobResources"/>
<message-resources parameter="region" key="regionResources"/>
<message-resources parameter="jobcategory" key="jobcatResources"/>
<!-- ======================================= Plug Ins Configuration -->
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml, /WEB-INF/action-servlet.xml"/>
</plug-in>
</struts-config>
applicationContext.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
<!--property name="url"><value>jdbc:hsqldb:db/abp</value></property-->
<property name="url"><value>jdbc:hsqldb:mem:abp</value></property>
<property name="username"><value>sa</value></property>
<property name="password"><value></value></property>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<list>
<value>de/rpf/customer/ihk/abpboerse/core/CorporateUser.hbm.xml</value>
<value>de/rpf/customer/ihk/abpboerse/core/TraineeUser.hbm.xml</value>
<value>de/rpf/customer/ihk/abpboerse/core/JobOffer.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
</bean>
<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
<bean id="txProxyTemplate" lazy-init="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
>
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="loadOrCreate">PROPAGATION_REQUIRED</prop>
<prop key="load*">PROPAGATION_SUPPORTS,readOnly,+Throwable</prop>
<prop key="get*">PROPAGATION_SUPPORTS,readOnly</prop>
<prop key="find*">PROPAGATION_SUPPORTS,readOnly</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="create*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<!-- Add DAOs here -->
<bean id="corpUserDAO" parent="txProxyTemplate">
<property name="target">
<bean class="myproject.dao.hibernate.CorpUserDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
</property>
</bean>
<bean id="traineeUserDAO" parent="txProxyTemplate">
<property name="target">
<bean class="myproject.dao.hibernate.TraineeUserDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
</property>
</bean>
<bean id="jobDAO" parent="txProxyTemplate">
<property name="target">
<bean class="myproject.dao.hibernate.JobDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
</property>
</bean>
<!-- Add Managers here -->
<bean id="authUtils" class="myproject.web.util.AuthorizationUtils">
<property name="corpUserDAO"><ref bean="corpUserDAO"/></property>
</bean>
</beans>
action-servlet.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean name="corpActionTemplate"
class="myproject.struts.action.CorpAction"
lazy-init="true">
<property name="authUtils">
<ref bean="authUtils"/>
</property>
<property name="authUtils">
<ref bean="authUtils"/>
</property>
</bean>
<bean name="/corpOverview"
class="myproject.struts.action.CorpOverviewAction"
parent="corpActionTemplate">
<property name="corpUserDAO">
<ref bean="corpUserDAO"/>
</property>
</bean>
<bean name="/createOffer"
class="myproject.struts.action.CreateOfferAction"
parent="corpActionTemplate">
</bean>
<bean name="/submitOffer"
class="myproject.struts.action.SubmitOfferAction"
parent="corpActionTemplate">
</bean>
</beans>
If there is anything else I can do to explain or find a solution, please tell me - I'm out of ideas right now (though that might be because it's the middle of Friday night already ;-) )
Thanks!
Carl-Eric