users@grizzly.java.net

Re: Session management bug / Static resource as stream

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 02 Sep 2008 19:14:22 -0400

Salut,

Loic Petit wrote:
> Yop,
>
>> I was under the impression the code was working :-) :-) So with your
>> patch, you make sure the contextPath and the ServletPath are compared
>> against the original URI. But fullPathURI is computed as:
>>
>>> if (fullUrlPath == null){
>>> fullUrlPath = contextPath + servletPath;
>>> }
>>
>> What is the difference? Sorry that might be a stupid question....
>
> The only difference is : I treat this thing as you do, the only specific
> thing is : I do not throw any error message and I return 404 for the chain.
> (btw the patch is only replacing customizeErrorPage(response, "Resource
> Not Found", 404); by response.setStatus(404))
>

I see :-) I agree it is a limitation. Now one way to solve the issue is
to not call the customizeErrorPage() like you are proposing, but at the
end of the chain make sure an error page as been sent by looking at the
status code and look if the response have been committed. Let me explore
that route.



>> BTW You don't have to call:
>>
>> request.getRequest().action(ActionCode.ACTION_POST_REQUEST, null);
>>
>> as StaticResourceAdapter.postService will do it for you:
>>
>> https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/tcp/StaticResourcesAdapter.html#210
>>
>>
>> Same for res.finish();
>
> Thanks for the advice
>
>>
>> This is a good recommendation. Sorry for asking again, but can you
>> file an RFE? I suspect I can re-use the Jetty one (Apache2 licence). I
>> just need to learn how Greg did it.
>>
>> Keep the recommendations coming!
>
> No problem, I do it right away...
>
> Enjoy !

Thanks again!

-- Jeanfrancois

>
> Loïc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>