ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Struts
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1728)
 Advanced Java interview questions  Advanced Java Interview Questions (332)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (147)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
1.when actionservelet execute.
2.when web.xml executes
 Question Submitted By :: Struts
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
--------
1)The "web.xml" comes into the the picture when the
respective server is started. When the time of server is
starting the container will check the syntax and parse
the "web.xml" file.
2)The "web.xml" file is called as a deployment descripta
because it tells the server just what the application
contains that's it beyond of that it's doesn't do any thing.

ActionServlet:
--------------
1)ActionServlet is a predefined Servlet class which comes
along with struts framework.
2)When we implemented a struts based web application then
every request and response must go through the controller
(ActionServlet).
3)We can define our own ActionServlet class insted of using
the predefined ActionServlt class but in most of all cases
we will use only the predefined ActionServlet class.
4)We should configure the ActionServlet class in
the "web.xml" file like as followed

Example:
--------
<web-app>
<servlet>
<servlet-name>as</servlet-name>
<servlet-
class>org.apache.struts.action.ActionServlet</servlet-class>

<load-on-startup>1</load-on-startup>

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-
config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>as</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>

5)If we specified "<load-on-startup>" then
the "ActionServlet" class will load,instantiated and
initilized when the server or application started.
6)If we didn't specify "<load-on-startup>" then
the "ActionServlet" class will load,instantiated and
initialized when the first request comes.
 
Is This Answer Correct ?    21 Yes 0 No
Shaik Baji
 
Answer
# 2
at container startup, container reads the web.xml using sax
perser

in web.xml,we are configuring ActionServlet with load on
start up tag ,then ActionServlet will loaded,
<servlet-name>as</servlet-name>
<servlet-
class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>1</load-on-startup>
 
Is This Answer Correct ?    0 Yes 0 No
Srikanth
 
 
 
Answer
# 3
web.xml will execute during the deployemnt / server start
up as the Action servlet instance been called from web.xml
the call will be secondary where the webxml precedes it
 
Is This Answer Correct ?    0 Yes 4 No
Ravikiran
 

 
 
 
Other Struts Interview Questions
 
  Question Asked @ Answers
 
Can explain about the validations and in your project where did u used the validations? NIIT 4
what are the componenets of struts? HCL 8
How Struts will follow the MVC? HCL 6
diffrence between dispatch action and lookupdispatch action write simple web appliction (insert records in database) TCS 8
what is the disadvantage of struts frame work?   11
project architechture in java IBM 3
what is difference between <bean:write> and <bean: message> tag CTS 2
What is the use of ActionErrors in Struts   1
if u r using eclipse tool how can u debbaging u r application? plz explain with sample code Tech-Mahindra 3
Is form beans are serializable or not? Magna-Infotech 11
What is MVC Architecture? HCL 21
why we are using vo,dao and dto design patterns in struts framework Wipro 2
 
For more Struts Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com