Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat/JSP help me

 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Tomcat forum.
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic