vikram


{ City } hyderabad
< Country > india
* Profession * team lead
User No # 57113
Total Questions Posted # 0
Total Answers Posted # 4

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 70
Users Marked my Answers as Wrong # 7
Questions / { vikram }
Questions Answers Category Views Company eMail




Answers / { vikram }

Question { TCS, 24691 }

who will run the execute method in struts?


Answer

protected ActionForward
processActionPerform(request,response,action,form,mapping)
throws IOException, ServletException {
try {
return (action.execute(mapping, form, request,
response));
} catch (Exception e) {
return (processException(request, response, e,
form, mapping));
}
}

this is the logic used in RequestProcessor class to call the
execute() method through ActionServlet. B'coz ActionServlet
is the front controller class and in this class only we are
calling RequestProcessor class. So ActionSerlvet is calling
execute() method through RequestProcessor class.

Thankyou.

Is This Answer Correct ?    6 Yes 0 No

Question { iGate, 64448 }

life cycle of struts?


Answer

When any struts based web application loaded into server
initially it will load the ActionServlet class, due to
tag in web.xml. After instantiation it
will read struts-config.xml file, due to tag in
web.xml. When anybody makes request to the respective web
application it will display the file which is mentioned in
tag of web.xml file. When the view
page(.jsp) is displayed to the user internally the struts
framework (ActionServlet) will create an object for the form
bean class (which extends the ActionForm by calling zero
argument constructor(default construtor)) which is mapped
with the Action class path mentioned in .jsp file action="/path"> b'coz ActionServlet already read the
information mentioned in struts-config.xml file. later it
will call the reset() and all the getter methods of the form
bean class. when the user fills the form and submit the
input, our form bean class again calls the default
constructor, reset(), all setter() methods, validate()
methods respectively. Validate method return ActionErrors
object. If the ActionErrors object contains any error
values(ActionError/ActionMessage values) then the
ActionServlet calls the input page mapped with respective
action class( display to the user with error messages. If ActionErrors
object is null(doesn't contains any ActionError/
ActionMessage) then the ActionServlet calls the execute()
method of the Action class which is bind with input request
( execute() method will return ActionForward object. Depend on
the value, again the ActionServlet will call the respective
view(.jps page) as response and send it back to user. For
processing all the above steps ActionServlet will take the
help with RequestProcessor class. In this way one request
will be processed by the struts framework. And ActionServlet
will act as a front controllet for the application.

Is This Answer Correct ?    27 Yes 5 No


Question { 7536 }

JVM is platform independent or depeneded?


Answer

According to java all the class files contains only
bytecode. when we are trying to run the class files we need
jvm. so jvm is dependent on os. B'coz these byte code will
convert/translate into machine level code, where OS is able
to understand that language. So depending on the OS, we have
to use the supported JVM.

Is This Answer Correct ?    7 Yes 0 No

Question { HCL, 7819 }

What are the types of classes in java?


Answer

basically in java we have 2 types of classes. those are user
defined classes and pre defined classes. in both we can
differentiate the classes in 3 ways. those are interfaces,
abstract classes and concrete classes. Where we can't create
the objects for the abstract class and interfaces. by using
inheritance concept we can able to create the object of the
for the derived classes and assign those objects to the base
class references(according to OOP concept).

Thank you.

Is This Answer Correct ?    30 Yes 2 No