Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions Network Architect Interview Questions

Top 15 Struts Interview Questions for 2022

1) What are the Features of Struts 2?

Features of Struts 2 are:
  • Configurable MVC components
  • POJO based actions
  • AJAX support
  • Integration support
  • Various Result Types
  • Various Tag support
  • Theme and Template support

2) What are the default interceptors of Struts 2?

Default interceptors of Struts 2 are:
alias clearSession store annotationWorkflow staticParams
autowiring externalRef i18n sessionAutowiring timer
chain execAndWait debugging servletConfig token
checkbox exception multiselect scope roles
cookie fileUpload workflow modelDriven params
conversionError jsonValidation validation scopedModelDriven prepare
createSession logger tokenSession actionMappingParams profiling

3) What are the methods of ValueStack interface in Struts 2?

Methods of ValueStack interface are:
  • public String findString(String expr)
  • public Object findValue(String expr)
  • public Object findValue(String expr, Class c)
  • public Object peek()
  • public Object pop()
  • public void push(Object o)
  • public void set(String key, Object value)
  • public int size()

4) What are the methods of ActionInvocation interface in Struts 2?

Methods of ActionInvocation interface are:
  • public ActionContext getInvocationContext()
  • public ActionProxy getProxy()
  • public ValueStack getStack()
  • public Action getAction()
  • public void invoke()
  • public Result getResult()

5) What are the Constants of Action Interface in Struts 2?

The Constants of Action Interface are:
  • SUCCESS
  • ERROR
  • LOGIN
  • INPUT
  • NONE

6) What are the types of Bundled validators in Struts 2?

Types of bundled validators are:
  • requiredstring validator
  • stringlength validator
  • email validator
  • date validator
  • int validator
  • double validator
  • url validator
  • regex validator

7) What are different ways to create Action classes in Struts2?

There are Three ways to create Action class are:
  • We can create Action class by implementing Action interface
  • We can create Action class using Struts2 @Action annotation
  • We can create Action class by extending ActionSupport class

8) Name some useful annotations introduced in Struts2?

Useful annotations introduced in Struts2 are:
  • @Action
  • @Actions
  • @Namespace and @Namespaces
  • @Result
  • @ResultPath

9) What are the life cycle methods of interceptor?

Life cycle methods of interceptor are:
  • public void init()
  • public void destroy()
  • public void intercept(ActionInvocation ai)

10) What are the Aware interfaces in Struts2?

There are four Aware interfaces in Struts2 are:
  • SessionAware
  • ServletContextAware
  • ServletRequestAware
  • ServletResponseAware

11) What is OGNL?

It is an Expression language, It provides the accessibility feature for data stored in the ActionContext and stands for Object Graph Navigation Language.

12) What is the use of jsonValidation?

It is an interceptor which is used to perform asynchronous validation and it works with workflow and validation interceptors.

13) What is ActionInvocation?

It is responsible to invoke action and it holds the action and interceptor objects.

14) How to create input page(index.jsp) in Struts2 application?

Example of input page:
<%@ taglib uri="/struts-tags" prefix="s" %>    
<s:form action="book">    
<s:textfield name="id" label=" Id"></s:textfield>    
<s:textfield name="name" label="Book Name"></s:textfield>    
<s:textfield name="price" label="Book Price"></s:textfield>    
<s:submit value="save"></s:submit>    
</s:form>

15) What are the parameters of stringlength validator?

Parameters of stringlength validator are:
  • trim
  • minLength
  • maxLength
  • fieldName