• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

withmilk mock, url-pattern, forward slash?

 
viswanath sastry
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the question in withmilk.com,
Given:
<servlet-mapping>
<servlet-name>tempServlet</servlet-name>
<url-pattern>temp.jsp</url-pattern>
</servlet-mapping>
File 'temp.jsp' is in the myApp root.
Identify true statement when the url for tempServlet is typed in the location bar of a browser e.g.: http://127.0.0.1:8080/myApp/servlet/myPackage.tempServlet
A <servlet-name> should be the parent tag of
<servlet-mapping>
B Contents of temp.jsp from the myApp root is
displayed on the screen
C 'servlet' should be 'Servlet' in the URL -
capital 'S'
D Error is generated
The explanation given was,
D is true. A is false as it is fine the way it is mapped.Error is generated. The url-pattern should have a preceding forward slash: /temp.jsp to be succesful. And the idea is that when temp.jsp is called - tempServlet is displayed, not the other way around.
But,i have not seen in the specification nor in deshmukh book saying that url-pattern must have a forward slash. Please explain this to me.
Thanks
 
viswanath sastry
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
knock.. knock... someone please answer.
 
jamel bal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I suggest you to read page 216 , 217 on the book.
I will get back to you as soon as possible.
 
Anna Wells
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also a bit confused about '/'.
hope someone clears this for us!!
Regards
Anna
 
Harry D'Souza
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Rules given on page # 74 of the SCWCD Study Kit (by Deshmukh) explains this point. Further explaination of the same point can be found on the page # 75 too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic