Hi,

>First of this is not a Tomcat question.  This type of information is
>always available at http://java.sun.com or http://forum.java.sun.com/

Right, but we do encourage general servlet and JSP related discussions
here too.

>> So from what I know so far my
>> /usr/local/tomcat/webapps/myapplication/WEB-INF/web.xml should look
>> like the
>> following:
>>
>> <web-app>
>>   <filter>
>>     <filter-name>UrlFilter</filter-name>
>>     <filter-class>UrlFilter</filter-class> *Don't know how this
should
>> layout.*
>>   </filter>
>>
>>   <filter-mapping>
>>     <filter-name>UrlFilter</filter-name>
>>     <url-pattern>/*</url-pattern>
>>   </filter-mapping>

That's fine.  I'd suggest you put your UrlFilter in a package, e.g.
com.yourclasses.UrlFilter, and change the filter-class accordingly.

>> Do I then create
>>
/usr/local/tomcat/webapps/myapplication/WEB-INF/classes/URLFilter.java?

Sure.  For general help on the source and deployment organization of a
webapp, see
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html.

>>      private boolean allow(String uri) {
>>      // Look up allowed urls in a DB, Collection, whatever
>>
>>        SubstringTest = False;
>>     SubstringTest = string.indexOf("GET / HTTP/1.1") > 0;

Make sure you understand what a request URI is for the HTTP protocol.
It will have neither the GET (method name) nor the protocol spec
(HTTP/1.1 above).  Read and understand the JavaDocs for the
HttpServletRequest interface completely.

Yoav Shapira




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to