You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kai Utility <ka...@fastmail.fm> on 2005/01/18 05:58:15 UTC

index.jsp: why don't modifications to it show up?

Thanks for your excellent introduction to setting up Tomcat.
I've thought of an addition you might want to include, namely, how to
replace tomcat's index.jsp with one's own.  I'm doing a very limited web
site and wish to expose it to the internet but I don't want the default
tomcat startup page.  Unfortunately, I've found this to be a non-trivial
task that I've spent all day on and still haven't solved.  Below follows
an email I'm sending to tomcat-user@jakarta.apache.org:


I have recently installed tomcat 5.5.4.
I wish to use my own index.jsp in place of the out-of-the-box one.
However, when I make changes to it they don't register.
I.e. I'm making changes to
   $CATALINA_HOME/webapps/ROOT/index.jsp

I have searched this list for "index.jsp" and come up with some
information but I haven't had success yet.  More on that presently. 
This is some of what I've seen so far:

---
http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgId=1735120

When using Tomcat 5.0.25 it seems that any change I make to
ROOT/index.jsp does not show up in the
browser (in Tomcat 4.xx this was easy to do).  I am sure this is some
sort of caching problem so
I've been looking for the compiled JSP in the work directory to delete
it.  Very strange, but it
doesn't seem like this JSP is compiled anywhere.

Does Tomcat 5.0 have some sort of memory resident or log caching that
persists even after the
server is restarted?

---
http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgNo=150033

Check the webapp's WEB-INF/web.xml -- is said JSP precompiled?

If so, changing the file will (understandably) have no effect: the
container checks its servlet mappings first, files (say, JSPs) second.

---
http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgId=1735455

Good suggestion.  If the JSP is precompiled shouldn't I be able to go to
the work directory and
see index_jsp.class somewhere under a ROOT directory (like there is for
other webapps)?  I guess
one of my basic questions is that why don't I see a ROOT directory in
the work directory?

---
http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgId=1735458

You tell me -- how did you precompile?  

If you're placing classes directly in the "/work" dir, then, yes;
if you're building class files and updating web.xml, then, no.

The former method of precompilation is Tomcat-specific and accounts for
a JSP being updated.  The latter is for production deployments, in which
case the JSPs should not change throughout the release lifetime.

The root context may be under "/work/_" in TC5, but don't quote me on
that.

---
There were some other conversations on this topic but the above seemed
the best.
It seems that the last message above may be pertinent but I don't
understand it.

I found two instances of index_jsp.class in my tomcat tree.
I deleted both and nothing happened.

---
My setup:
I'm running Tomcat 5.5.4 standalone (no apache).

$CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml
contains the following:
    <servlet>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>org.apache.jsp.index_jsp</servlet-name>
        <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>

$CATALINA_HOME/conf/web.xml
contains the following (all standard, except I'm allowing the invoker
servlet):
    <servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>invoker</servlet-name>
        <servlet-class>
          org.apache.catalina.servlets.InvokerServlet
        </servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
-- 
  Kai Utility
  kaiutil@fastmail.fm


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: index.jsp: why don't modifications to it show up?

Posted by "Sean M. Duncan" <se...@ferrosoft.com>.
I ran into the same issue a while back and found that there is a
compiled version of the index.jsp in catalina-root.jar file in the /WEB-
INF/lib folder of the root web application.

Hope that helps.

-Sean

On Mon, 2005-01-17 at 20:58 -0800, Kai Utility wrote:
> Thanks for your excellent introduction to setting up Tomcat.
> I've thought of an addition you might want to include, namely, how to
> replace tomcat's index.jsp with one's own.  I'm doing a very limited web
> site and wish to expose it to the internet but I don't want the default
> tomcat startup page.  Unfortunately, I've found this to be a non-trivial
> task that I've spent all day on and still haven't solved.  Below follows
> an email I'm sending to tomcat-user@jakarta.apache.org:
> 
> 
> I have recently installed tomcat 5.5.4.
> I wish to use my own index.jsp in place of the out-of-the-box one.
> However, when I make changes to it they don't register.
> I.e. I'm making changes to
>    $CATALINA_HOME/webapps/ROOT/index.jsp
> 
> I have searched this list for "index.jsp" and come up with some
> information but I haven't had success yet.  More on that presently. 
> This is some of what I've seen so far:
> 
> ---
> http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgId=1735120
> 
> When using Tomcat 5.0.25 it seems that any change I make to
> ROOT/index.jsp does not show up in the
> browser (in Tomcat 4.xx this was easy to do).  I am sure this is some
> sort of caching problem so
> I've been looking for the compiled JSP in the work directory to delete
> it.  Very strange, but it
> doesn't seem like this JSP is compiled anywhere.
> 
> Does Tomcat 5.0 have some sort of memory resident or log caching that
> persists even after the
> server is restarted?
> 
> ---
> http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgNo=150033
> 
> Check the webapp's WEB-INF/web.xml -- is said JSP precompiled?
> 
> If so, changing the file will (understandably) have no effect: the
> container checks its servlet mappings first, files (say, JSPs) second.
> 
> ---
> http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgId=1735455
> 
> Good suggestion.  If the JSP is precompiled shouldn't I be able to go to
> the work directory and
> see index_jsp.class somewhere under a ROOT directory (like there is for
> other webapps)?  I guess
> one of my basic questions is that why don't I see a ROOT directory in
> the work directory?
> 
> ---
> http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=tomcat-user@jakarta.apache.org&msgId=1735458
> 
> You tell me -- how did you precompile?  
> 
> If you're placing classes directly in the "/work" dir, then, yes;
> if you're building class files and updating web.xml, then, no.
> 
> The former method of precompilation is Tomcat-specific and accounts for
> a JSP being updated.  The latter is for production deployments, in which
> case the JSPs should not change throughout the release lifetime.
> 
> The root context may be under "/work/_" in TC5, but don't quote me on
> that.
> 
> ---
> There were some other conversations on this topic but the above seemed
> the best.
> It seems that the last message above may be pertinent but I don't
> understand it.
> 
> I found two instances of index_jsp.class in my tomcat tree.
> I deleted both and nothing happened.
> 
> ---
> My setup:
> I'm running Tomcat 5.5.4 standalone (no apache).
> 
> $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml
> contains the following:
>     <servlet>
>         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
>         <servlet-class>org.apache.jsp.index_jsp</servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>org.apache.jsp.index_jsp</servlet-name>
>         <url-pattern>/index.jsp</url-pattern>
>     </servlet-mapping>
> 
> $CATALINA_HOME/conf/web.xml
> contains the following (all standard, except I'm allowing the invoker
> servlet):
>     <servlet>
>         <servlet-name>default</servlet-name>
>         <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>         <init-param>
>             <param-name>debug</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <init-param>
>             <param-name>listings</param-name>
>             <param-value>false</param-value>
>         </init-param>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
> 
>     <servlet>
>         <servlet-name>invoker</servlet-name>
>         <servlet-class>
>           org.apache.catalina.servlets.InvokerServlet
>         </servlet-class>
>         <init-param>
>             <param-name>debug</param-name>
>             <param-value>0</param-value>
>         </init-param>
>         <load-on-startup>2</load-on-startup>
>     </servlet>
> 
>     <servlet-mapping>
>         <servlet-name>default</servlet-name>
>         <url-pattern>/</url-pattern>
>     </servlet-mapping>
> 
>     <welcome-file-list>
>         <welcome-file>index.html</welcome-file>
>         <welcome-file>index.htm</welcome-file>
>         <welcome-file>index.jsp</welcome-file>
>     </welcome-file-list>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: index.jsp: why don't modifications to it show up?

Posted by QM <qm...@brandxdev.net>.
On Mon, Jan 17, 2005 at 08:58:15PM -0800, Kai Utility wrote:
: Thanks for your excellent introduction to setting up Tomcat.
: I've thought of an addition you might want to include, namely, how to
: replace tomcat's index.jsp with one's own.

What about either one of the following, instead:
1/ a big red message in the default Tomcat webapps to tell people,
"don't edit this directly; create your own webapp!"

2/ a similar message in the docs

(These two may already exist, I haven't yet checked the FAQ/wiki/etc.)

3/ a sample webapp that's *not* precompiled, and thus designed for user
tweaking

Really, this question comes up every few weeks...

I figure #1 would have the greatest impact (read: result in the fewest
such questions to the list).

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org