Recently I have wrote a lot of Struts2 Tutorials and in this post, I am listing down some of the important Struts2 interview questions with answers to help you in. Dear readers, these Struts2 Interview Questions have been designed especially Struts2 is not just the next version of Struts 1, but it is a complete rewrite of the. Searching for Apache Struts 2 job? Need interview questions to prepare well for the job interview. Then you are at the right place. Apache Struts 2 jobs are.
|Language:||English, Indonesian, Arabic|
|Genre:||Business & Career|
|ePub File Size:||29.42 MB|
|PDF File Size:||12.17 MB|
|Distribution:||Free* [*Registration needed]|
struts2 frequently asked interview questions,Know all strust2 interview questions asked in interviews on interceptors,struts2 framework. Struts 2 interview questions and answers. Let us discuss struts 2 interview questions and answers for freshers & experienced. What is MVC? MVC stands for Model-View-Controller design pattern which separates the business logic, presentation logic and navigation logic. Where.
Answer : This annotation sets the KeyProperty for type conversion. The KeyProperty annotation must be applied at field or method level. Answer : This annotation annotation is used for class and application wide conversion rules.
The TypeConversion annotation can be applied at property and method level. What Are Struts2 Core Components?
Answer : Struts2 core components are: A. Action Classes B.
Interceptors C. Question Answer : com. I18nInterceptor interceptor is responsible for i18n support in Struts2 applications.
Answer : We can implement Action interface to create our action classes. This interface has a single method execute that we need to implement. ActionSupport class is the default implementation of Action interface and it also implements interfaces related to Validation and i18n support. The core components of Struts2 are Action, Interceptors and Result pages.
Struts2 provides many ways to create Action classes and configure them via struts. We can create our own interceptors for common tasks. Struts2 comes with a lot of tags and uses OGNL expression language. We can create our own type converters to render result pages. Interceptors are the backbone of Struts2 Framework.
Struts 2 Interview Questions
Struts2 interceptors are responsible for most of the processing done by the framework, such as passing request params to action classes, making Servlet API request, response, session available to Action classes, validation, i18n support, etc. ActionInvocation is responsible to incapsulate Action classes and interceptors and to fire them in order.
The most important method for use in ActionInvocation is invoke method that keeps track of the interceptor chain and invokes the next interceptor or action. Struts2 interceptors are based on intercepting filters design pattern.
The invocation of interceptors in interceptor stack closely resembles Chain of Responsibility design pattern. Struts2 Action classes are thread safe because an object is instantiated for every request to handle it. ActionInvocation is responsible to encapsulate Action classes and interceptors and to fire them in order.
Earlier versions of Struts2 uses org.
Apache Struts 2 Related Tutorials
FilterDispatcher as Front Controller class. A ValueStack is a place where all the data related to action and the action itself is stored.
The role of Action are to execute business logic or delegate call to business logic by the means of action methods which is mapped to request and contains business data to be used by the view layer by means of setters and getters inside the Action class and finally helps the framework decide which result to render.
ValueStack is the storage area where the application data is stored by Struts2 for processing the client requests. The data is stored in ActionContext objects that use ThreadLocal to have values specific to the particular request thread.
As you can see in architecture diagram, both interceptors and result pages can access data stored on ValueStack using OGNL. Struts2 namespace configuration allows us to create modules easily.
We can use namespace to separate our action classes based on their functionality, for example admin, user, customer etc.
Which interceptor is responsible for mapping request parameters to action class Java Bean properties? ParametersInterceptor interceptor is responsible for mapping request parameters to the Action class java bean properties.
This interceptor is part of basicStack and defaultStack interceptors stack. I18nInterceptor interceptor is responsible for i18n support in Struts2 applications. What is the difference in using Action interface and ActionSupport class for our action classes, which one you would prefer?
Struts 2 Multiple Choice Questions and Answers
We can implement Action interface to create our action classes. This interface has a single method execute that we need to implement. ActionSupport class is the default implementation of Action interface and it also implements interfaces related to Validation and i18n support.
We can override validate method of ActionSupport class to include field level validation login in our action classes. Depending on the requirements, we can use any of the approaches to create struts 2 action classes, my favorite is ActionSupport class because it helps in writing validation and i18n logic easily in action classes.
However sometimes we need these access in action classes such as checking HTTP method or setting cookies in response.
Posted in Uncategorized. You are commenting using your WordPress. You are commenting using your Google account.
You are commenting using your Twitter account. You are commenting using your Facebook account. Notify me of new comments via email. This site uses Akismet to reduce spam. Learn how your comment data is processed.
Posted by: What is Struts2? What is interceptor in Struts2?In absence of which the framework gets initialized only as the first request hits. Vicky Ram October 11, at 9: Ways of performing validations in struts 2. What are different Struts2 tags?
Can you provide an example configuration of an interceptor in Struts 2? OGNL in struts 2. Then this request processor calls its process method.
It can be like student. Which interceptor is responsible for setting action's JavaBean properties?
- SSC JE PREVIOUS YEAR QUESTION PAPERS PDF CIVIL
- MAINFRAME INTERVIEW QUESTIONS PDF
- OSHA RESPIRATOR MEDICAL EVALUATION QUESTIONNAIRE PDF
- INTERVIEW MASTER GUIDE JEFF AND MIKE PDF
- TESTING TOOLS INTERVIEW QUESTIONS AND ANSWERS FOR FRESHERS PDF
- CTET QUESTION PAPER 2011 HINDI PDF
- CODING INTERVIEW QUESTIONS PDF
- RAPID DEVELOPMENT BY STEVE MCCONNELL EBOOK