File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes http-method and authorization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "http-method and authorization" Watch "http-method and authorization" New topic

http-method and authorization

stephen dimitrov

Joined: Feb 28, 2005
Posts: 16
I'm reading Head First Servlets and JSP and I'm confused about security. On page 634 it discusses using <http-method> in the DD. According to the errata, the following should be true:

" If there are NO <http-method> elements, in the <web-resource-collection>, it would mean that ALL HTTP Methods are allowed."

However, this contradicts what's mentioned on 635, which says:

"If you do NOT specify any <http-method>, then you're constraining all HTTP methods."

So, which one is it?

chowdary Thammineedi
Ranch Hand

Joined: Aug 16, 2004
Posts: 126
Hello Stephen

There was a nice discussion on this topic about a month ago on this forum.
But I still remeber the FINAL WORD of that discussion.

The web-resource-collectionType is used to identify a subset
of the resources and HTTP methods on those resources within
a web application to which a security constraint applies. If
no HTTP methods are specified, then the security constraint
applies to all HTTP methods.

This quote is from the page 133 of the servlet 2.4 specification. Under the Deployment Descriptor bokkmark.

CONCLUSION: If you do not specify any <http-method> then all methods are constrained.

The original discussion is over here

Hope this helps
Kejal Shah
Ranch Hand

Joined: Jun 27, 2003
Posts: 87
Hey Stephen,
where's the errata for the book?

Kejal<br />
stephen dimitrov

Joined: Feb 28, 2005
Posts: 16
Thanks for the quick answer. As for the errata -
I agree. Here's the link:
subject: http-method and authorization
It's not a secret anymore!