Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tomcat 5.5.6 : How to deploy and run JSP and Servlets

Reply
Thread Tools

Tomcat 5.5.6 : How to deploy and run JSP and Servlets

 
 
Martin
Guest
Posts: n/a
 
      01-03-2005
Hi,
I am having difficulties in deploying any servlet that I copy inside any
context that I define.

mycontext\
mycontext\WEB-INF\
mycontext\WEB-INF\web.xml
mycontext\WEB-INF\classes\myServlet.class

I keep getting a 404 error.

I am running java version "1.5.0" and Tomcat 5.5.6

I installed it in D:\Tomcat 5.5
and did not make any change to conf\server.xml and conf\web.xml

Can anyone come up with a concrete webapp with a servlet that successfuly
deploys ?

Thanks in advance


 
Reply With Quote
 
 
 
 
frankgerlach22@gmx.de
Guest
Posts: n/a
 
      01-03-2005
Most probably there is a configuration error on your web.xml.
Find a working *.jsp file at: www.fgerlach.com/testapp.tar.
Just untar this file in webapps/ and then browse
http://localhost:8080/testapp/
This should print the numbers from 0 to 9.
Note that Winzip removes the empty directory WEB-INF, which is included
in this tar file. It might or might not be necessary.

 
Reply With Quote
 
 
 
 
Ryan Stewart
Guest
Posts: n/a
 
      01-03-2005
Martin wrote:
> Hi,
> I am having difficulties in deploying any servlet that I copy inside

any
> context that I define.
>
> mycontext\
> mycontext\WEB-INF\
> mycontext\WEB-INF\web.xml
> mycontext\WEB-INF\classes\myServlet.class
>

Do not place classes in the default package. Try this:
1) Add a package statement to your servlet class:
package mypackage;
2) Compile your servlet and place it in the /WEB-INF/classes/mypackage
directory.
3) In your web.xml:
<servlet>
<servlet-name>someName</servlet-name>
<servlet-class>mypackage.myServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>someName</servlet-name>
<url-pattern>/someMapping</url-pattern>
</servlet-mapping>
4) Reload the context and access your servlet:
http://localhost:<port>/<context>/someMapping

"someName" and "someMapping" can be anything.

Also, note that class names should begin with a capital letter, so
prefer MyServlet over myServlet.

 
Reply With Quote
 
frankgerlach22@gmx.de
Guest
Posts: n/a
 
      01-03-2005
The package issue is most probably the source of the problem....

 
Reply With Quote
 
kranthi kranthi is offline
Junior Member
Join Date: Sep 2008
Posts: 2
 
      10-01-2008
hallo ,
i have installed tomcat and running also gut but when want to diploy .tar file in war file section its not taking so how can i diploy my tar file please anybody help me..

thanking you in advance
 
Reply With Quote
 
kranthi kranthi is offline
Junior Member
Join Date: Sep 2008
Posts: 2
 
      10-01-2008
Hallo
when i have given my carwal dir to search using tomact iam gettin this errors can any body help me please..

thanking you in advance

org.apache.jasper.JasperException: /search.jsp(151,22) Attribute value
language + "/include/header.html" is quoted with " which must be escaped when used within the value
org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatc h(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspErro r(ErrorDispatcher.java:19
org.apache.jasper.compiler.Parser.parseQuoted(Pars er.java:301)
org.apache.jasper.compiler.Parser.parseAttributeVa lue(Parser.java:250)
org.apache.jasper.compiler.Parser.parseAttribute(P arser.java:212)
org.apache.jasper.compiler.Parser.parseAttributes( Parser.java:155)
org.apache.jasper.compiler.Parser.parseInclude(Par ser.java:869)
org.apache.jasper.compiler.Parser.parseStandardAct ion(Parser.java:1136)
org.apache.jasper.compiler.Parser.parseElements(Pa rser.java:1466)
org.apache.jasper.compiler.Parser.parse(Parser.jav a:13
org.apache.jasper.compiler.ParserController.doPars e(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse( ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(C ompiler.java:154)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:315)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:295)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:282)
org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
 
Reply With Quote
 
anupam.cmit anupam.cmit is offline
Junior Member
Join Date: Dec 2010
Posts: 1
 
      12-11-2010
you have to edit conf/web.xml and enable servlet invoker
open web.xml and remove comment from servlet invoker
you can do this by find and replace in notepad
find invoker and remove comment

then restart your tomcat
create the folder named classes in WEB-INF/<create here classes folder>
and enter the address in URl localhost:8080/servlet/<your servlet name>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you deploy servlets and web services from a .war? ses Java 1 10-25-2010 04:33 PM
Can you deploy servlets and web services from a .war? ses Java 4 10-21-2010 04:13 PM
Deploy won't deploy Masterpage.master GaryDean ASP .Net 1 04-14-2009 01:50 AM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
Java servlets: Hi All! I want to display xml file in browser using servlets datta.saru Software 0 05-15-2006 03:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57