Difference between JSF Framework and Struts Framework.
Answers were Sorted based on User's Feedback
Answer / anup
JSF - Component centric; Struts - Bean centric.
JSF - Deffered expresson; Struts - Immediate expression.
JSF - Event driven; Struts - Model driven.
JSF - Value binding; Struts - Bean binding
JSF - Spec by JCP and several implementations including
SUN's; Struts - Apache.
| Is This Answer Correct ? | 56 Yes | 4 No |
Answer / bhoopesh alladi
Both these Frameworks are used for forcing the
implementation of MVC-2 pattern.
Struts Framework is implemented by apache, where as JSF
is implemented by Sun Microsystems.
| Is This Answer Correct ? | 87 Yes | 36 No |
Answer / meera tolia
Struts is JSP and Tag centric and with a fixed dependecy on
being deployed in a conventional Servlet HTTP request /
response environment.
JSF is somewhat more generic. It is component centric and
has no specific dependency on HTML markup / tags apart from
the fact that the renders for most components are tailored
for conventional browser output via HTML.
| Is This Answer Correct ? | 59 Yes | 13 No |
Answer / krishna
The main difference is the UIComponent of JSF. Developers
can define their own components and also the way it should
be rendered. A component having a particular behavious can
be rendered in different ways.
Eg: UISelectOne. This components behaviour is to select one
value, but can be rendered as a List, Menu or Radio.
More we can develop RenderKit's appropriate to the client,
ie html, wml, etc. So a single JSF application can be used,
and using different renderers can be rendered to different
clients...
| Is This Answer Correct ? | 22 Yes | 4 No |
Answer / ravi
Jsf is component based frame work which concentrates on
UIComponents look and feel(view layer) where as struts
concentrates more on the controller part not on the
userinterface but both follow model-2 architecture
| Is This Answer Correct ? | 11 Yes | 4 No |
Answer / kollu sreenivasa rao
Configuration wise both are same and supports the
internalization. JSF is more developer friendly why because
to validate mandatory filed in JSF we can specify attribute
like require is true and we can use mandatory filed id in
message tag. But in struts we have to include
validation-rules.xml in struts-config.xml and form has to be
specified in validation-rules.xml.
Even for condition statement in JSF is better than struts.
No need to overwrite any method like execute in JSF.
navigation is very easy in JSF.
| Is This Answer Correct ? | 10 Yes | 3 No |
Answer / sujeev kr singh
Struts is a "Component" Framework, whereas Struts is
an "action" Framework.
JSF using Navigationcase and NavigationRules instead of
Actionmapping and action which is in Struts.
Struts framework give you the ability to map URLs to
activities and code on the back end, whereas JSF rendered
on the page are initially developed as individual
components, much like in modern GUI.
| Is This Answer Correct ? | 13 Yes | 7 No |
Answer / shaik baji
Struts is the best for designing the Controller components
because at the time of struts designing the developers of
struts more consentrated on Controller layer.
Struts provides alist of tag libraries to handles the beans
and resources bundels where as JSF doesn't.
JSF is the best for desiging the View components and JSF
provides evenhandling mechanism where as struts doesn't.
In most of designing GUI components we prefer the JSF due
to it's predefined components files.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / kiran
Both will implement mvc2 design pattern, struts given by
apache, jsf given by sun.
Struts didn't provide any use implementations but JSF we
can implement our own implementations like UI-components,
JSF provides the Converters also
| Is This Answer Correct ? | 16 Yes | 11 No |
Answer / sunilkumar kakollu
jsf is a component framework which concentrates on view
componets creation,binding and rendering where as struts is
a action frame work which concentrates on creating and
calling the action methods
| Is This Answer Correct ? | 7 Yes | 4 No |
How struts 2 validation works?
1.when actionservelet execute. 2.when web.xml executes
how many methods are there in RequestPrccesor class?
what are the componenets of struts?
What is the purpose of @key?
What is the purpose of @requiredstringvalidator annotation?
What is the forward action utilized for?
Why we use struts in java?
What is the use of jsonvalidation in struts?
how handle when client send multiple request at atime for single servlet
what is the purpose of load_on_startup entry in struts- config.xml?
1.Which of the following can be performed using interceptors by the developer? 1. Provide pre-processing logic before invoking the action 2. Interact with the action and set the request parameter on the action 3. Provide post-processing logic after invoking the action 4. Modify the result 1, 2, 3 2, 3, 4 1, 2, 4 1, 2, 3, 4 2.Interceptors can be used for which of the following tasks? 1. Checking security and bottleneck 2. Tracing the log 3. Validating user input 4. Uploading file 1, 2, 3 2, 3, 4 1, 2, 4 1, 2, 3, 4 3.The ValueStack is made up of which of the following objects? 1. Temporary Objects 2. Model Object 3. Action Object 4. Permanent Object 1, 2, 3 2, 3, 4 1, 2, 4 1, 2, 3, 4 4.Which of the following statements are correct? Apache Struts is a Java based framework that separates the application logic from the presentation layer. Action is based on pull-MVC framework which means that the data to be displayed is pulled from the action class which is a POJO class acting as a model in the Web application. OGNL is a powerful expression language that allows you to refer and manipulate the data present on the ValueStack. Declarative architecture enables you to integrate the different components present in the Web application either using XML files or Annotations. 5.Which of the following are the examples of helpers? 1. Action Interface 2. ActionSupport Class 3. ActionImplement Interface 1, 2 2, 3 1, 3 1, 2, 3 6.The Struts 2 filter performs which of the following tasks? 1. Installation of the Action class 2. Execution of the method specified in the configuration file 3. Reading of the control string 1, 2 2, 3 1, 3 1, 2, 3 7.Which of the following value for the debug parameter displays an OGNL console to test OGNL expressions against the value stack? xml console command All of the above. 8.Which of the following are correct statements? The execute () method of the action class defines business logic implementations. ActionSupport class adds useful utilities to the class that extends it. Set of Interceptors are grouped into a stack known as Interceptor Stack. All of the above. 9.Which of the following annotation helps to set the path of the action URL? It is placed before the action class and it applies to all actions defined in the class, even if the fully qualified URLs are not supplied. @Namespace @Result @Results @ParentPackage 10.Which of the following statements are correct related to OGNL and Annotations? OGNL is an expression and binding language that is used for getting and setting the properties of the Java objects. Annotations acts as an alternative to HTML and Java properties configuration file. Action Annotations are available when the framework scans the classpath for action classes. Lifecycle callback annotations are invoked at any time during the processing of an action. 11.Which of the following are the features of the new unified Expression Language? Deferred evaluation of expression Support expressions that can set values and invoke methods Provides a pluggable API for resolving expressions All of the above. 12.By introducing the new feature by JSF, improvements have been made in which of the following areas? Set of standard converter messages Addition of requiredMessage, converterMessage, and validatorMessage attribute for input components. Displaying the error message using the input component name with the help of label attribute added to the input components All of the above. 13.Which of the following statements are correct about the 'label' attribute? In JSF 2.1, the label attribute have been introduced with the input components. The label attribute can accept literal or value expressions. The Literal or value expressions accepted by label attribute is prefixed before the components error message. All of the above. 14.Which of the following statements are correct? EL allows developers to use simple expressions to dynamically access data from JavaBeans components. EL supports only deferred evaluation. A value expression can either yield a value or set a value and can be used for both read and write. In immediate evaluation, the expression is evaluated immediately. 15.Which of the following statements are correct? Method expression invokes as arbitrary private method of an arbitrary object by passing a specified set of parameters and returning results from the calling method. JSTL is a part of Java EE 5 platform. JSF 1.2 includes a set of messages for standard converters. The requiredMessage, converterMessage, or the validatorMessage attribute of the input components are used to provide custom error messages.