Re: Context specific context.xml not loading.

2018-12-20 Thread Melvin
ThankYou Mark.

Regards,
Melvin A


On Thu, Dec 20, 2018 at 2:51 PM Mark Thomas  wrote:

> On 20/12/2018 06:44, Melvin wrote:
> > Hello All,
> >
> > Just came across a problem today. Hope someone will clarify it.
> >
> > Tomcat 9.0.13.
> > I wanted to customize ErrorReportValve by setting showReport="false"
> > showServerInfo="false".
> >
> > Below is the META-INF/context.xml -
> > 
> >  > showReport="false" showServerInfo="false" />
> > 
> >
> > It works fine for any internal server error produced or exceptions
> > thrown. But for the case when the browser sends unencoded characters the
> > URL becomes invalid and Exception is thrown and stacktrace is shown in
> > the browser.
> > When I give this valve in server.xml. It works fine. No issues. No
> > stacktrace is shown on the browser when sending unencoded characters.
> > When I give it in my context it fails only for this case.
> >
> > Can anyone please help me on this.
>
> You are configuring the Valve on different elements. In server.xml you
> are configuring it on the Host. In context.xml you are configuring it
> for a single web application.
>
> If the URL is invalid then the request will never be mapped to a web
> application so the ErrorReportVlave on the default Host will be used.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Context specific context.xml not loading.

2018-12-20 Thread Mark Thomas
On 20/12/2018 06:44, Melvin wrote:
> Hello All,
> 
> Just came across a problem today. Hope someone will clarify it.
> 
> Tomcat 9.0.13.
> I wanted to customize ErrorReportValve by setting showReport="false"
> showServerInfo="false".
> 
> Below is the META-INF/context.xml - 
> 
>  showReport="false" showServerInfo="false" />
> 
> 
> It works fine for any internal server error produced or exceptions
> thrown. But for the case when the browser sends unencoded characters the
> URL becomes invalid and Exception is thrown and stacktrace is shown in
> the browser. 
> When I give this valve in server.xml. It works fine. No issues. No
> stacktrace is shown on the browser when sending unencoded characters.
> When I give it in my context it fails only for this case.
> 
> Can anyone please help me on this.

You are configuring the Valve on different elements. In server.xml you
are configuring it on the Host. In context.xml you are configuring it
for a single web application.

If the URL is invalid then the request will never be mapped to a web
application so the ErrorReportVlave on the default Host will be used.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context specific context.xml not loading.

2018-12-20 Thread Melvin
Ryan Palmer,

CATALINA_BASE/conf/Catalina/localhost/ directory is empty. Also, I haven't
given any context in server.xml either.

Regards,
Melvin A


On Thu, Dec 20, 2018 at 1:53 PM Ryan Palmer  wrote:

> Melvin,
>
> Do you have any context.xml for this context in the
> CATALINA_BASE/conf/Catalina/localhost/ directory? It may be overriding your
> META-INF/context.xml
>
> -Ryan
> On Dec 19, 2018, at 10:45 PM, Melvin  melvind...@gmail.com>> wrote:
> Hello All,
>
> Just came across a problem today. Hope someone will clarify it.
>
> Tomcat 9.0.13.
> I wanted to customize ErrorReportValve by setting showReport="false"
> showServerInfo="false".
>
> Below is the META-INF/context.xml -
> 
>  showReport="false" showServerInfo="false" />
> 
>
> It works fine for any internal server error produced or exceptions thrown.
> But for the case when the browser sends unencoded characters the URL
> becomes invalid and Exception is thrown and stacktrace is shown in the
> browser.
> When I give this valve in server.xml. It works fine. No issues. No
> stacktrace is shown on the browser when sending unencoded characters. When
> I give it in my context it fails only for this case.
>
> Can anyone please help me on this.
> Thanks in advance for your help.
> Regards,
> Melvin A
>


Re: Context specific context.xml not loading.

2018-12-20 Thread Ryan Palmer
Melvin,

Do you have any context.xml for this context in the 
CATALINA_BASE/conf/Catalina/localhost/ directory? It may be overriding your 
META-INF/context.xml

-Ryan
On Dec 19, 2018, at 10:45 PM, Melvin 
mailto:melvind...@gmail.com>> wrote:
Hello All,

Just came across a problem today. Hope someone will clarify it.

Tomcat 9.0.13.
I wanted to customize ErrorReportValve by setting showReport="false" 
showServerInfo="false".

Below is the META-INF/context.xml -




It works fine for any internal server error produced or exceptions thrown. But 
for the case when the browser sends unencoded characters the URL becomes 
invalid and Exception is thrown and stacktrace is shown in the browser.
When I give this valve in server.xml. It works fine. No issues. No stacktrace 
is shown on the browser when sending unencoded characters. When I give it in my 
context it fails only for this case.

Can anyone please help me on this.
Thanks in advance for your help.
Regards,
Melvin A


Context specific context.xml not loading.

2018-12-19 Thread Melvin
Hello All,

Just came across a problem today. Hope someone will clarify it.

Tomcat 9.0.13.
I wanted to customize ErrorReportValve by setting showReport="false"
showServerInfo="false".

Below is the META-INF/context.xml -




It works fine for any internal server error produced or exceptions thrown.
But for the case when the browser sends unencoded characters the URL
becomes invalid and Exception is thrown and stacktrace is shown in the
browser.
When I give this valve in server.xml. It works fine. No issues. No
stacktrace is shown on the browser when sending unencoded characters. When
I give it in my context it fails only for this case.

Can anyone please help me on this.
Thanks in advance for your help.
Regards,
Melvin A

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org