• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

withmilk mock, url-pattern, forward slash?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
knock.. knock... someone please answer.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also a bit confused about '/'.
hope someone clears this for us!!
Regards
Anna
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic