You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Schuller <pe...@infidyne.com> on 2000/04/14 20:19:06 UTC

Special handling of "/*" servlet mapping?

Hello again,

I have a servlet mapping that maps /blabla/* to a servlet. This works fine.
/blabla, /blabla/morebla, etc will be mapped to the servlet in question.

However, if I change the mapping to "/*" (leaving everything else exactly as
before) Tomcat seems to ignore the mapping (requesting "<appname>/" will yield a
directory listing, and requesting anything else ("<appname>/<anything>")
yields a 404 File not found).

Is this correct behavior, and if so, how do I create a default mapping? I
want all requests that are not covered by any other explicit mapping, to be
forwarded to one servlet.

Thank you,

-- 
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0x5584BD98 or 'Peter Schuller <pe...@infidyne.com>'
Key retrival: Send an E-Mail to getpgpkey@scode.infidyne.com
E-Mail: peter.schuller@infidyne.com Web: http://scode.infidyne.com


Re: Tomcat and bean serialization?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
gtallen wrote:

> Hi,
> Does the latest Tomcat support bean serialization?  If not,
> are there any plans?
>

I'm not quite sure what you mean by "bean serialization".  Could you describe
it further?

The general philosophy of Tomcat (and the servlet and JSP apis for that
matter) is that any synchronization required by beans to avoid multithread
access problems is the responsibility of the bean itself.  Any general purpose
solution imposed by the servlet container is likely to cause performance
problems for beans that are written to work correctly in a multithreaded
environment already.


> Thanks,
> Greg
>

Craig McClanahan



Re: Tomcat JSPs and bean serialization?

Posted by gtallen <gt...@home.com>.
JSP that is...

gtallen wrote:
> 
> Hi,
> Does the latest Tomcat support bean serialization?  If not,
> are there any plans?
> 
> Thanks,
> Greg
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

Tomcat and bean serialization?

Posted by gtallen <gt...@home.com>.
Hi,
Does the latest Tomcat support bean serialization?  If not,
are there any plans?

Thanks,
Greg

Re: JSP Work Directory

Posted by gtallen <gt...@home.com>.
http://jakarta.apache.org/builds/tomcat/release/v3.1_rc1/bin

Try the latest release candidate, seems others have talked about
this but I don't recall the solution.
Greg

Josh Butikofer wrote:
> 
> I was wondering if you brilliant people out there could help me with a
> little Tomcat problem.
> 
> I am developing JSP webapps (obviously) with Tomcat 3.1 beta. I just
> downloaded it and I have been using Tomcat 3.0 and the JSWDK even before
> Tomcat. Tomcat has been excellent, for the most part, but there are two
> strange things happening:
> 
> 1 - Sometimes when I am changing JSP files, saving them, and then reloading
> the pages in my browser the Tomcat engine will recompile the JSP pages and
> then display the newly compiled stuff, no-problem. However, every once in a
> while an old version or a "ghost" version of old JSP classes will just
> happen to pop up!!! That's right! Code I worked on 3 days ago will come back
> from no where and cause all kinds of strange things to happen until I
> restart Tomcat. This happens in Tomcat 3.0 and 3.1. I do not think it is a
> browser caching problem, however I am not making any final judgements just
> yet. Just wondering if anyone out there has seen some similar behavior.
> 
> 2 - This is the REAL problem. My server.xml in the conf dir has my context
> section looking like this ( and they work fine ):
> 
> <Context path="/" docBase="C:\jswdk-1.0.1\webpages\jerky"
>             defaultSessionTimeOut="30" isWARExpanded="true"
>             isWARValidated="false" isInvokerEnabled="true"
>             isWorkDirPersistent="false">
>  </Context>
>         <Context path="/examples" docBase="examples"
>             defaultSessionTimeOut="30" isWARExpanded="true"
>             isWARValidated="false" isInvokerEnabled="true"
>             isWorkDirPersistent="false">
>  </Context>
>  <Context path="/skeleton" docBase="C:\jswdk-1.0.1\webpages\skeleton"
>             defaultSessionTimeOut="30" isWARExpanded="true"
>             isWARValidated="false" isInvokerEnabled="true"
>             isWorkDirPersistent="false">
>  </Context>
>  <Context path="/jerky" docBase="C:\jswdk-1.0.1\webpages\jerky"
>             defaultSessionTimeOut="30" isWARExpanded="true"
>             isWARValidated="false" isInvokerEnabled="true"
>             isWorkDirPersistent="false">
>   </Context>
> 
> What I need done is for the work directory to be either deleted or for the
> JSP class files to be recreated when
> I restart the Tomcat 3.1 file, regardless if the JSP files have been changed
> from the last compile or not.
> 
> Now I would assume that the isWorkDirPersistent attribute above would make
> all the
> .class and .java files in the work dir to be deleted or at least replaced
> first thing AFTER the server is restarted. I know that JSWDK and Tomcat 3.0
> would do that (after you restarted), but the new Tomcat 3.1 seems to like to
> hold onto those darn .class files and will NOT recompile them after a
> restart. What can I do, if anything, to overcome this feature/problem???? I
> would really appreciate it.
> 
> Josh
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

JSP Work Directory

Posted by Josh Butikofer <jo...@insei.com>.
I was wondering if you brilliant people out there could help me with a
little Tomcat problem.

I am developing JSP webapps (obviously) with Tomcat 3.1 beta. I just
downloaded it and I have been using Tomcat 3.0 and the JSWDK even before
Tomcat. Tomcat has been excellent, for the most part, but there are two
strange things happening:

1 - Sometimes when I am changing JSP files, saving them, and then reloading
the pages in my browser the Tomcat engine will recompile the JSP pages and
then display the newly compiled stuff, no-problem. However, every once in a
while an old version or a "ghost" version of old JSP classes will just
happen to pop up!!! That's right! Code I worked on 3 days ago will come back
from no where and cause all kinds of strange things to happen until I
restart Tomcat. This happens in Tomcat 3.0 and 3.1. I do not think it is a
browser caching problem, however I am not making any final judgements just
yet. Just wondering if anyone out there has seen some similar behavior.

2 - This is the REAL problem. My server.xml in the conf dir has my context
section looking like this ( and they work fine ):


<Context path="/" docBase="C:\jswdk-1.0.1\webpages\jerky"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false">
 </Context>
        <Context path="/examples" docBase="examples"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false">
 </Context>
 <Context path="/skeleton" docBase="C:\jswdk-1.0.1\webpages\skeleton"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false">
 </Context>
 <Context path="/jerky" docBase="C:\jswdk-1.0.1\webpages\jerky"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false">
  </Context>

What I need done is for the work directory to be either deleted or for the
JSP class files to be recreated when
I restart the Tomcat 3.1 file, regardless if the JSP files have been changed
from the last compile or not.

Now I would assume that the isWorkDirPersistent attribute above would make
all the
.class and .java files in the work dir to be deleted or at least replaced
first thing AFTER the server is restarted. I know that JSWDK and Tomcat 3.0
would do that (after you restarted), but the new Tomcat 3.1 seems to like to
hold onto those darn .class files and will NOT recompile them after a
restart. What can I do, if anything, to overcome this feature/problem???? I
would really appreciate it.

Josh


Re: Special handling of "/*" servlet mapping?

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
"Craig R. McClanahan" wrote:
> 
> Peter Schuller wrote:
> 
> > Hello again,
> >
> > I have a servlet mapping that maps /blabla/* to a servlet. This works fine.
> > /blabla, /blabla/morebla, etc will be mapped to the servlet in question.
> >
> > However, if I change the mapping to "/*" (leaving everything else exactly as
> > before) Tomcat seems to ignore the mapping (requesting "<appname>/" will yield a
> > directory listing, and requesting anything else ("<appname>/<anything>")
> > yields a 404 File not found).
> >
> > Is this correct behavior, and if so, how do I create a default mapping? I
> > want all requests that are not covered by any other explicit mapping, to be
> > forwarded to one servlet.
> >
> > Thank you,
> >
> 
> You are doing the right thing ... it is a bug that was recently discovered in
> 3.1rc1.  A tentative patch has been made and is being evaluated for inclusion in the
> 3.1 final release (looks good so far).

Well, *almost* the right thing ;-) The pattern for the default servlet is
"/", not "/*". The semantics is that a servlet mapped to "/" is used if
neither an exact path match nor an extension match is found. A "/*" is an
invalid 
path mapping pattern, since a path mapping pattern must include at least one
node in the path, e.g. "/foo/*".

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Re: Special handling of "/*" servlet mapping?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Peter Schuller wrote:

> Hello again,
>
> I have a servlet mapping that maps /blabla/* to a servlet. This works fine.
> /blabla, /blabla/morebla, etc will be mapped to the servlet in question.
>
> However, if I change the mapping to "/*" (leaving everything else exactly as
> before) Tomcat seems to ignore the mapping (requesting "<appname>/" will yield a
> directory listing, and requesting anything else ("<appname>/<anything>")
> yields a 404 File not found).
>
> Is this correct behavior, and if so, how do I create a default mapping? I
> want all requests that are not covered by any other explicit mapping, to be
> forwarded to one servlet.
>
> Thank you,
>

You are doing the right thing ... it is a bug that was recently discovered in
3.1rc1.  A tentative patch has been made and is being evaluated for inclusion in the
3.1 final release (looks good so far).

>
> --
> / Peter Schuller, InfiDyne Technologies HB
>

Craig McClanahan