tell me struts flow ?
Answers were Sorted based on User's Feedback
Answer / mukesh
Above answer is correct but more clear is
supose we having Http:/myhost/authorize.do
1. server configure to pass *.do extension to
org.apache.struts.action.ActionServlet via web.xml
2. Action servlet object inspect the uri and try to
match against ActionMapping located in
struts-configuration.xml
3. if intance of appropriate action found it call
perform() .
4. action object handle request and returns next view..
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / a.v.satyanarayana
Struts follows mvc pattern.
Model ; which is represented as bussiness components.
View: at view level we have JSP's
Controler: Actionservlet given by the frame work.
This frame work mainly depends upon two xml files.
1) is web.xml where we are moniteriong the controlerpart.
2) struts.config.xml where action classes are congured.
when a request is submitted, this request is handelled by
the controller.And the actionservlet internally checks into
the struts config.xml and identifies the coresponding
action class.
Instantiate that action class and execute the bussiness
logic in that action class and forwards the request to the
required JSP.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ram-sd softech
1. When we start a web application based on struts the web
container creates a
servlet object based on
2. The web container creates the request and response
objects.
3. The web container calls the service method of Action
Servlet by passing the request and the response objects.
4. The Code of Action Servlet checks the struts-
config.xml with path /action at action mappings tag we
discussed how is that as earlier (page-8). Now if it is
there then it creates the ActionOne Object then after it
calls the execute method of ActionOne class.
5. After that it forwards to jsp.If any problem eraises
it shows Exception.
6. After that the Web container will start the execution
of .jsp as we discussed in JSP’s.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / venu
When a client makes a request ,The request goes to the
action servlet as we configured in web.xml (for every
request
*.do----->org.apache.struts.action.ActionServlet.).then
action servlet will read struts-config.xml file and it wil
create module config object and then give it(Module config
obkect) to RequestDispatcher(by calling process() method in
request dispatcher .I mean deligating the request to RD by
doing this.Process method is designed as Chain of
responsability design pattern).After deligating the request
to RD by AS ,AS will not do any thing .from here onwards
Request Dispatcher wil take careof every thing like process
the reuest and send the response.RequestDispacher wil check
whether formbean object existed for this form ,if it is
existed it wil reset the form bean by calling reset()
method of form bean.reset() will reset the new values in the
formbean object.I mean in the form bean object is initiating
with the null values when it is created(it creates when
client makes a request itself).then RD wil check whether the
validate attribute is true or not .if it is true then it
does the validation by calling the method validate().This
method wil return
ActionErrors object.After executing the validate method RD
wil check whether the ActionError object is null or not.If
it is not null,then it wil forward the request to Error.jsp
as we configured in struts-config.if it is null, then it wil
cal the its respective action class as we configured in
struct-config.xml and then action class wil cal bussiness
class method .bussiness class method wil cal the DataAccess
layer class method .The response send it to bussiness class
method.bussinesss class method wil send the response to
action class.action class method wil return the response to
RD.then RD send the response to Success.jsp.
Is This Answer Correct ? | 0 Yes | 0 No |
Why is it called struts?
what is the difference between *.do & /do.*/? So what is the diffenence btn extension mapping & path mapping.What is those difference in work effect?
How does struts work?
What are pull and push mvc architecture and which architecture does struts2 follow?
How can forward action be used to restrict a strut application to mvc?
Can we handle exceptions in Struts programmatically?
what is struts? why Struts?
What is defeult result type?
what is use of assert keyword in java..?
What is the forward action utilized for?
What is the difference between Jakarta Struts and Apache Struts? Which one is better to use?
How do struts work?