Questions tagged [tomcat-valve]

A Valve is a type of component that can be inserted into Tomcat's request/response pipeline in order to add application-specific logic.

A Valve is a type of component that can be inserted into Tomcat's request/response pipeline in order to add application-specific logic in relation to request processing.

There are many kinds of valves dealing with different aspects of the server's operation and functionality, some of which include:

  • Logging
  • Authentication
  • SSL
  • Single Sign On
  • stuck thread detection

For more information, visit the Apache Tomcat documentation

76 questions
1
vote
0 answers

Exclude Manager from Tomcat Single Sign On

Using JAAS for SSO on a Tomcat server sans Apache. The SSO controls access to several related applications and works great. Recently I started migrating to Maven from Ant and in order to use the Tomcat plugin for Maven I needed to setup the Tomcat…
Nick
  • 11
  • 5
1
vote
1 answer

How can my WebApp Retrieve Data Set By a Tomcat Valve?

I'm trying to retrieve a value set by a custom Tomcat Valve in a JSF2 backing bean (or servlet). I can't see how to do this and I can't find any examples using Google. BACKGROUND: In my JSF2 web app, I'm required to add a timezone attribute to each…
Adam
  • 2,616
  • 33
  • 29
0
votes
1 answer

Tomcat Rewrite Valve Problem: rewrite.config has no effect

I'm trying to use the Tomcat 9 rewrite Valve in order to redirect certain URLs to my Angular app, which is inside my spring app (very much like in this answer: https://stackoverflow.com/a/44847035/15773786). As far as I see it I do have 2 approaches…
0
votes
1 answer

Wrap response in Tomcat custom valve to allow reading the response body

i need to log all response from an application using tomcat ValveBase class. For request i already created a wrapper org.apache.catalina.connector.Request and it logs all request. But for response, wrapper for org.apache.catalina.connector.Response…
0
votes
0 answers

How to change the format of %t option in Apache Tomcat Valve Logger when it has the header {begin}

I've got a pattern that uses pattern option "%{begin}t". Is there a way to change the format of this log? To a format like "dd-MMM-yyyy HH.mm.ss.S" instead of the default.
0
votes
1 answer

Setting cargo.tomcat.valve values in a build.gradle file

What I am trying to do: I want to add a AccessLogValve to the tomcat server.xml so that I can log custom header values. (ref: https://jfrog.com/knowledge-base/how-can-i-log-custom-request-headers-using-the-tomcat-access-log-valve/) Problem I am…
JoeyHolloway
  • 458
  • 7
  • 19
0
votes
1 answer

Tomcat access logging through log4j2?

I'm trying to have my own configuration for access logging with log4j2 logging framework in my web application that is using tomcat. While I see there is a Access log valve that can be used for logback, I didn't find any access log valve to override…
Chethan B
  • 1
  • 3
0
votes
1 answer

Get the webapp name in the tomcat valve class

I have my custom tomcat Valve extending FormAuthenticator, and same is defined in context.xml of each webapp. I need to read some property files in 'initInternal' of Valve, based on webapp name. i.e. for each webapp different property file. Since…
Brinal
  • 172
  • 2
  • 18
0
votes
1 answer

How to make TOMCAT accessible only localhost except one app

I'm running TOMCAT server. Due security reasons I have to limit access to localhost only but one app have to be accessible from outside (any IP). I tryed using the valve placed in server.xml but I was only able to block access to specific functions…
maciek
  • 3
  • 2
0
votes
1 answer

Tomcat valve forcing specific Cache-Control headers

I want to set the Cache-Control and ETag headers correctly in my responses. To do that I have disabled request caching through spring security configuration: httpSecurity.headers().cacheControl().disable(); Then when returning the…
Tarmo
  • 1,136
  • 13
  • 28
0
votes
1 answer

Custom SAML Authentication Valve in Spring Boot Embedded Tomcat - Don't Apply to Actuator Endpoints

Old Shared Tomcat Method I have a custom SAML 2.0 authentication valve that I use currently in some standalone tomcat web servers to implement single sign on. To implement this, we add the valve to the tomcat server's context.xml, like this (some…
Andrew Mairose
  • 10,615
  • 12
  • 60
  • 102
0
votes
1 answer

My custom tomcat valve is not being intercepted

Here is the custom valve class that I wrote.. All it does is to mask password before logging to access log files ... package com.test; import org.apache.catalina.valves.AccessLogValve; public class FilteredAccessLogValve extends AccessLogValve { …
0
votes
1 answer

Javascript being loaded twice after enabling rewrite through Tomcat valve

I have a single page application, and I am using the tomcat rewrite valve to forward all the requests other than static resources to my index.html. Following are the contents of my rewrite.config: RewriteCond %{REQUEST_URI}…
Dan
  • 115
  • 1
  • 10
0
votes
2 answers

Web application specific form authenticator under Tomcat 6

With your help I have successfully resolved a question that I have asked here. I have developed a custom Tomcat authenticator for the web application, and currently the authenticator and its configuration file are located in the %CATALINA_HOME%\lib\…
Lyubomyr Shaydariv
  • 20,327
  • 12
  • 64
  • 105
0
votes
0 answers

'javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created' for Tomcat Valve

I have been working on constructing a custom SAML 2.0 based single-sign-on Apache Tomcat valve. During the initialization of this Tomcat valve, at certain server startup runs (does not occur frequently during every server startup) I had been…
Chiranga Alwis
  • 1,049
  • 1
  • 25
  • 47