aspose file tools*
The moose likes Servlets and the fly likes Problem to filter requests to App name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem to filter requests to App name" Watch "Problem to filter requests to App name" New topic
Author

Problem to filter requests to App name

Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Hi All,

I want to configure the filter for any resource that is requested in the app.


but this doesn't seem to work. It doesn't even go to the filter.

Thanks

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
I think this thread belongs to the Servlet forum.

all urls accessed through http://localhost:8080/webProjectName/FORMS/...

should invoke the filter.
Note that the url-pattern is case sensitive.


JDBCSupport - An easy to use, light-weight JDBC framework -
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
FORMS is the web project name.
So the urls will be http;//localhost:8080/FORMS/somepage.jsp

But it is not going to the filter.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Ok that is where the problem is.

The url-pattern takes the context-root, which is the root of your web-application.

Omit the FORMS in your url-pattern and you are all set.
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
If I give the context-root it wont work?

What should I do if I have to prevent the access to any resource inside the app.

Thank you for the reply.
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
if your web-application has the name FORMS, so the directory structure is /tomcat/webapps/FORMS

then the filter mapping of

<url-pattern>/secured/*</url-pattern>

will shoot all requests targeting http://localhost:8080/FORMS/secured/something through the filter.

A filter mapping of '/*' applies to your whole web app.
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
Thank you !
 
 
subject: Problem to filter requests to App name
 
Similar Threads
Running an applet in Wicket 1.3.5
Writing Russian characters to XML file
moved from jboss-4.0.3 to jboss-5.1.0 where do I put my war files
Filter not triggerring for applications outside webapps