|
INTERVIEW QUESTIONS
J2EE
STRUTS
DETAILS
Question: Why do we override the execute method is struts? Plz give me the details?
Answer: As part of Struts FrameWork we can decvelop the Action Servlet,ActionForm servlets(here ActionServlet means which class extends the Action class is called ActionServlet and ActionFome means which calss extends the ActionForm calss is called the Action Form servlet)and other servlets classes.<br><br>In case of ActionForm class we can develop the validate().this method will return the ActionErrors object.In this method we can write the validation code.If this method return null or ActionErrors with size=0,the webcontainer will call the execute() as part of the Action class.if it returns size > 0 it willnot be call the execute().it will execute the jsp,servlet or html file as value for the input attribute as part of the <action -mapping> attribute in struts-config.xml file.<br><br>In case of Action class the execute() method retuen the ActionForward object.in execute() we can write (return mapping.findForward("success");)here mapping is the object for the ActionMapping class.After that it will forward the request to the "success" jsp file.(here success is context path for the jsp file,it is written in web.xml. <br>
|
|
|
Category |
Struts Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 7347 users |
Added on |
7/27/2011 |
Views |
73624 |
Rate it! |
|
|
Question:
Why do we override the execute method is struts? Plz give me the details?
Answer:
As part of Struts FrameWork we can decvelop the Action Servlet,ActionForm servlets(here ActionServlet means which class extends the Action class is called ActionServlet and ActionFome means which calss extends the ActionForm calss is called the Action Form servlet)and other servlets classes.<br><br>In case of ActionForm class we can develop the validate().this method will return the ActionErrors object.In this method we can write the validation code.If this method return null or ActionErrors with size=0,the webcontainer will call the execute() as part of the Action class.if it returns size > 0 it willnot be call the execute().it will execute the jsp,servlet or html file as value for the input attribute as part of the <action -mapping> attribute in struts-config.xml file.<br><br>In case of Action class the execute() method retuen the ActionForward object.in execute() we can write (return mapping.findForward("success");)here mapping is the object for the ActionMapping class.After that it will forward the request to the "success" jsp file.(here success is context path for the jsp file,it is written in web.xml. <br> Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is Action Class. What are the methods in Action class
|
View Answer
|
|
What are the core classes of struts?
|
View Answer
|
|
What is the difference between Struts 1.0 and Struts 1.1
|
View Answer
|
|
What are the Important Components of Struts?
|
View Answer
|
|
What part of MVC does Struts represent
|
View Answer
|
|
How you will save the data across different pages for a particular client request usingStruts
|
View Answer
|
|
Is there any way to put my custom name to LIB folder which i am going to place in WEB-INF folder of struts application?
|
View Answer
|
|
Can i use bc4j with spring framwork
|
View Answer
|
|
Does Struts provide support for Validator & Tiles by default ?
|
View Answer
|
|
In struts, if any changes are made to before the request reaches to actionservlet, where you do the changes?
|
View Answer
|
|
In struts what happens if made any changes in actionservlet?
|
View Answer
|
|
In struts why we use jsp as presentation layer? can we use servlet as presentation layer?
|
View Answer
|
|
In struts how can i validate the values filled into the text boxes or else using DynaValidatorForm,without using javascript. Actually with javascript it is working perfect but not without javascript, and i want without javascript?
|
View Answer
|
|
What is the use of ActionForm class, Describe it's Life Cycle
|
View Answer
|
|
What is the difference between strsuts 1.0 and struts 1.1 ?
|
View Answer
|
|
How can we work struts on Eclipse? What is the best plugin for this?
|
View Answer
|
|
What are the drawbacks of Struts
|
View Answer
|
|
What is the difference between a normal servlet and action servlet?
|
View Answer
|
|
What is Struts?
|
View Answer
|
|
What is the difference between Struts 1.0 and Struts 1.1?
|
View Answer
|