aspose file tools*
The moose likes Tomcat and the fly likes Tomcat 6 and jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 6 and jsps" Watch "Tomcat 6 and jsps" New topic
Author

Tomcat 6 and jsps

Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
I installed Tomcat 6, Sun's java 6 & j2ee 5. I dropped all my jsps (& images, css files, etc) into ROOT.

I have 2 issues.
  • I still see the Tomcat home page even tho I've renamed/replaced index.jsp. The Tomcat docs suggest commenting out something in $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml that isn't in the web.xml I have at that location. When I commented out what was there (web-app), I got a 404 for index.jsp.


  • The dynamic part of my jsp (jsp:include page='xxx.jsp') is not showing up, only the html part is.

  • Did I miss something?
    [ September 20, 2007: Message edited by: Marilyn de Queiroz ]

    JavaBeginnersFaq
    "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
    Jesper de Jong
    Java Cowboy
    Saloon Keeper

    Joined: Aug 16, 2005
    Posts: 13875
        
      10

    Have you looked at the log files in the 'logs' directory of Tomcat to see if there are any error messages while deploying your applications?

    You could try deleting everything in the 'work' directory (that's where Tomcat stored compiled JSPs etc.) and restarting Tomcat.


    Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
    Scala Notes - My blog about Scala
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    The JSPs in Tomcat's ROOT webapp have been pre-compiled and each has a servlet entry in the web.xml file. Look for servlet entries that have a jsp-file node instead of a servlet-class node.

    Rather than try to edit that app, you might want to create your own to work with.

    It's quick and easy.
    Simply:
    Create a folder under tomcat/webapps (myapp).
    Inside that folder create another one one named WEB-INF (myapp/WEB-INF)
    That's it, you're done.
    You can put JSPs in the myapp directory and access it with:
    http://localhost:8080/myapp/mypage.jsp


    Another quick way to get started is to download one of the war files from our codebarn to the webapps directory.
    Tomcat will unpack and deploy it for you. You will then have a working app with a deployment descriptor and proper directory structure.
    [ September 21, 2007: Message edited by: Ben Souther ]

    Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
    Marilyn de Queiroz
    Sheriff

    Joined: Jul 22, 2000
    Posts: 9043
        
      10
    I should say that I tested my jsps in orion. Then I tried to put them on the remote server which is running Tomcat (I don't know which version) and they didn't work, so that's the reason I'm trying to run them in Tomcat locally. I do seem, however, to be having the same issue in Tomcat locally that I see on the remote server. I don't have access to Tomcat remotely, so creating directories etc is not really practical. Actually, I'm not sure whether they might not have already done that since the directory my jsps are in is /home/xxx/mainwebapp_html/
    I don't know what the relationship is from that directory to the Tomcat directory(ies).

    I do see an error in the log, however, so let me deal with that first.
    [ September 21, 2007: Message edited by: Marilyn de Queiroz ]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Tomcat 6 and jsps
     
    Similar Threads
    Tomcat Welcome ROOT web app problems - only some content displaying
    welcome-file and forwards...
    Precompiled index.jsp - how to map to webroot?
    Questions on tomcat5
    Eclipse "web.xml" entry point?