You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by CrackheadMillionaire <cr...@yahoo.com> on 2006/06/01 01:33:06 UTC
implementing javax.servlet.Filter w/Struts
Hello friends -
I recently implemented a filter to push some information into the session. Great. However, after filter processing and within my DispatchAction, if I make a call to request.getSession().getAttribute("whateverName"); the values aren't there; in fact, the session attached to my incoming request is null.
Digging around in the debugger I can find my objects, but it's buried pretty deep within a layer of of nested ApplicationHttpRequest objects; I don't even appear to have the ability to get to it. If I put things into the session from within my DispatchAction, no problems it's always there.
Also, can anyone explain why my filter is bypassed if the mapping is for *.jsp, but gets hit for *.do?
Any advice is greatly appreciated.
- brian
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Re: implementing javax.servlet.Filter w/Struts
Posted by CrackheadMillionaire <cr...@yahoo.com>.
Hello all -
This was a pebkac style error. I have solved the problem. Thank you for the rapid replies.
Take care.
brian
"Frank W. Zammetti" <fz...@omnytex.com> wrote:
On the second point, can you list your web.xml, the portion where you
map the filter at least? Chances are you have it mapped incorrectly.
On the first point, can we see your filter? There's no inherent reason
you can't do what your trying to do with a filter and Struts, so there
is some detail wrong somewhere, but what you posted here is most likely
not sufficient to answer. Seeing your code, and the associated
configuration, will probably help.
Frank
CrackheadMillionaire wrote:
> Hello friends -
>
> I recently implemented a filter to push some information into the session. Great. However, after filter processing and within my DispatchAction, if I make a call to request.getSession().getAttribute("whateverName"); the values aren't there; in fact, the session attached to my incoming request is null.
>
> Digging around in the debugger I can find my objects, but it's buried pretty deep within a layer of of nested ApplicationHttpRequest objects; I don't even appear to have the ability to get to it. If I put things into the session from within my DispatchAction, no problems it's always there.
>
> Also, can anyone explain why my filter is bypassed if the mapping is for *.jsp, but gets hit for *.do?
>
> Any advice is greatly appreciated.
>
> - brian
>
>
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
Re: implementing javax.servlet.Filter w/Struts
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
On the second point, can you list your web.xml, the portion where you
map the filter at least? Chances are you have it mapped incorrectly.
On the first point, can we see your filter? There's no inherent reason
you can't do what your trying to do with a filter and Struts, so there
is some detail wrong somewhere, but what you posted here is most likely
not sufficient to answer. Seeing your code, and the associated
configuration, will probably help.
Frank
CrackheadMillionaire wrote:
> Hello friends -
>
> I recently implemented a filter to push some information into the session. Great. However, after filter processing and within my DispatchAction, if I make a call to request.getSession().getAttribute("whateverName"); the values aren't there; in fact, the session attached to my incoming request is null.
>
> Digging around in the debugger I can find my objects, but it's buried pretty deep within a layer of of nested ApplicationHttpRequest objects; I don't even appear to have the ability to get to it. If I put things into the session from within my DispatchAction, no problems it's always there.
>
> Also, can anyone explain why my filter is bypassed if the mapping is for *.jsp, but gets hit for *.do?
>
> Any advice is greatly appreciated.
>
> - brian
>
>
> ---------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: implementing javax.servlet.Filter w/Struts
Posted by Wendy Smoak <ws...@gmail.com>.
On 5/31/06, CrackheadMillionaire <cr...@yahoo.com> wrote:
> I recently implemented a filter to push some information into the session. Great. However, after filter processing and within my DispatchAction, if I make a call to request.getSession().getAttribute("whateverName"); the values aren't there; in fact, the session attached to my incoming request is null.
That would seem to indicate that your Filter isn't being executed, or
isn't doing what you think it's doing. Without more information, like
sample code, your Filter mapping, etc., it's hard to tell.
I have this code in a Filter, with no problems, and the object is
always there when I retrieve it later in an Action:
request.getSession().setAttribute( Constants.USER_KEY, webUser );
> Also, can anyone explain why my filter is bypassed if the mapping is for *.jsp, but gets hit for *.do?
Probably because the original request was for someAction.do, and then
you're _forwarding_ to the JSP on the server side. The Servlet 2.4
spec introduced some new options for filter mapping. What version are
you using (or what version of what container)?
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how many active sessions are in the system
Posted by Martin Gainty <mg...@hotmail.com>.
Hey Carl-
if you contextObject.getManager().getActiveSessions()
you should be able to get the count of Active Sessions..
Anyone else
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Carl Smith" <cc...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, June 14, 2006 4:35 PM
Subject: how many active sessions are in the system
> Is there anyway in J2EE to get how many active sessions are in the system? Thanks in advance.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
how many active sessions are in the system
Posted by Carl Smith <cc...@yahoo.com>.
Is there anyway in J2EE to get how many active sessions are in the system? Thanks in advance.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: implementing javax.servlet.Filter w/Struts
Posted by Konstantin Priblouda <kp...@yahoo.com>.
--- CrackheadMillionaire
<cr...@yahoo.com> wrote:
> Also, can anyone explain why my filter is bypassed
> if the mapping is for *.jsp, but gets hit for *.do?
>
> Any advice is greatly appreciated.
I think that nobody would say you why this happens,
unless you post relevant code from your web.xml
regards,
----[ Konstantin Pribluda http://www.pribluda.de ]----------------
Still using XDoclet 1.x? XDoclet 2 is released and of production quality.
check it out: http://xdoclet.codehaus.org
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org