Is this a code bug

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Is this a code bug

Sandip Ghayal
I am trying to integrate Jetty 6.0 RC4 into my product
and during
debugging I found this code under Context.java as

             if (securityHandler!=null)
             {
               
_sessionHandler.setHandler(_securityHandler);
               
_securityHandler.setHandler(_servletHandler);
             }
             else
             {
               
_sessionHandler.setHandler(_servletHandler);
             }

I am new to jetty and don't understand the code
completely but should
not the code be like below?

             if (securityHandler!=null)
             {
               
_securityHandler.setHandler(_securityHandler);
             }                  
_sessionHandler.setHandler(_servletHandler);

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Is this a code bug

Greg Wilkins

Sandip,

this code links together the available handlers.
If there is a securityHandler available the chain is linked

  sessionHandler-->SecurityHandler-->ServletHandler

hence:
  _sessionHandler.setHandler(_securityHandler);                
  _securityHandler.setHandler(_servletHandler);


If there is no securityHandler, the the chain is linked

  sessionHandler-->ServletHandler

hence:
  _sessionHandler.setHandler(_servletHandler);


So the code is correct - but thanks for checking.

cheers


 

Sandip Ghayal wrote:

> I am trying to integrate Jetty 6.0 RC4 into my product
> and during
> debugging I found this code under Context.java as
>
>              if (securityHandler!=null)
>              {
>                
> _sessionHandler.setHandler(_securityHandler);
>                
> _securityHandler.setHandler(_servletHandler);
>              }
>              else
>              {
>                
> _sessionHandler.setHandler(_servletHandler);
>              }
>
> I am new to jetty and don't understand the code
> completely but should
> not the code be like below?
>
>              if (securityHandler!=null)
>              {
>                
> _securityHandler.setHandler(_securityHandler);
>              }                  
> _sessionHandler.setHandler(_servletHandler);
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


--
Greg Wilkins<[hidden email]>  US: +1  3104915462   IT: +39 3349267680
http://www.webtide.com           UK: +44(0)2079932589 AU: +61(0)417786631

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Is this a code bug

Sandip Ghayal
In reply to this post by Sandip Ghayal
Ok that makes sense.

Thanks for your response. I stumble upon this code
when I am actually
trying to find out why after integrating Jetty 6.0 my
application is not
working (It used to work well with Jetty 5.0).

Wondering if you have any pointers as to how to debug
this issue ? I am
looking at the log files and looks like I am doing
everything properly.
I am trying to analyze it from the side of receiving
the requests.

Thanks for you help

Cheers,

Sandip


Greg Wilkins wrote:
> Sandip,
>
> this code links together the available handlers.
> If there is a securityHandler available the chain is
linked
>
>   sessionHandler-->SecurityHandler-->ServletHandler
>
> hence:
>   _sessionHandler.setHandler(_securityHandler);    
           
>   _securityHandler.setHandler(_servletHandler);
>
>
> If there is no securityHandler, the the chain is
linked

>
>   sessionHandler-->ServletHandler
>
> hence:
>   _sessionHandler.setHandler(_servletHandler);
>
>
> So the code is correct - but thanks for checking.
>
> cheers
>
>
>  
>
> Sandip Ghayal wrote:
>
>>I am trying to integrate Jetty 6.0 RC4 into my
product

>>and during
>>debugging I found this code under Context.java as
>>
>>             if (securityHandler!=null)
>>             {
>>                
>>_sessionHandler.setHandler(_securityHandler);
>>                
>>_securityHandler.setHandler(_servletHandler);
>>             }
>>             else
>>             {
>>                
>>_sessionHandler.setHandler(_servletHandler);
>>             }
>>
>>I am new to jetty and don't understand the code
>>completely but should
>>not the code be like below?
>>
>>             if (securityHandler!=null)
>>             {
>>                
>>_securityHandler.setHandler(_securityHandler);
>>             }                  
>>_sessionHandler.setHandler(_servletHandler);
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam
protection around
>>http://mail.yahoo.com 
>>
>>-------------------------------------------------------------------------
>>Using Tomcat but need to do more? Need to support
web services, security?
>>Get stuff done quickly with pre-integrated
technology to make your job easier
>>Download IBM WebSphere Application Server v.1.0.1
based on Apache Geronimo
>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Is this a code bug

Sandip Ghayal
In reply to this post by Sandip Ghayal
I think  I have this fixed.

I started up the context but didn't register the
handler for context
with the server so it was failing. After doing that
registration I am
able to access the web app properly.

Thanks for all your help

Cheers,

Sandip

Sandip Ghayal wrote:
> Ok that makes sense.
>
> Thanks for your response. I stumble upon this code
> when I am actually
> trying to find out why after integrating Jetty 6.0
my
> application is not
> working (It used to work well with Jetty 5.0).
>
> Wondering if you have any pointers as to how to
debug

> this issue ? I am
> looking at the log files and looks like I am doing
> everything properly.
> I am trying to analyze it from the side of receiving
> the requests.
>
> Thanks for you help
>
> Cheers,
>
> Sandip
>
>
> Greg Wilkins wrote:
>
>>Sandip,
>>
>>this code links together the available handlers.
>>If there is a securityHandler available the chain is
>
> linked
>
>>  sessionHandler-->SecurityHandler-->ServletHandler
>>
>>hence:
>>  _sessionHandler.setHandler(_securityHandler);    
>
>            
>
>>  _securityHandler.setHandler(_servletHandler);
>>
>>
>>If there is no securityHandler, the the chain is
>
> linked
>
>>  sessionHandler-->ServletHandler
>>
>>hence:
>>  _sessionHandler.setHandler(_servletHandler);
>>
>>
>>So the code is correct - but thanks for checking.
>>
>>cheers
>>
>>
>>
>>
>>Sandip Ghayal wrote:
>>
>>
>>>I am trying to integrate Jetty 6.0 RC4 into my
>
> product
>
>>>and during
>>>debugging I found this code under Context.java as
>>>
>>>            if (securityHandler!=null)
>>>            {
>>>              
>>>_sessionHandler.setHandler(_securityHandler);
>>>              
>>>_securityHandler.setHandler(_servletHandler);
>>>            }
>>>            else
>>>            {
>>>              
>>>_sessionHandler.setHandler(_servletHandler);
>>>            }
>>>
>>>I am new to jetty and don't understand the code
>>>completely but should
>>>not the code be like below?
>>>
>>>            if (securityHandler!=null)
>>>            {
>>>              
>>>_securityHandler.setHandler(_securityHandler);
>>>            }                  
>>>_sessionHandler.setHandler(_servletHandler);
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam?  Yahoo! Mail has the best spam
>
> protection around
>
>>>http://mail.yahoo.com 
>>>
>>>-------------------------------------------------------------------------
>>>Using Tomcat but need to do more? Need to support
>
> web services, security?
>
>>>Get stuff done quickly with pre-integrated
>
> technology to make your job easier
>
>>>Download IBM WebSphere Application Server v.1.0.1
>
> based on Apache Geronimo
>
>>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>>
>>
>>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
protection around
> http://mail.yahoo.com 
>
>
-------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support
web services, security?
> Get stuff done quickly with pre-integrated
technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1
based on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> jetty-discuss mailing list
> [hidden email]
>
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss