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
1 answer

Create Custom HTTP Authenticator for Tomcat 9

I need to integrate IBM Security Access Manger with Tomcat 9 to authenticate users. I have a properly configured Webseal (junction) for the IBM SAM part. It takes the user's credentials, authenticates again the SAM server, and then if successful…
1
vote
1 answer

How do I Spring enable a Tomcat valve

I wrote a Tomcat valve and configured it in server.xml. So far so good. However, I want one of the valve's data members to be a Spring managed bean. So, how can I make the valve also be Spring managed so that I can have Spring's IoC inject that…
user585037
  • 21
  • 2
1
vote
2 answers

Wrap requests in Tomcat custom valve to allow reading the request body

I was asked to develop a Tomcat valve that logs all HTTP requests including their body. As the stream containing the body can only be read once, I found out I needed to wrap the request. I found a JBOSS-based example here (download link "Maven…
Bernhard Koenig
  • 1,342
  • 13
  • 23
1
vote
0 answers

How to exclude jars from maven dependency when packaging?

I'm trying to package a jboss AS7.5 module (RedHat EAP 6.4) that includes a valve. That valve requires a binding to the AuthenticatorBase that comes with the tomcat-catalina-x.y.z.jar, which does not (to my knowledge) come as a downloadable module…
Robin Coe
  • 750
  • 7
  • 28
1
vote
1 answer

Tomcat valve rewrite not working

I want to direct any link other than a static resource (e.g. js, images, etc.) to my index.html. I have made the following changes. I added a context.xml in app.war/META-INF directory that contains:
Dan
  • 115
  • 1
  • 10
1
vote
0 answers

Tomcat Realm is called after Valve

i need your help. I developed a custom valve for tomcat which intercepts specific user requests for specific URIs (a kind of authorization), but it should only invoked after my JDBCRealm. I tried a lot so far to configure this behaviour in my…
Syy0n
  • 21
  • 3
1
vote
1 answer

Can you set Tomcat’s access log directory dynamically?

I am trying to know if it’s possible to have a per-month access log directory in Tomcat 7. After having read the access log Valve documentation it doesn’t seem like it. Ideally, it would be something similar to this:
Alf
  • 1,414
  • 1
  • 15
  • 27
1
vote
2 answers

Why is my tomcat valve not being invoked?

I try to implement a Tomcat valve (currently using 7.0.55) that should intercept every request that reaches the Tomcat serivce, regardless of Connector and whatnot, regardless of wether there's a Host with matching name or a servlet context or…
chammp
  • 822
  • 1
  • 10
  • 20
1
vote
2 answers

How to acces to a global JNDI resource outside of Context container in Apache Tomcat 7.x?

I am developing a custom Valve for Apache Tomcat 7, the valve is defined at Host container level in the Apache Tomcat server.xml configuration file.
vzamanillo
  • 9,905
  • 1
  • 36
  • 56
1
vote
0 answers

Set rotating threhsold on AccessLogValve

Can we set up size based log rotation on AccessLogValve rather day/time based ? Additional question : I am looking for some thing like max back up index flag in RollingFileAppender of log4j. Should we monitor externally to delete the access_log*…
1
vote
2 answers

Extends ValveBase class : java.lang.ClassNotFoundException

I have created one web base application in java and i used the ValveBase class of java. The code is as below : public class RenewSessionValve extends ValveBase { private String authenticationUrl = "j_security_check"; @Override public…
Keval Trivedi
  • 45
  • 1
  • 1
  • 11
1
vote
2 answers

Can't make Custom Valve to work Tomcat7

I'm trying to create a Valve to gather some information of every server req. I'm following this example: http://goo.gl/9wwylq I followed these steps: Create a Maven Java Application. Add the tomcat-catalina dependency Create your Java class and…
pepepapa82
  • 167
  • 2
  • 10
1
vote
1 answer

Valve configuration not working in tomcat?

I access my application with url i.e https://myIPAddress:8443/myWebApp/ I have created the myWebApp.xml file which contains below context element and placed it under \conf\Catalina\localhost\
user3198603
  • 5,528
  • 13
  • 65
  • 125
1
vote
1 answer

Tomcat: Custom form authenicator in a web application, not as a stand-alone JAR module. Possible?

Our web application requires custom form authentication with specific logic inside. The current form authenticator implementation requires the authenticator module, let's call it custom.auth.jar, to be present in %CATALINA_HOME%/lib before the web…
Lyubomyr Shaydariv
  • 20,327
  • 12
  • 64
  • 105
1
vote
1 answer

Customized access log (Apache Tomcat 7.0.8) remains zero kb

I'm trying to create a shorten/customized version of AccessLog (naming it Stats_log) to log out few items (HTTP code, response time, request type) from the request. So i've copied my full AccessLogValve and edited it to match my needs. after…
Royi
  • 11
  • 2