• 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

Whizlab Parctice Questions

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 391
1
MySQL Database PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Milan Sutaria
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mahtab. That helps.
 
Greenhorn
Posts: 16
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi

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.
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic