6 Ответы Последний ответ: 09.08.2002 19:35, автор: 843835

    View JSP Examples in Tomcat 4

    843835
      Hello everyone,
      I will really appreciate your advise on this problem.
      I am not able to run the JSP examples in Tomcat 4. I can see that the document sais:

      These examples will only work when these pages are being served by the ServletRunner. They will not work if you are viewing these pages via a "file://..." URL.

      But I don't know what does that mean. What should I do? How can I view these examples?


      Thank you very much for any advise and for your time.
      Martin
        • 1. Re: View JSP Examples in Tomcat 4
          843835
          Hi,

          > These examples will only work when these pages are
          being served by the ServletRunner. They will not work
          if you are viewing these pages via a "file://..." URL.
          But I don't know what does that mean. What should I
          do? How can I view these examples?
          Normally JSP pages will be executed at server side before serving
          the output to client. But you can see the same file using any editor
          or using windows explorer.i.e you are directly viewing the jsp page.
          here you are using file protocol. But when you access the same page
          using any browser by specifying it's URL for ex: http://localhost:8080/myjsp.jsp
          you are using http as protocol to get the required page/file.

          For more information on how to install and run Tomcat 4, please go
          through the running.txt file which is there under tomcat-docs folder
          of your tomcat installation\webapps.

          Hope this helps.

          Good Luck.

          Gayam.Srinivasa Reddy
          Developer Technical Support
          Sun Micro Sysytems
          http://www.sun.com/developers/support/
          • 2. Re: View JSP Examples in Tomcat 4
            843835
            >
            Normally JSP pages will be executed at server side
            e before serving
            the output to client. But you can see the same file
            using any editor
            or using windows explorer.i.e you are directly viewing
            the jsp page.
            here you are using file protocol. But when you access
            the same page
            using any browser by specifying it's URL for ex:
            http://localhost:8080/myjsp.jsp
            you are using http as protocol to get the required
            page/file.

            Gayam.Srinivasa Reddy
            Hello ,

            My problem is that when I start Tomcat and type in my browser:
            http://localhost:8080/examples/jsp/index.html
            I see the JSP examples. But when I try to click on one of them,
            I get an error like this:

            http://localhost:8080/examples/jsp/num/numguess.jsp

            Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error

            --------------------------------------------------------------------------------

            type Exception report

            message Internal Server Error

            description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

            exception

            javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception
                 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
                 at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214).......
                 
            ....and so on...........

            root cause

            java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths(Ljava/lang/String;)Ljava/util/Set;
                 at org.apache.jasper.compiler.TldLocationsCache.processJars(TldLocationsCache.java:202)
                 at org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:139)
                 at org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:345)
                 at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
                 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
            ....................and so on

            Please give me a hint of how to fix this problem.
            Thank you very much for your time and advise!
            Martin
                 
            • 3. Re: View JSP Examples in Tomcat 4
              843835
              I also have the same problem, have you had any luck fixing it?

              I am running WinXP Pro
              J2SE 1.4 Win32
              Tomcat 4.0.3 Win32

              I can run the Servlet Examples without any problems but I cannot run the JSP examples or any other JSP code as far as I can tell as I get a HTTP 500 Internal Server Error.

              Thanks

              Adam Retter
              adam@cosmic.org.uk
              • 4. Re: View JSP Examples in Tomcat 4
                843835
                Hi,
                I have had many similar problems when trying to run anything on XP professional. This includes the problem you are having, and many other tomcat related problems. I test on win98, win2000 and sadly I have xp pro upgraded from xp home on this machine, and its absulutely rubbish.
                My most recent problem was getting tomcat and IIS to run together, and this was fine with 2000, but not on XP. Maybe microsoft will bring out patches to patch their patches on this stable software?
                best,
                kev
                • 5. Re: View JSP Examples in Tomcat 4
                  843835
                  Im not actually trying to run Tomcat with IIS.

                  I also had exactly the same problems I am experiencing now with Window2000 as well so I am guessing that its not XP that is at fault?

                  Thanks

                  Adam Retter
                  adam@cosmic.org.uk
                  • 6. Re: View JSP Examples in Tomcat 4
                    843835
                    This is in response to the problem...
                    org.apache.jasper.compiler.TldLocationsCache.processJars

                    I had the same problem. I had tomcat 4.0.4-b3 working with IIS 5.0. I then was trying to install Struts and get an application working and suddenly I started getting that error. The reason why was because I moved the jar servlet.jar into the class path on my machine. This created a conflict for tomcat. I'm not positive the exact reasons but I'm guessing it's because tomcat was expecting different servlet source code other than the servlet.jar that I stuck in the path. After I removed it from the path and restarted tomcat everything worked again.