aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "config implicit variable" Watch "config implicit variable" New topic
Author

config implicit variable

Yu Chen
Greenhorn

Joined: Dec 03, 2001
Posts: 28
On page 217 of the Manning Study Kit,
given the following in web.xml:
<servlet-mapping>
<servlet-name>InitTestServlet</servlet-name>
<url-pattern>/initTest.jsp</url-pattern>
</servlet-mapping>
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.
Thanks.
yu chen :roll:


SCJP2<br />SCWCD
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:
<servlet-mapping>
<servlet-name>InitTestServlet</servlet-name>
<url-pattern>/initTest.jsp</url-pattern>
</servlet-mapping>
Then you should see the same result.


BJ - SCJP and SCWCD
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.
http://localhost:8080/chapter12/InitTestServlet
regards,
Maha Anna
[ December 01, 2002: Message edited by: Maha Annadurai ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: config implicit variable