I already found the problem. It is about how a request
shall be written in a JSP file: using <c:url
value="myRequest.html">.

Thanks

--- Vernon <[EMAIL PROTECTED]> wrote:

> Hi, all,
> 
> In my application, a session attribute is needed to
> let the application function properly. So, I have a
> filter to verify whether this attribute is set or
> not
> in the session. 
> 
> The doFilter method of the filter is something like
> the following:
> 
>       public void doFilter(ServletRequest request,
> ServletResponse response,
>                       FilterChain chain) throws IOException,
> ServletException {
> 
>               HttpServletRequest hreq = (HttpServletRequest)
> request;
>               logger.debug("Enter: " + hreq.getRequestURL());
>               if (request instanceof HttpServletRequest) {
>                       logger.debug("instanceof");
>                       HttpSession session = hreq.getSession(false);
>                       // Check the session setting
>                       if (session != null) {
>                               logger.debug("session");
>                               if (session.getAttribute("myAttr") != null) {
>                                       logger.debug("Attr set");
>                                       // jump to the resource if it is set
>                                       chain.doFilter(request, response);
>                                       return;
>                               }
>                       }
>               }
>                         
>       // ....
>                       
>
filterConfig.getServletContext().getRequestDispatcher(
>                                               "/" + 
> the_page).forward(request, response);
>                               return;
> 
>       }
> }
> 
> After having an additonal segment of the application
> up, I find the the getSession(false) returns null
> for
> the requests of the first segment of application.
> When
> I click the first segment of the application, I am
> forwarded to the "the_page", while I reach the right
> page on the second segment. There is not any
> architecture difference between these two segments.
> 
> I use the Spring framework by the way. I don't think
> the framework has anything to do with the session
> management.
> 
> What is the cause?
> 
> Thanks very much for all your inputs in advance.
> 
> Vernon
> 
> 
> 
> 
>               
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to