Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beginner : How to run a servlet in Apache Tomcat

 
rimzim sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one please tell me the directory structure ..i.e. where do we keep servlets , jsp & htmls of an application & how do we call the servlet
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hope This Helps
Praful
[ November 09, 2004: Message edited by: Praful Thakare ]
 
rimzim sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks but what about web.xml..where shud it sit?
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOPS.I missed the heart of Webapps ..it must sit (or sleep ) in WEB-INF.

Cheers
-Praful
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of these details are covered in the servlet API which you can find from this Sun web site. Everybody seriously interested in programming servlets should have a copy.
Bill
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also Rimzim, bear in mind that your context does not have to be under the Tomcat webapps directory. It can be anywhere in your machine so long as it's got the correct directory structure. This is made possible by the fact that when you go to administration page of Tomcat, you can create new web apps (contexts) and tell Tomcat the path of the apps together with their docBase. The important part here is the docBase. Hope that helps.
 
rimzim sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks did everything but I am getting this error

java.lang.UnsupportedClassVersionError: HelloServlet (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1643

Any Suggestions..?
I m using jdk1.5

Rgds
Rimzim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic