Hi
I integrated spring3 with struts2. Almost everything works great but i can't access to session bean.
In EL Expressions from JSP ${sessionScope} return J2EE class javax.servlet.jsp.el.ImplicitObjectELResolverCode:<bean id="account" class="account.AccountFactory" scope="session"> <aop:scoped-proxy /> </bean>
so i tried everythink:
(test is a method in account bean getTest())
${sessionScope.account.test} return null
${sessionScope['scopedTarget.account'].test} return null
${sessionScope.account} return null
${pageContext.session['account']} or ${pageContext.session['scopedTarget. account']} return "The class 'org.apache.catalina.session.StandardSessionFacade ' does not have the property 'account'."
How to access to scope session bean when spring was integrate with strut2?
web.xml
struts.xmlCode:<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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"> <display-name>test</display-name> <context-param> <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name> <param-value>/WEB-INF/tiles.xml,/WEB-INF/employee-tiles.xml,/WEB-INF/teacher-tiles.xml,/WEB-INF/student-tiles.xml</param-value> </context-param> <session-config> <session-timeout>4</session-timeout> </session-config> <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> <filter> <filter-name>requestContextFilter</filter-name> <filter-class>org.springframework.web.filter.RequestContextFilte r</filter-class> </filter> <filter-mapping> <filter-name>requestContextFilter</filter-name> <servlet-name>/*</servlet-name> <!-- Dispatcher Servlet name --> </filter-mapping> <listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
Please help ...Code:<?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="default" extends="tiles-default" namespace="/"> <action name="news" class="newsAction"> <result name="SUCCESS" type="tiles">module.news</result> </action> </package> </struts>
PS. Sorry for my english...



Reply With Quote
