Okay...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Okay...

sent2null@netzero.net
I've been trying to add my own custom handling mechanism to prevent direct linking to static resources. I created my own inheritor of the AbstractHttpHandler interface but noticed that the HttpRequest and HttpResponse objects passed to the "handle" method ARE NOT related to the standard javax HttpServletRequest/Response classes. Two questions:

1) Why?

2) If the classes simply provided access to the request session (like the servlet versions do) my life determining authorization of resources would be so much easier, is there a plan to make these classes conform with the sun versions of the HttpRequest/Response classes? If so, when will this be done?

3) Is there any way at all to get access to the session objects associated with incoming servlet requests handled by the Jetty server? I looked throughout the API, if it is there I missed it.


Regards,

David


______________________________________________________________________
Revolutionize the way you surf the Web!
Try NetZero HiSpeed 3G.
Visit http://www.netzero.com to sign up today!



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Okay...

Niclas Hedhman-3
On Wednesday 05 October 2005 09:28, [hidden email] wrote:
> Two questions:

The world consist of three types of people; Those who can count, and those who
can't.

> 1) Why?

Besides any historical reasons, the HttpHandler mechanism in Jetty is loved by
many (myself incl), and is more related to the internals of Apache httpd than
the servlet spec.

> 2) If the classes simply provided access to the request session (like the
> servlet versions do) my life determining authorization of resources would
> be so much easier, is there a plan to make these classes conform with the
> sun versions of the HttpRequest/Response classes?

No.

> If so, when will this be done?

Never, since HttpHandler is orthogonal to the servlet spec.

> 3) Is there any way at all to get access to the session objects associated
> with incoming servlet requests handled by the Jetty server?

There are several ways to get your beloved Servlet into Jetty.
ServletHttpContext and WebApplicationContext are two straight forward ones.


Cheers
Niclas


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Okay...

Greg Wilkins-5
In reply to this post by sent2null@netzero.net
[hidden email] wrote:
> I've been trying to add my own custom handling mechanism to prevent direct linking to static resources. I created my own inheritor of the AbstractHttpHandler interface but noticed that the HttpRequest and HttpResponse objects passed to the "handle" method ARE NOT related to the standard javax HttpServletRequest/Response classes. Two questions:
>
> 1) Why?

History.  Jetty predates Servlets by several years!!!!

They are also different styles of APIs with the Handlers being more powerful than servlets.

But you can do most things in Filters and Servlets now, so if you want the session etc. then
I suggest not using handlers and using Filters.

> 2) If the classes simply provided access to the request session (like the servlet versions do) my life determining authorization of resources would be so much easier, is there a plan to make these classes conform with the sun versions of the HttpRequest/Response classes? If so, when will this be done?

Jetty 6 has merged the two.  There are only standard request/response objects in Jetty 6.

> 3) Is there any way at all to get access to the session objects associated with incoming servlet requests handled by the Jetty server? I looked throughout the API, if it is there I missed it.

It depends on the context....  while the requests are within the servlet handler, you can ask
for the wrapping object.   But this is more pain than it is really worth.

Use Jetty 6 or just use standard filters.

cheers


>
> Regards,
>
> David
>
>
> ______________________________________________________________________
> Revolutionize the way you surf the Web!
> Try NetZero HiSpeed 3G.
> Visit http://www.netzero.com to sign up today!
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Okay...

Greg Wilkins-5
In reply to this post by Niclas Hedhman-3
Niclas Hedhman wrote:

>>If so, when will this be done?
>
>
> Never, since HttpHandler is orthogonal to the servlet spec.

Handlers continue to exist in Jetty6 - but they work on Servlet requests and
responses (but with extra access!).

cheers


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Okay...

Niclas Hedhman-3
On Friday 21 October 2005 17:18, Greg Wilkins wrote:
> > Never, since HttpHandler is orthogonal to the servlet spec.
>
> Handlers continue to exist in Jetty6 - but they work on Servlet requests
> and responses (but with extra access!).

Does that means all my HttpHandlers need modifications, or have you managed to
maintain source compatibility somehow? (I confess I have not (yet) looked
whether that is at all possible.)


Cheers
Niclas


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Okay...

Greg Wilkins-5
Niclas Hedhman wrote:

> On Friday 21 October 2005 17:18, Greg Wilkins wrote:
>
>>>Never, since HttpHandler is orthogonal to the servlet spec.
>>
>>Handlers continue to exist in Jetty6 - but they work on Servlet requests
>>and responses (but with extra access!).
>
>
> Does that means all my HttpHandlers need modifications, or have you managed to
> maintain source compatibility somehow? (I confess I have not (yet) looked
> whether that is at all possible.)

It is a MAJOR rearchitecture and the port will require a moderate amount of effort.

If you have Jetty 4 or 5 code, then consider the move to Jetty 6 as the opportunity to
refactor and revisit almost everything :-)

For this reason Jetty 5 will continue to be developed and supported for some time.

regards




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Okay...

Niclas Hedhman
On Sunday 23 October 2005 17:30, Greg Wilkins wrote:
> If you have Jetty 4 or 5 code, then consider the move to Jetty 6 as the
> opportunity to refactor and revisit almost everything

What a lovely way to describe incompatibility :o)

But I am Ok with that. So 6 will also see NIO excel, and your alternate
proposal for how the servlet spec should have been ;o) ??

Keep up the good work.


Cheers
Niclas


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss