File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes config implicit variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "config implicit variable" Watch "config implicit variable" New topic

config implicit variable

Yu Chen

Joined: Dec 03, 2001
Posts: 28
On page 217 of the Manning Study Kit,
given the following in web.xml:
http://localhost:8080/chapter12/initTest.jsp and
http://localhost:8080/chapter12/InitTestServlet will generate different outputs. But I got exactly the same results, both prints out the init parameters configured in web.xml. ???
Like to share your experience and explainations.
yu chen :roll:

taash mg
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
hi Yu Chen
Do u have a file named InitTestServlet in ur chap12/WEB-INF/...
cause i don't and this(2nd) link gives me file not found :roll:
wheras the first gives me
Servlet Name = InitTestServlet
Parameter region = North America

Cheers<p>Taash<br />SCJP2
Tracy Woo
Ranch Hand

Joined: Jul 23, 2002
Posts: 113
Did you remove the servlet-mapping from the web.xml? You need to remove that to be able to see the distinct behavior.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 671
If you have this mapping:
Then you should see the same result.

We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Maha Annadurai
Ranch Hand

Joined: Oct 27, 2002
Posts: 87
Assuming your web-app context name is "chapter14", and web.xml is configured like below,

The following 2 requests will produce the same results.
1. http://localhost:8080/chapter12/servlet/InitTestServlet ( Note that "/servlet/" here )
2. http://localhost:8080/chapter12/initTest.jsp
If you just make a request like below, you will get 404 not found error.
Maha Anna
[ December 01, 2002: Message edited by: Maha Annadurai ]
I agree. Here's the link:
subject: config implicit variable
It's not a secret anymore!