Struts”Hello World” (II)
8 January 2008This post is a continuation of Struts”Hello World” (I). Here I will explain the code that is written in the first part.
Lets see how the code works.
Your browser sends to the web server a request for the URL.
1. The container receives from the web server a request for the resource HelloWorld.action. According to the settings loaded from the web.xml, the container finds that all requests are being routed to org.apache.struts2.dispatcher.FilterDispatcher, including the *.action requests. The FilterDispatcher is the entry point into the framework.
2. The framework looks for an action mapping named “HelloWorld”, and it finds that this mapping corresponds to the class “HelloWorld”. The framework instantiates the Action and calls the Action’s execute method.
3. The execute method sets the message and returns SUCCESS. The framework checks the action mapping to see what page to load if SUCCESS is returned. The framework tells the container to render as the response to the request, the resource HelloWorld.jsp.
4. As the page HelloWorld.jsp is being processed, the
5. A pure HMTL response is sent back to the browser.
I hope this helps.
Related Posts:
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Struts”Hello World” (II)