• 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

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: 9707
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 “/”.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic