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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Patterns question" Watch "Patterns question" New topic

Patterns question

Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Mock question from HFSJ final mock exam:

You are considering implementing some variety of MVC in your Java EE n-tier application. Which are true?

Among the answers given correct is this one:
Both the Front Controller Pattern and Struts could be considered solution for this design goal.

I found this pretty confusing. How can one pattern (FC) be considered a solution for another pattern(MVC). Should this answer be marked correct?

"A problem well stated is a problem half solved.” - Charles F. Kettering
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

The Front Controller is part of the MVC. It is the main controller which receives all request and dispatches them to the correct controller. For example, the DispatcherServlet in SpringMVC is the front controller.

[My Blog]
All roads lead to JavaRanch
Javin Paul
Ranch Hand

Joined: Oct 15, 2010
Posts: 295

Struts is also based on Front Controller pattern where ActionServlet acts as Controller and dispatches request based on URL mapping defined in struts-config.xml

SQL Query Interview Question java67 Javarevisited
Dieter Quickfend

Joined: Aug 06, 2010
Posts: 543

I guess it would be valid, as having a class that can be reliably called a "Controller" implies that there is also a View and a Model, which renders any project with a Front Controller doing what it's supposed to do, automatically MVC, more or less.

Oracle Certified Professional: Java SE 6 Programmer && Oracle Certified Expert: (JEE 6 Web Component Developer && JEE 6 EJB Developer)
I agree. Here's the link:
subject: Patterns question
It's not a secret anymore!