• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

about Valve in the context file

Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!