You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Grobe, Gary" <Ga...@bmc.com> on 2002/01/18 00:12:28 UTC

web.xml config

How do I get ...
http://localhost/{mycontext} to point to Filter (default filter) 
and ... http://localhost/{myContext}/f2 to point to Filter2?

I've been having problems calling Filter2. I want both filters to operate on
the same file ... so if i just type in http://localhost/myContext , then
index.html file gets Filter, same for Filter2 if I append f1 to that. The
response stream that both filters operate on must come from the same files
(i.e. index.html, etc...).

   <filter>
      <filter-name>Filter2</filter-name>
      <display-name>Filter2</display-name>
      <filter-class>control.filter.Filter2</filter-class>
   </filter>

   <filter>
      <filter-name>Filter</filter-name>
      <display-name>Filter</display-name>
      <filter-class>control.filter.Filter</filter-class>
   </filter>

   <filter-mapping>
      <filter-name>Filter2</filter-name>
      <url-pattern>/f2*</url-pattern>
   </filter-mapping>

   <filter-mapping>
      <filter-name>Filter</filter-name>
      <url-pattern>/f1*</url-pattern>
   </filter-mapping>

Any help much appreciated.

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Can a url have a space in it?

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> When using tomcat 3.2.4, is it invalid to create a folder called "/my
> folder"?  It looks like tomcat turns the url into "my%folder", which I
> thought should work, but it can't find any files in this directory.  Is this
> correct, is there something I can do to allow tomcat to find files in a
> directory with a space in it?

/my%20folder/

Nix.

RE: Can a url have a space in it?

Posted by Brian Adams <bi...@satx.rr.com>.
dude, I am with ya now!
okay, I tried on my server just now and it work!
I made a directory named "a b" inside my $TOMCAT4/webapps/test/  folder and
put in it a index.jsp page.
Ten I tried "localhost:8080/test/a b/index.jsp" and it worked...
so then I said hmmmm wonder if it works through Apache so I did
"localhost/test/a b/index.jsp"  (notice port 80 now) and it also worked...
I wonder what is wrong with yours...
:(


I did this on a dev box: win2000, tomcat 4.0.1ish and apache 1.3
B

-----Original Message-----
From: Brandon Cruz [mailto:bcruz@norvax.com]
Sent: Thursday, January 17, 2002 6:17 PM
To: Tomcat Users List
Subject: RE: Can a url have a space in it?


Thanks for responding Brian,

Users are creating folders with spaces in them, not in the parameters, so
the url is like this...

http://localhost/my folder/index.html

tomcat (or the browser) is successfully turning the url into

http://localhost/my%20folder/index.html

When you click on that url though, you get a 404 error.

-----Original Message-----
From: Brian Adams [mailto:bigb@satx.rr.com]
Sent: Thursday, January 17, 2002 6:08 PM
To: Tomcat Users List
Subject: RE: Can a url have a space in it?


if it is in your URL then it should %20  that represents a space in a string
so
if uRL was http:/localhost/servlet/test?file=my%20documents
then when your do :
String paramV = request.getParameter("file");
out.println("File Path is: " + paramV);


this should make paramV = "my documents"

is this what your looking for?
B
Anyone correct me if I am wrong please.


-----Original Message-----
From: Brandon Cruz [mailto:bcruz@norvax.com]
Sent: Thursday, January 17, 2002 5:31 PM
To: Tomcat Users List
Subject: Can a url have a space in it?


When using tomcat 3.2.4, is it invalid to create a folder called "/my
folder"?  It looks like tomcat turns the url into "my%folder", which I
thought should work, but it can't find any files in this directory.  Is this
correct, is there something I can do to allow tomcat to find files in a
directory with a space in it?

Brandon


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Can a url have a space in it?

Posted by Brandon Cruz <bc...@norvax.com>.
Thanks for responding Brian,

Users are creating folders with spaces in them, not in the parameters, so
the url is like this...

http://localhost/my folder/index.html

tomcat (or the browser) is successfully turning the url into

http://localhost/my%20folder/index.html

When you click on that url though, you get a 404 error.

-----Original Message-----
From: Brian Adams [mailto:bigb@satx.rr.com]
Sent: Thursday, January 17, 2002 6:08 PM
To: Tomcat Users List
Subject: RE: Can a url have a space in it?


if it is in your URL then it should %20  that represents a space in a string
so
if uRL was http:/localhost/servlet/test?file=my%20documents
then when your do :
String paramV = request.getParameter("file");
out.println("File Path is: " + paramV);


this should make paramV = "my documents"

is this what your looking for?
B
Anyone correct me if I am wrong please.


-----Original Message-----
From: Brandon Cruz [mailto:bcruz@norvax.com]
Sent: Thursday, January 17, 2002 5:31 PM
To: Tomcat Users List
Subject: Can a url have a space in it?


When using tomcat 3.2.4, is it invalid to create a folder called "/my
folder"?  It looks like tomcat turns the url into "my%folder", which I
thought should work, but it can't find any files in this directory.  Is this
correct, is there something I can do to allow tomcat to find files in a
directory with a space in it?

Brandon


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Can a url have a space in it?

Posted by Brian Adams <bi...@satx.rr.com>.
if it is in your URL then it should %20  that represents a space in a string
so
if uRL was http:/localhost/servlet/test?file=my%20documents
then when your do :
String paramV = request.getParameter("file");
out.println("File Path is: " + paramV);


this should make paramV = "my documents"

is this what your looking for?
B
Anyone correct me if I am wrong please.


-----Original Message-----
From: Brandon Cruz [mailto:bcruz@norvax.com]
Sent: Thursday, January 17, 2002 5:31 PM
To: Tomcat Users List
Subject: Can a url have a space in it?


When using tomcat 3.2.4, is it invalid to create a folder called "/my
folder"?  It looks like tomcat turns the url into "my%folder", which I
thought should work, but it can't find any files in this directory.  Is this
correct, is there something I can do to allow tomcat to find files in a
directory with a space in it?

Brandon


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Can a url have a space in it?

Posted by Brandon Cruz <bc...@norvax.com>.
When using tomcat 3.2.4, is it invalid to create a folder called "/my
folder"?  It looks like tomcat turns the url into "my%folder", which I
thought should work, but it can't find any files in this directory.  Is this
correct, is there something I can do to allow tomcat to find files in a
directory with a space in it?

Brandon


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: web.xml config

Posted by "Craig R. McClanahan" <cr...@apache.org>.
The URL patterns in your filter mappings are not valid patterns.  Try
"/*" for the first filter "/f2/*" for the second filter.  Then, your URLs
would be processed like this:

http://localhost:8080/{mycontext}/index.html --> filtered by "Filter"
http://localhost:8080/{mycontext}/f2/index.html --> filtered by
  "Filter2" and then "Filter"

Craig


On Thu, 17 Jan 2002, Grobe, Gary wrote:

> Date: Thu, 17 Jan 2002 17:12:28 -0600
> From: "Grobe, Gary" <Ga...@bmc.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org>
> Subject: web.xml <filter> config
>
>
> How do I get ...
> http://localhost/{mycontext} to point to Filter (default filter)
> and ... http://localhost/{myContext}/f2 to point to Filter2?
>
> I've been having problems calling Filter2. I want both filters to operate on
> the same file ... so if i just type in http://localhost/myContext , then
> index.html file gets Filter, same for Filter2 if I append f1 to that. The
> response stream that both filters operate on must come from the same files
> (i.e. index.html, etc...).
>
>    <filter>
>       <filter-name>Filter2</filter-name>
>       <display-name>Filter2</display-name>
>       <filter-class>control.filter.Filter2</filter-class>
>    </filter>
>
>    <filter>
>       <filter-name>Filter</filter-name>
>       <display-name>Filter</display-name>
>       <filter-class>control.filter.Filter</filter-class>
>    </filter>
>
>    <filter-mapping>
>       <filter-name>Filter2</filter-name>
>       <url-pattern>/f2*</url-pattern>
>    </filter-mapping>
>
>    <filter-mapping>
>       <filter-name>Filter</filter-name>
>       <url-pattern>/f1*</url-pattern>
>    </filter-mapping>
>
> Any help much appreciated.
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>