titiwangsa
Jul 13th, 2007, 10:30 AM
hello to all
is there a way, that my bean
can get the current session id if i put the scope="request" or scope="session"?
i mean without access to the HttpSession or HttpServletRequest objects?
is there something similar to this
class MyBean implements HttpSessionAware
{
private String sessionId;
public void setHttpSession(HttpSession httpSession)
{
sessionId = httpSession.getSessionId();
}
}
and
<bean id="myBean" class="MyBean" request="session">
</bean>
so when the bean is created, i can get the session id?
goal: when the bean is created, i can have the session id.
any way i can accomplish this, or something similar?
is there a way, that my bean
can get the current session id if i put the scope="request" or scope="session"?
i mean without access to the HttpSession or HttpServletRequest objects?
is there something similar to this
class MyBean implements HttpSessionAware
{
private String sessionId;
public void setHttpSession(HttpSession httpSession)
{
sessionId = httpSession.getSessionId();
}
}
and
<bean id="myBean" class="MyBean" request="session">
</bean>
so when the bean is created, i can get the session id?
goal: when the bean is created, i can have the session id.
any way i can accomplish this, or something similar?