How Struts internally works?
For Example if we type the URL "/login.do" how the process
goes internaly? How the struts-config.xml loaded?



How Struts internally works? For Example if we type the URL "/login.do" how the process ..

Answer / narendra kakumanu

Struts-Flow:-

* Whenever we deploy the application into the server it reads the web.xml file and finds the load on startup for action servlet the action servlet object will be created and init method will be invoked.

* struts-config.xml is one of the init parameter of the action servlet so it will read the struts-config.xml at the time of deployment because of load on startup.
* now everything is loaded and ready to serve.

* whenever user sends a request it goes to the web.xml file checks the url-pattern and it matched it will take servlet dummy name and checks with the servlet name and it will invoke action servlet object.

* srtuts-config.xml is one of the init parameter of the action servlet it will delegate the same request to the struts-config.xml.

* In struts-config.xml file it will check the action tag path attribute it will matched take the action name and check with the respective form bean name and creates the form bean object and all the requested parameters are populated into the form bean object.

* Controller come back to the action tag and check the validate attribute either true or false by default it is true if it is true it will perform the validation on the form bean object.

* validate method return type is action errors .

* if validations are true it will return null so that time it will create action class object and invoke the execute method.

* if validations are failed it will return action errors to respective page which is configured in input attribute.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Struts Interview Questions

What is the use of interceptor?

0 Answers  


Can we write Structs application without using Action Class directly or indirectly(extends Action class)

5 Answers  


Whats the difference between the default namespace and the root namespace?

0 Answers  


i have 500 jsps in my application,and i have same forward name for each jsp,so it lokks in strutsconfig.xml,from 1 to 500,but i want send 498 page directly,how can i cingigure my application

2 Answers   TCS,


What are different Struts2 tags? How can we use them?

0 Answers  






What is Request Dispatcher and What is reuest Processor??

2 Answers  


What is the purpose of '@keyproperty'?

0 Answers  


Explain how to work with error tags?

0 Answers  


How can I make own ActionServlet? with example

8 Answers   IBM, TCS,


what is the disadvantages of using DynaActionForm in struts framework?

5 Answers   HCL,


Hi frnds iam new to struts wen iam running helloworld application using struts iam getting the error as belwo kindly any one can solve it plzz .....thanks in advance......... Nov 18, 2009 9:27:46 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:StrutsExample1' did not find a matching property. Nov 18, 2009 9:27:46 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Struts1' did not find a matching property. Nov 18, 2009 9:27:46 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\sys tem32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOW S\System32\Wbem;C:\Program Files\Java\jdk1.5.0_18\bin; Nov 18, 2009 9:27:46 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8081 Nov 18, 2009 9:27:46 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 678 ms Nov 18, 2009 9:27:46 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 18, 2009 9:27:46 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.20 Nov 18, 2009 9:27:46 PM org.apache.catalina.core.ApplicationContext log INFO: Marking servlet action as unavailable Nov 18, 2009 9:27:46 PM org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@ca2dce org.apache.struts.action.ActionServlet java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1233) at org.apache.catalina.core.StandardWrapper.loadServlet(Standar dWrapper.java:1095) at org.apache.catalina.core.StandardWrapper.load(StandardWrappe r.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(Stand ardContext.java:4149) at org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4458) at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.jav a:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443) at org.apache.catalina.core.StandardService.start(StandardServi ce.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer .java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583 ) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2 88) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3) Nov 18, 2009 9:27:46 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /Struts1 threw load() exception java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(Webap pClassLoader.java:1233) at org.apache.catalina.core.StandardWrapper.loadServlet(Standar dWrapper.java:1095) at org.apache.catalina.core.StandardWrapper.load(StandardWrappe r.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(Stand ardContext.java:4149) at org.apache.catalina.core.StandardContext.start(StandardConte xt.java:4458) at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.jav a:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.j ava:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine .java:443) at org.apache.catalina.core.StandardService.start(StandardServi ce.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer .java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583 ) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:2 88) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:41 3) Nov 18, 2009 9:27:46 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8081 Nov 18, 2009 9:27:46 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Nov 18, 2009 9:27:46 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/31 config=null Nov 18, 2009 9:27:46 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 616 ms

2 Answers  


How an actionform bean is created?

0 Answers  


Categories