Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enthuware issue - I think

 
Kelahcim Kela
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that question: com.enthuware.ets.scwcd.v5.2.382 has a small issue. According to the simulator answer

1. <servlet-mapping>
<servlet-name>catalog</servlet-name>
<url-pattern>/catalog/*</url-pattern>
</servlet-mapping>

is correct, while

2. <servlet-mapping>
<servlet-name>com.abcinc.CatalogServlet.class</servlet-name>
<url-pattern>/catalog/*</url-pattern>
</servlet-mapping>
The value of <servlet-name> tag should be the servlet name defined earlier
in a <servlet> tag and not the servlet class name.

is incorrect - which is not exactly true.


It is possible to make such a mapping (2) valid:

<servlet>
<servlet-name>com.abcinc.CatalogServlet.class</servlet-name>
<servlet-class>com.abcinc.CatalogServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>com.abcinc.CatalogServlet.class</servlet-name>
<url-pattern>/CatalogServlet</url-pattern>
</servlet-mapping>
 
jan ter avest
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get your drift, the SCWCD exam is daunting and it does make you ponder a lot about even the simplest of questions. I think in this case the crux is you can put anything you want in the <servet-name> as long as they're consistent. So I guess you're right. But I think what this question wanted to show you is that using the .class name in the <servlet-mapping><servlet-name> is generally speaking wrong, as you would almost certainly never use it for a name in the <servlet><servlet-name> tags.

There are some more questions in Enthuware that can be interpreted in different ways, and even some small typos, but the important thing is you understand how things work. And in my case, enthuware helped a lot with that!
[ September 27, 2008: Message edited by: jan ter avest ]
 
Kelahcim Kela
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jan ter avest:
So I guess you're right. But I think what this question wanted to show you is that using the .class name in the <servlet-mapping><servlet-name> is generally speaking wrong


You are 100% right that there are some good practices and I agree with that.

On the other hand, I think that this kind of questions are not valid for the exam as they imply that this is illegal while in fact it is just not preferable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic