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 Whizlab Parctice Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Whizlab Parctice Questions" Watch "Whizlab Parctice Questions" New topic

Whizlab Parctice Questions

Milan Sutaria
Ranch Hand

Joined: Jul 10, 2008
Posts: 122
1. In a web application, is it better to handle security Declaratively or Programmatically?
I feel the generic answer should be Declaratively. However, as the question mentions specifically about security, I would answer programmatically. Setting the securities using the annotations makes sure they are not altered easily(unless a new jar is built and deployed).
Whizlabs says Declaratively. What is your opinion?

2. How many HTTP methods are there?
Whizlabs says 7. In my opinion answer is 9[ GET, POST, PUT, DELETE, TRACE, OPTIONS, HEAD, CONNECT, PATCH ]. What do you think?

SCJP 6 83%
Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 372

For your first question , I think you are thinking too deep.

Isn`t it will be great to handle security programmaticaly rather than coding your security logic into servlet code.

And for your second question , the question is asking about doXXX() methods , not the methods that you can request to web server.
In HttpServlet (abstract class) we have doDelete() , doOptions() , doGet() , doPut() , doPost() , doTrace() ,doHead() .
so only 7 methods . , Oracle Java Programmer , Oracle SQL Expert , Oracle Java Web Component Developer
Milan Sutaria
Ranch Hand

Joined: Jul 10, 2008
Posts: 122
Thanks Mahtab. That helps.
Joan Breton

Joined: Nov 05, 2011
Posts: 9


For the first question : Declaratively is the best option. Is more ease to change a XML than to be modifing, compiling, packing, etc. your clases every time you make a modification.

For the last : the PATCH method is invalid.

Good look.

At the moment OCJP, OCPJWCD.
I agree. Here's the link:
subject: Whizlab Parctice Questions
It's not a secret anymore!