*JSP content:* *<html> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <%@ page session="false"%> <body bgcolor="white"> <jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type=" dates.JspCalendar" /> <font size=4> <ul> <li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/> <li> Year: is <jsp:getProperty name="clock" property="year"/> <li> Month: is <jsp:getProperty name="clock" property="month"/> <li> Time: is <jsp:getProperty name="clock" property="time"/> <li> Date: is <jsp:getProperty name="clock" property="date"/> <li> Day: is <jsp:getProperty name="clock" property="day"/> <li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/> <li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/> <li> era: is <jsp:getProperty name="clock" property="era"/> <li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/> <li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/> </ul> </font> ** </body> </html>* *WEB.XML content:* <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <!-- General description of your web application --> <display-name>My Web Application</display-name> <description> This is version X.X of an application to perform a wild and wonderful task, based on servlets and JSP pages. It was written by Dave Developer ([EMAIL PROTECTED]), who should be contacted for more information. </description> <!-- Context initialization parameters that define shared String constants used within your application, which can be customized by the system administrator who is installing your application. The values actually assigned to these parameters can be retrieved in a servlet or JSP page by calling: String value = getServletContext().getInitParameter("name"); where "name" matches the <param-name> element of one of these initialization parameters. You can define any number of context initialization parameters, including zero. --> <context-param> <param-name>webmaster</param-name> <param-value>[EMAIL PROTECTED]</param-value> <description> The EMAIL address of the administrator to whom questions and comments about this application should be addressed. </description> </context-param> <!-- Servlet definitions for the servlets that make up your web application, including initialization parameters. With Tomcat, you can also send requests to servlets not listed here with a request like this: http://localhost:8080/{context-path}/servlet/{classname} but this usage is not guaranteed to be portable. It also makes relative references to images and other resources required by your servlet more complicated, so defining all of your servlets (and defining a mapping to them with a servlet-mapping element) is recommended. Servlet initialization parameters can be retrieved in a servlet or JSP page by calling: String value = getServletConfig().getInitParameter("name"); where "name" matches the <param-name> element of one of these initialization parameters. You can define any number of servlets, including zero. --> <servlet> <servlet-name>controller</servlet-name> <description> This servlet plays the "controller" role in the MVC architecture used in this application. It is generally mapped to the ".do" filename extension with a servlet-mapping element, and all form submits in the app will be submitted to a request URI like "saveCustomer.do", which will therefore be mapped to this servlet. The initialization parameter namess for this servlet are the "servlet path" that will be received by this servlet (after the filename extension is removed). The corresponding value is the name of the action class that will be used to process this request. </description> <servlet-class>com.mycompany.mypackage.ControllerServlet</servlet-class> <init-param> <param-name>listOrders</param-name> <param-value>com.mycompany.myactions.ListOrdersAction</param-value> </init-param> <init-param> <param-name>saveCustomer</param-name> <param-value>com.mycompany.myactions.SaveCustomerAction</param-value> </init-param> <!-- Load this servlet at server startup time --> <load-on-startup>5</load-on-startup> </servlet> <servlet> <servlet-name>graph</servlet-name> <description> This servlet produces GIF images that are dynamically generated graphs, based on the input parameters included on the request. It is generally mapped to a specific request URI like "/graph". </description> </servlet> <!-- Define mappings that are used by the servlet container to translate a particular request URI (context-relative) to a particular servlet. The examples below correspond to the servlet descriptions above. Thus, a request URI like: http://localhost:8080/{contextpath}/graph will be mapped to the "graph" servlet, while a request like: http://localhost:8080/{contextpath}/saveCustomer.do will be mapped to the "controller" servlet. You may define any number of servlet mappings, including zero. It is also legal to define more than one mapping for the same servlet, if you wish to. --> <servlet-mapping> <servlet-name>controller</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>graph</servlet-name> <url-pattern>/graph</url-pattern> </servlet-mapping> <!-- Define the default session timeout for your application, in minutes. From a servlet or JSP page, you can modify the timeout for a particular session dynamically by using HttpSession.getMaxInactiveInterval(). --> <session-config> <session-timeout>30</session-timeout> <!-- 30 minutes --> </session-config> </web-app> *ERROR message printed by the Opera:* type Rapport d'exception message description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête. *(translation-> the server can't reply to the request because of an interne error*) exception org.apache.jasper.JasperException: org.apache.jasper.JasperException: Impossible de charger la classe pour la JSP(*translation-> can't load the class for JSP*) org.apache.jasper.servlet.JspServletWrapper.getServlet( JspServletWrapper.java:156) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java :329) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) cause mère(*main error trigger*) org.apache.jasper.JasperException: Impossible de charger la classe pour la JSP(*translation can't load the class for JSP*) org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:600) org.apache.jasper.servlet.JspServletWrapper.getServlet( JspServletWrapper.java:144) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java :329) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) cause mère(*main error trigger*) java.lang.ClassNotFoundException: org.apache.jsp.date_jsp java.net.URLClassLoader$1.run(Unknown Source) java.security.AccessController.doPrivileged(Native Method) java.net.URLClassLoader.findClass(Unknown Source) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134) org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66) org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598) org.apache.jasper.servlet.JspServletWrapper.getServlet( JspServletWrapper.java:144) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java :329) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) *ERROR message coming from log file:* 22 déc. 2007 00:58:51 org.apache.catalina.core.StandardWrapperValve invoke GRAVE: "Servlet.service()" pour la servlet jsp a généré une exception (*translation-> serious: servlet JSP triggered an exception*) java.lang.ClassNotFoundException: org.apache.jsp.date_jsp at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134) at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66) at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java :598) at org.apache.jasper.servlet.JspServletWrapper.getServlet( JspServletWrapper.java:144) at org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:329) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :102) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java :263) at org.apache.coyote.http11.Http11AprProcessor.process( Http11AprProcessor.java:852) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process( Http11AprProtocol.java:584) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508) at java.lang.Thread.run(Unknown Source) Cheers 2007/12/21, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > Please Display > jsp and > accompanying web.xml > > Thanks > M- > ----- Original Message ----- > Wrom: MQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGV > To: "Tomcat Users List" <users@tomcat.apache.org> > Sent: Friday, December 21, 2007 2:36 PM > Subject: RE: how to run a simple jsp file > > > maybe you're lacking a jar file required? Maybe servlet jar file or other? > > -----Original Message----- > Wrom: CJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWL > Sent: Friday, December 21, 2007 1:30 PM > To: Tomcat Users List > Subject: Re: how to run a simple jsp file > > > well, > > the thing is i'm just trying to run examples provided by Tomcat 6 and > located in the example directory. > normally those files already contain such things(<% @ page import=" > java.util.*,%>) > i have added some and it doesn't change anything. > actually all import routines are already contained in files that calls the > JSP... > > cheers > > > 2007/12/21, Propes, Barry L <[EMAIL PROTECTED]>: > > > > this sounds like you maybe haven't properly imported the necessary class > > packages into your JSP file with @page declarative statement, like so > for > > example: > > > > <% @ page import="java.util.*,%> > > > > just a guess, but probably a sound one in this case. > > > > -----Original Message----- > > Wrom: SZLKBRNVWWCUFPEGAUTFJMVRESKPNKMB > > Sent: Friday, December 21, 2007 3:59 AM > > To: Tomcat Users List; [EMAIL PROTECTED] > > Subject: Re: how to run a simple jsp file > > > > > > the log says it can't load the class for JSP > > > > 2007/12/21, Pid <[EMAIL PROTECTED]>: > > > > > > Joly M wrote: > > > > Hello there, > > > > > > > > I'm struggling on running JSP files. > > > > I've got some JSP files containing Java codes. When I try to run > those > > > > files, I get an error number 500. > > > > When I run JSP files not containing any Java code at all, Everything > > > works. > > > > It seems like the problem comes from Java files. > > > > > > > > I know that I've got to configure some XML files (eg: web.xml) in > > order > > > to > > > > run any Servlet. > > > > Is there any XML files I have to configure to run JSPs on Apache > > Tomcat > > > 6 ? > > > > > > > > Cheers > > > > > > > > > > What do the logs say is causing the error? > > > > > > > > > > > > p > > > > > > --------------------------------------------------------------------- > > > To start a new topic, e-mail: users@tomcat.apache.org > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To start a new topic, e-mail: users@tomcat.apache.org > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >