• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubts from mock exam

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is the questions i found in mock test. http://www.podar.net/scwcd/

The correct answer according to this site is "B" i.e. Front Component. My doubt is why not MVC?


The correct answer according to this site is C.
Explanation According to this site:
Correct answer is that it gives compilation error as POST 405 not found
indicating that doPost method was found as specified in the form.html.
Changing method=post to method=get would make the program work fine
My Doubt: How correct is this answer? should we call such a situation compilation error?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prakash,
For Q1, from the book SCWCD Exam Study Kit, it mentions that Front Controller in fact is very similar to MVC, however, Front Controller focus on the workflow of the system, while MVC model II focus on the separation of the Model (Data), View (JSP display) and Controller (Servlet).
I guess that is the difference.
For Q2, it should be a runtime error, instead of compliation error, I think.
 
Ivan Matmati
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me, in no way is it a runtime or a compile time error.
Effectively, you get a 405 code but it's not like the servlet did not compile or a NullPointerException was thrown.It's just that the implementation by default send an error with 405 when no implementation of an http method is provided.
This code is an except of HttpServlet of servlet-api.jar made by jad with Tomcat 5.0.


There are often errors in mock exam written too fast as I've already said, be careful of what you learn!
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In question 2 ;
Error code alway happen (I'm not sure in error code) in browser and this method will happen " Http Post request not support" ....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic