This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Forward slash query

 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have many web.xml elements
a. which can take value starting with forward slash
b. which can NOT take value starting with forward slash.
c. which can take value starting with or without forward slash
Do we have any key rules/guidelines/tricks that can help me remember which elements take values with forward slash and which take values without forward slash?

~ Abhay
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lets make a list of tags which actually take path to files or URL patters in web.xml (and which are covered in the exam, if I missed any you can add them)

url-pattern (inside servlet-mapping, filter-mapping and web-resource-collection tags)
jsp-file (inside servlet tag)
welcome-file (inside welcome-file-list tag)
location (inside error-page tag)
tag-lib-location (inside taglib which is itself inside jsp-config tag)
form-login-page and form-error-page (inside form-login-config tag)

Now see which tags can accept paths starting from / or without / or both and see if you can find any fix pattern. Some of the information on the pages that I linked might be wrong, for example the value of jsp-file tag must start with / as the spec says

Servlet 2.4 spec wrote:The jsp-file element contains the full path to a JSP file within the web application beginning with a “/”.

 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic