• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q 12, Eduardo's mock

 
Raj Kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which are mandatory elements of the web-resouce-collection element?
1) web-resource-name
2) url-pattern
3) http-method
4) auth-constraint
Answer given:
1)web-resource-name
2) url-pattern
I dont think url-pattern is mandatory. Am I correct?
 
Srini Admala
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
web-resource-name is the only mandatory element.

<!ELEMENT web-resource-collection (web-resource-name, description?,
url-pattern*, http-method*)>
-Srini
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The specs says that url-pattern can be 0 or more.
So it is not mandatory..But i dunno how we can use web-resource-collection element without giving a url-pattern or http-method.I mean what is the use...?
Manjunath
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As if I were not frustrated enough.........This is another example of how the SPES are written or maybe How Tomcat understood the specs....
Okay re the answer your qstn, no the url-pattern is not mandatory.
How do I know, I removed the "url-pattern" from my example and verified it. So far so good.
What made me is the this fact:
If you don't specify a "http-method" (another sub-element of "web-resource-collection") the security-constraint applies on ALL HTTP methods.
BUT

If you don't specify a url-pattern the security-constraint DOESN'T APPLY ON ANY resources.
(Atleast on my Tomcat, I would appreciate if someone could re-confirm).
Wouldn't it be consistent if it applied on ALL resources when you don't specify the url-pattern.
or maybe I am a weird guy.........
- satya
 
Raj Kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Srini, Manjunath and Madhav Though things are not consistent, once we raise a topic here, the entire discussion gets stamped in memory. Now I am sure, I wont miss this q.. even though its weird!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic