• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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.
 
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic