On 3/19/2013 1:05 PM, Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Leo,

On 3/19/13 12:15 PM, Leo Donahue - RDSA IT wrote:
-----Original Message----- From: Satya Priya Das
[mailto:am_sp...@yahoo.co.in] Subject: problems faced in
deploying servlet

I am a retd. software person,worked with
autocoder,COBOL,assembler,c, and now trying to learn java, I am
using Java for the Web with Servlets,jsp,and EJB by Budi
Kurniwan, but unfortunatetely the tomcat v4 has been used in the
book for examples. Downloading of tomcat6.0.36, and installing of
tomcat has been done success fully.The example in chapter one has
been compiled and tested o.k.,The servlet context example
compiled and deployed successfully. Now the example for
RequestDemoServlet has been compiled  o.k, but when I want to
deploy the example with index.html file using action element,
the source not found message is displayed. I have used alias
name,class name, even url-mapping but result is same. A directory
myapp has been created under which  subdirs are build,doc,web and
build.xml build.properties file. The wb.xml file created as per
book with //DTDWeb application 2.3//en pL. guide me how I can
trace the causes of resource not found message. Thanks s.p.das

I looked up your book online using Google Books.  I can see on
page 31 where your project starts, but it skips the rest of the
pages to page 34.  I'm guessing this line is your problem:

<FORM ACTION=servlet/ResponseDemoServlet METHOD="POST">

Tomcat 4 had something called the invoker servlet turned on by
default, which meant requests were passed through the mapping of:
servlet/someservletname.

+1

Tomcat 6 doesn't have that on by default anymore, and you should
leave it that way.

+1

All you need to do is update the url-mapping for your form's
action to the correct url pattern, based on how you deployed your
"myapp" and how you referenced this servlet in your web.xml.

Yup: something like <form action="ResponseDemoServlet"> in your HTML
and then a <servlet> that defines the servlet in web.xml and then a
<servlet-mapping> which maps it later on -- also in web.xml.

You are likely going to be confused throughout this book if all
the examples are based on Tomcat 4.  I don't know anyone still
putting HTML code in out.println statements.  Can you afford to get
a newer book on JSP/Servlets?  There are also semi-decent websites
that have some newer content.

I completely agree: while webapps are (mostly) forward-compatible with
newer servers, a lot of old books are going to be relying on features
like the invoker servlet.

Go get a copy of "Tomcat: The Definitive Guide" by Jason Brittain (who
happens to lurk on this list, FYI) and Ian Darwin. It's targeted at
Tomcat 6.x but not much has changed (with old features) since its
publication. There's plenty of new, exciting stuff but the basics will
be well-covered by T:TDG.

+1

This is a great book for Tomcat. I also recommend the following book for learning Servlets, JSP, etc.

Head First Servlets and JSP, 2nd Edition
By Bryan Basham, Kathy Sierra, Bert Bates

It's an enjoyable read even for us old farts who come from traditional programming backgrounds. It manages to cover both the standards (2.5) and some best practices at the same time.

I'm not an author, nor affiliated with O'Reilly. I'm just a happy reader.

. . . . just my two cents.
/mde/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to