Setting session attribute

I'm trying to set an attribute into the session by using this code (by the way is there any other way of setting an object into session when youre in the front end (jsf page)?)

<% session.setAttribute("keyTest",statisticsController); %>

here is my entry in faces-config.xml

<managed-bean>

<managed-bean-name>statisticsController</managed-bean-name>

<managed-bean-class>myControllers.StatisticsController</managed-bean-class>

<managed-bean-scope>request</managed-bean-scope>

<managed-property>

I'm getting a cannot be resolved problem

Here is the exception:

Generated servlet error:

statisticsController cannot be resolved

at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspSer

vletWrapper.java:510)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper

.java:375)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3

14)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:173)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp

atcher.java:672)

at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica

tionDispatcher.java:463)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD

ispatcher.java:398)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis

patcher.java:301)

at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatc

h(ServletExternalContextImpl.java:415)

ANy suggestions on how I can solve this problem? Thanks.

[2027 byte] By [pauster007a] at [2007-11-27 6:17:19]
# 1
Hi change your managed bean scope in to session insist of request and it will work.Regards.A.
Ananth.duraia at 2007-7-12 17:30:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Why do you want to put a request scoped managed bean in the HttpSession?Do you want to access it from inside another managed bean? There are better ways.
BalusCa at 2007-7-12 17:30:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi BalusC,Nice to see u. But i could n't get your point since how can we get a request scoped bean in session scope..
Ananth.duraia at 2007-7-12 17:30:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Just access it by the RequestMap of the ExternalContext.Here are several ways: http://balusc.xs4all.nl/srv/dev-jep-com.html
BalusCa at 2007-7-12 17:30:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi ,Thank u. I go through it. It's really helpful link..Regards,A.
Ananth.duraia at 2007-7-12 17:30:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...