Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes Tomcat/JSP help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat/JSP help me" Watch "Tomcat/JSP help me" New topic
Author

Tomcat/JSP help me

Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi all,

I would like know how to configure tomcat5.xx to run my first JSP index.jsp. And I also would like know how to deploy it on the Tomcat.Knowing that I know how to run and deploy a servlet on tomcat.

Thank you in advance for your help

Mo


We are ones that build the world, thus build it well.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60756
    
  65

Moved to the Tomcat forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Have you looked here?
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/index.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi,

Thank you for your help.
So far, All jsp examples provided with tomcat works well.
My own html pages works as well.But my own jsp pages doesn't work. I have problem of compilation.
Could you help me to configure the classpath in order to compile jsp pages.

Thank you in advance for your help

Mo
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43

I have problem of compilation.


Please post the details: Are you getting an exception? Which one? Maybe it's not a classpath problem, but a syntax problem?


Ping & DNS - my free Android networking tools app
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi all,

I have still compilation problem. I hope there is at least someone in this forum to resolve my problem.

Here my problem:

exception

javax.servlet.ServletException: L'enrobeur (wrapper) ne peut trouver la classe servlet org.apache.jsp.toto_jsp ou une classe dont elle d�pend
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)


cause m�re

java.lang.ClassNotFoundException: org.apache.jsp.toto_jsp
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)


note La trace compl�te de la cause m�re de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/5.5.9.


--------------------------------------------------------------------------------
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi all,

Now my *.jsp works fine.But I don't why?
Before it worked, there was in the web.xml the following lines related with my jsp page toto.jsp :
<servlet>
<servlet-name>org.apache.jsp.toto_jsp</servlet-name>
<servlet-class>org.apache.jsp.toto_jsp</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>org.apache.jsp.toto_jsp</servlet-name>
<url-pattern>/toto.jsp</url-pattern>
</servlet-mapping>

I work with tomcat 5.5.8. When I removed the previous lines in the web.xml I was able to run my page : http://127.0.0.1:8080/test/toto.jsp

So What the use of the web.xml ? Because I nothing put in it

Mo
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43
Servlet mappings are for servlets, not JSPs. Even though JSPs may be implemented as servlets, they are not mapped in web.xml. web.xml has many other functions, one if which is to indicate to Tomcat that the directory it's in is a web application, not just a directory containing static resources. If you read the servlet/JSP specification you'll become aware of all the things that can be configured using web.xml.
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Thanks you for your answer. But I have a question for you:

You said:
"web.xml has many other functions, one if which is to indicate to Tomcat that the directory it's in is a web application, not just a directory containing static resources."

In my case I did not need to indicate the directory where there was my web application (http://127.0.0.1/test/toto.jsp).

Anyway I think I need to read in details the JSP's specifications.

Thank you for all.

MO
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41062
    
  43

In my case I did not need to indicate the directory where there was my web application (http://127.0.0.1/test/toto.jsp).


If you have very simple JSP pages only (no tag libraries, no error pages, no servlets, no security etc.) you can do w/o a web.xml. But any of those more advanced features will require some kind of declaration in web.xml
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tomcat/JSP help me
 
Similar Threads
JSP can not find EJB.
tomcat
eclipse and birt.
Deploy simple JSP Page
Deploy a Simple JSP Page