Re: Access static content ...

2003-11-07 Thread Jack Lauman
I'm using JBoss with Tomcat 4.1.27.  I manipulate the URL by adding
param-values that are parts of the actual URL to the web.xml file
I think this will work with a stand alone Tomcat.  It looks like
'commons-sandbox' project 'chains' is similar.

i.e.


  
baseURL
www.nwcascades.com
  
...

We include keywords, dropdown selects (as CDATA), almost anything
that is static from one page to the next.  Make maintenance a great
deal easier.

In the JSP pages we use things similar to the following to separate
the static content on apache and the dynamic content generated by
JBoss/Tomcat.

/">
<%=application.getInitParameter("titleText")%>
...

We found that the time it takes to do this is well worth it if you
have a global change that affects a large number of pages.

Hope it helps,

Jack
Rodrigo Ruiz wrote:
> 
> The problem is the "/resources" entry. If you map it to the default
> servlet, the directory name itself will not be part of the path, but a
> "root" for the actual one, so the default servlet will understand you
> want to get the path following "resources", and it is "". I guess the
> same will happen with the contents of the directory.
> 
> It seems that the default servlet cannot be configured to serve files
> from an alternative directory.
> 
> You could try one of the following:
>   - Create your own servlet for "resources" requests. Perhaps you could
> subclass DefaultServlet, or use it in any other way.
>   - Implement a Filter that redirects any request not to "resources" to
> your own servlet, and let the default configuration to work for the
> resources directory.
> 
> Samuel Le Berrigaud wrote:
> 
> > Thanks for your help,
> >
> > I'll do it another way I think and I'll probably come back on that
> > problem later on.
> >
> > SaM
> >
> > Tim Funk wrote:
> >
> >> Then there is either
> >> - a bug in tomcat
> >> - a config error (most likely) but don't know what could be the culprit
> >>
> >> I never heard of this before. Seems quite odd.
> >>
> >> -Tim
> >>
> >> Samuel Le Berrigaud wrote:
> >>
> >>> Yes
> >>>
> >>> Tim Funk wrote:
> >>>
>  [Need more coffee]
> 
>  Does that mean that http://myserver/context/resources is serving a
>  dir listing of the contents from http://myserver/context ?
>  (instead of /context/resources)
> 
>  -Tim
> >>>
> >>>
> >>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: Access static content ...

2003-11-07 Thread Rodrigo Ruiz
The problem is the "/resources" entry. If you map it to the default 
servlet, the directory name itself will not be part of the path, but a 
"root" for the actual one, so the default servlet will understand you 
want to get the path following "resources", and it is "". I guess the 
same will happen with the contents of the directory.

It seems that the default servlet cannot be configured to serve files 
from an alternative directory.

You could try one of the following:
 - Create your own servlet for "resources" requests. Perhaps you could 
subclass DefaultServlet, or use it in any other way.
 - Implement a Filter that redirects any request not to "resources" to 
your own servlet, and let the default configuration to work for the 
resources directory.



Samuel Le Berrigaud wrote:

Thanks for your help,

I'll do it another way I think and I'll probably come back on that 
problem later on.

SaM

Tim Funk wrote:

Then there is either
- a bug in tomcat
- a config error (most likely) but don't know what could be the culprit
I never heard of this before. Seems quite odd.

-Tim

Samuel Le Berrigaud wrote:

Yes

Tim Funk wrote:

[Need more coffee]

Does that mean that http://myserver/context/resources is serving a 
dir listing of the contents from http://myserver/context ?
(instead of /context/resources)

-Tim




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


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



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


Re: Access static content ...

2003-11-07 Thread Samuel Le Berrigaud
Thanks for your help,

I'll do it another way I think and I'll probably come back on that 
problem later on.

SaM

Tim Funk wrote:

Then there is either
- a bug in tomcat
- a config error (most likely) but don't know what could be the culprit
I never heard of this before. Seems quite odd.

-Tim

Samuel Le Berrigaud wrote:

Yes

Tim Funk wrote:

[Need more coffee]

Does that mean that http://myserver/context/resources is serving a 
dir listing of the contents from http://myserver/context ?
(instead of /context/resources)

-Tim



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


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


Re: Access static content ...

2003-11-07 Thread Tim Funk
Then there is either
- a bug in tomcat
- a config error (most likely) but don't know what could be the culprit
I never heard of this before. Seems quite odd.

-Tim

Samuel Le Berrigaud wrote:

Yes

Tim Funk wrote:

[Need more coffee]

Does that mean that http://myserver/context/resources is serving a dir 
listing of the contents from http://myserver/context ?
(instead of /context/resources)

-Tim


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


Re: Access static content ...

2003-11-07 Thread Samuel Le Berrigaud
Yes

Tim Funk wrote:

[Need more coffee]

Does that mean that http://myserver/context/resources is serving a dir 
listing of the contents from http://myserver/context ?
(instead of /context/resources)

-Tim

Samuel Le Berrigaud wrote:

Of course it is a directory but tomcat lists / which contains the 
resources directory (in fact to list / I would only check 
http://myserver/context)

SaM

Tim Funk wrote:

If http://myserver/context/resources is a directory, then that is 
the correct behavior on how things work.

-Tim

Samuel Le Berrigaud wrote:

Hi,

I cannot change the code of my servlet since I use the Turbine 
framework. So I tried your second solution which doesn't work 
anymore. When I now want to access 
http://myserver/context/resources, I have the "directory listing 
for /" page ...

Maybe anyone have an idea of what's hapening, or maybe should I 
give up my idea ?!

Thanks,

SaM

Tim Funk wrote:

Or you might be able to get away with this to in web.xml ...

  /resources
  default


  /resources/*
  default

-Tim

Tim Funk wrote:

No, but this *might* work. Place it in your servlet which maps to 
/* ...
(assuming your extending javax.servlet.http.HttpServlet)

doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content

getServletContext().getNamedDispatcher("default").forward(req, 
resp);
return;
  }

  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:

Hi all,

I want to map my servlet with /* url pattern except the 
/resources directory which contains static content that I want 
to acces directly. Is there any particular configuration that 
could allow me to do so, in my web.xml file or in the server.xml 
config file ?

I want to do that on a Tomcat 4.1



- 

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



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


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



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


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



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


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


Re: Access static content ...

2003-11-07 Thread Tim Funk
[Need more coffee]

Does that mean that http://myserver/context/resources is serving a dir 
listing of the contents from http://myserver/context ?
(instead of /context/resources)

-Tim

Samuel Le Berrigaud wrote:

Of course it is a directory but tomcat lists / which contains the 
resources directory (in fact to list / I would only check 
http://myserver/context)

SaM

Tim Funk wrote:

If http://myserver/context/resources is a directory, then that is the 
correct behavior on how things work.

-Tim

Samuel Le Berrigaud wrote:

Hi,

I cannot change the code of my servlet since I use the Turbine 
framework. So I tried your second solution which doesn't work 
anymore. When I now want to access http://myserver/context/resources, 
I have the "directory listing for /" page ...

Maybe anyone have an idea of what's hapening, or maybe should I give 
up my idea ?!

Thanks,

SaM

Tim Funk wrote:

Or you might be able to get away with this to in web.xml ...

  /resources
  default


  /resources/*
  default

-Tim

Tim Funk wrote:

No, but this *might* work. Place it in your servlet which maps to 
/* ...
(assuming your extending javax.servlet.http.HttpServlet)

doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content
getServletContext().getNamedDispatcher("default").forward(req, 
resp);
return;
  }

  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:

Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces 
directly. Is there any particular configuration that could allow 
me to do so, in my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1



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



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


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



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


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



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


Re: Access static content ...

2003-11-07 Thread Samuel Le Berrigaud
Of course it is a directory but tomcat lists / which contains the 
resources directory (in fact to list / I would only check 
http://myserver/context)

SaM

Tim Funk wrote:

If http://myserver/context/resources is a directory, then that is the 
correct behavior on how things work.

-Tim

Samuel Le Berrigaud wrote:

Hi,

I cannot change the code of my servlet since I use the Turbine 
framework. So I tried your second solution which doesn't work 
anymore. When I now want to access http://myserver/context/resources, 
I have the "directory listing for /" page ...

Maybe anyone have an idea of what's hapening, or maybe should I give 
up my idea ?!

Thanks,

SaM

Tim Funk wrote:

Or you might be able to get away with this to in web.xml ...

  /resources
  default


  /resources/*
  default

-Tim

Tim Funk wrote:

No, but this *might* work. Place it in your servlet which maps to 
/* ...
(assuming your extending javax.servlet.http.HttpServlet)

doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content
getServletContext().getNamedDispatcher("default").forward(req, 
resp);
return;
  }

  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:

Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces 
directly. Is there any particular configuration that could allow 
me to do so, in my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1



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



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


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



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


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


Re: Access static content ...

2003-11-07 Thread Tim Funk
If http://myserver/context/resources is a directory, then that is the correct 
behavior on how things work.

-Tim

Samuel Le Berrigaud wrote:

Hi,

I cannot change the code of my servlet since I use the Turbine 
framework. So I tried your second solution which doesn't work anymore. 
When I now want to access http://myserver/context/resources, I have the 
"directory listing for /" page ...

Maybe anyone have an idea of what's hapening, or maybe should I give up 
my idea ?!

Thanks,

SaM

Tim Funk wrote:

Or you might be able to get away with this to in web.xml ...

  /resources
  default


  /resources/*
  default

-Tim

Tim Funk wrote:

No, but this *might* work. Place it in your servlet which maps to /* ...
(assuming your extending javax.servlet.http.HttpServlet)
doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content
getServletContext().getNamedDispatcher("default").forward(req, 
resp);
return;
  }

  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:

Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces 
directly. Is there any particular configuration that could allow me 
to do so, in my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1



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



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


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



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


Re: Access static content ...

2003-11-07 Thread Samuel Le Berrigaud
Hi,

I cannot change the code of my servlet since I use the Turbine 
framework. So I tried your second solution which doesn't work anymore. 
When I now want to access http://myserver/context/resources, I have the 
"directory listing for /" page ...

Maybe anyone have an idea of what's hapening, or maybe should I give up 
my idea ?!

Thanks,

SaM

Tim Funk wrote:

Or you might be able to get away with this to in web.xml ...

  /resources
  default


  /resources/*
  default

-Tim

Tim Funk wrote:

No, but this *might* work. Place it in your servlet which maps to /* ...
(assuming your extending javax.servlet.http.HttpServlet)
doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content
getServletContext().getNamedDispatcher("default").forward(req, 
resp);
return;
  }

  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:

Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces 
directly. Is there any particular configuration that could allow me 
to do so, in my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1



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



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


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


Re: Access static content ...

2003-11-07 Thread Tim Funk
Or you might be able to get away with this to in web.xml ...

  /resources
  default


  /resources/*
  default

-Tim

Tim Funk wrote:

No, but this *might* work. Place it in your servlet which maps to /* ...
(assuming your extending javax.servlet.http.HttpServlet)
doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content
getServletContext().getNamedDispatcher("default").forward(req, resp);
return;
  }
  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:

Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces directly. 
Is there any particular configuration that could allow me to do so, in 
my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1



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



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


Re: Access static content ...

2003-11-07 Thread Tim Funk
No, but this *might* work. Place it in your servlet which maps to /* ...
(assuming your extending javax.servlet.http.HttpServlet)
doGet(HttpServletRequest req, HttpServletResponse resp) {
  if (req.getRequestURI().indexOf("/resources")>-1) {
//Use the default servlet to serve the static content
getServletContext().getNamedDispatcher("default").forward(req, resp);
return;
  }
  //Normal logic
}
-Tim

Samuel Le Berrigaud wrote:
Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces directly. 
Is there any particular configuration that could allow me to do so, in 
my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1



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


Access static content ...

2003-11-07 Thread Samuel Le Berrigaud
Hi all,

I want to map my servlet with /* url pattern except the /resources 
directory which contains static content that I want to acces directly. 
Is there any particular configuration that could allow me to do so, in 
my web.xml file or in the server.xml config file ?

I want to do that on a Tomcat 4.1

Thanks,

SaM

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


Servlets can't access static content.

2002-01-06 Thread Andre Fonseca


Happy new year all!

I am trying to connect Tomcat 4.0.1 with Apache 1.3 using Warp connector. I
can successfully pass servlets through to tomcat, but they can't access the
style sheets, images and pages served by apache.

Am I missing any configuration in tomcat ?

I would like to run:
http://machinename.com/servlets/login

Here are my con files


Server.xml 





httpd.conf -
WebAppConnection conn  warp  monster:8008
WebAppDeploy test.com   conn  /



test.com/WEB-INF/Web.xml ---

login
login


login
/servlets/login



Any help is much appreciated!

Thanks in advance.

Andre


--
To unsubscribe:   
For additional commands: 
Troubles with the list: