On 23/02/17 01:31, Shing Wai Chan wrote:
> The getters and setters in ServletContext can be as followed:
> public String getRequestCharacterEncoding();
> public void setRequestCharacterEncoding(String encoding);
>
> public String getResponseCharacterEncoding();
> public void setResponseCharacterEncoding(String encoding);
> For getters, we may like to throw UnsupportedOperation if this
> ServletContext was passed to the
> {_at_link ServletContextListener#contextInitialized} method of a
> {_at_link ServletContextListener} that was neither declared in
> <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
> with {_at_link javax.servlet.annotation.WebListener}
>
> For setters, we may like to
> a) throws IllegalStateException if this ServletContext has already been
> initialized
> b) throws UnsupportedOperationException if this ServletContext
> was passed to the {_at_link ServletContextListener#contextInitialized}
> method of a {_at_link ServletContextListener} that was neither declared in
> <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
> with {_at_link javax.servlet.annotation.WebListener}
>
> This will align with other APIs in ServletContext.
>
> Any comments?
>
> Shing Wai Chan
I'm fine with all of that.
Mark