Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirecting request to servlet if a certain url is accessed

 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • 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.
 
Julia Reynolds
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic