aspose file tools*
The moose likes Tomcat and the fly likes about Valve in the context file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "about Valve in the context file" Watch "about Valve in the context file" New topic
Author

about Valve in the context file

david hu
Ranch Hand

Joined: Jul 20, 2001
Posts: 143
I am thinking to use Valve element inside the context file of admin application of tomcat, i.e., admin.xml to filter traffic, i.e., only boxes from inside the company can access this admin application.

Inside the admin.xml file which is under the conf/Catalina/localhost, I am trying to put Valve element to filter machine that makes the request to the admin application, I only allows request from inside my company to access this application.

But my question is that how to specify this in the valve element. I read the doc of tomcat, it only specifies the IP address or host names in the valve element. Since the IP address and host names inside my company can be vastly differnt,I cannot think a good way to use regular expression to achieve that.

Any better ideas?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by david hu:

Any better ideas?


Yes, valves are Tomcat specific.
The concept was created before the servlet spec introduced filters.
The two are conceptually the same.

It makes more sense for app developers to write spec compliant (and thus portable) filters instead of container specific valves.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: about Valve in the context file