Re: [jetty-users] Question about ErrorHandler

2021-11-12 Thread Silvio Bierman

Thanks Greg.

The errors are mostly generated from request handler code calling 
response.sendError(xxx). Part of these calls resides in generic library 
classes. We want to be able to generate error pages from our own 
application sites where context, styling and possibly language is defined.


Should that attribute be set? What would be in it? Is that some unique 
identifier for the specific servlet instance?


There is only one single Servlet class in the application and there is 
only one single instance of that class. I could get at it from that end 
but I would prefer to not explicitly depend on that being the case.


But I feel a lot better now you tell me setting the attribute would be 
fine. I was just wondering if there was some standard way of getting at 
the Servlet instance.


Cheers,

Silvio


On 11/12/21 04:59, Greg Wilkins wrote:


It depends a little bit on how the error was generated in the first place?
Is the request attribute "javax.servlet.error.servlet_name" set? if 
so, then you can use that name to lookup the servlet instance directly 
on the servlet handler.


But your request attribute technique is probably fine as well.

regards


___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, 
visithttps://www.eclipse.org/mailman/listinfo/jetty-users
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] Question about ErrorHandler

2021-11-11 Thread Greg Wilkins
It depends a little bit on how the error was generated in the first place?
Is the request attribute "javax.servlet.error.servlet_name" set? if so,
then you can use that name to lookup the servlet instance directly on the
servlet handler.

But your request attribute technique is probably fine as well.

regards
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users