Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Redirecting request to servlet if a certain url is accessed

 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running an IPlanet web server. I need to have a request redirected to a servlet that would verify user permissions to acess certain folders under my web server. I cannot set permissions individually on all directories because there may be new directories created dynamically. The directories names follow certain rules so I have a way of verifying user permissions based on a given directory name.
Basically what I need is:
If I get a request that looks like /report/GRoup1_Report1/mydate.txt
redirected to a SecurityServlet. The security servlet should know the original request so it can figure out user permissions.

Any ideas ?
Thanks.
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can map a certain extension to a servlet in your web.xml file
like this:
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>SecurityServlet</servlet-name>
<url-pattern>*.txt</url-pattern>
</servlet-mapping>
Julia

[This message has been edited by Julia Reynolds (edited June 13, 2001).]
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not very familiar with how I would web.xml file. Could you please explain ?
Thanks
 
Julia Reynolds
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an explanation from the iplanet online documentation:
Web Application Structure
--------------------------------------------------------------------------------
Web Applications have a directory structure, all accessible from a mapping to the application's document root (for example, /catalog). The document root contains JSP files, HTML files, and static files such as image files.
A special directory under the document root, WEB-INF, contains everything related to the application that is not in the public document tree of the application. No file contained in WEB-INF can be served directly to the client. The contents of WEB-INF include:

/WEB-INF/web.xml, an XML-based deployment descriptor that specifies the web application configuration, including mappings, initialization parameters, and security constraints.
/WEB-INF/classes/*, the directory for the servlet and utility classes.
/WEB-INF/lib/*.jar, the directory for the JAR files containing servlets, beans, and other utility classes.
Julia
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic