Sunteți pe pagina 1din 2

Flow Chart for Servlet execution

Start the Server

Restart the server


Started
No

Yes

Checks for web.xml associated with each project that is being


deployed.

Will not load the Servlets and displays


Found
No error page for that application.

Yes

Instantiate all the servlets and stores them as a key value pair
in memory with URL as key and value as object.

User enters a URL

Container matches the entered URL with


the URL patterns stored in its memory.

No
Found An error page is displayed with
status 400.
Yes

Will execute the service method of the servlet (extends


HTTPServlet) which matches with the URL pattern.
Flow chart for Struts Execution
Start the Server

Restart the server


Started
No

Yes

Checks for web.xml associated with each project that is being


deployed.

Will not load the Servlets and displays


Found
No error page for that application.

Yes

Instantiate the ActionServlet. There could be two types of mapping found here.
/do/* ex: http://localhost:8080/brainwash/do/logon
*.do ex: http://localhost:8080/brainwash/logon.do

Now, the container looks into struts-config.xml and instantiates all the Action classes.
It stores them in its memory in the form of Key-Value pair. Where URL is the key and Value
is the matching class object.
Form beans are created and destroyed as and when needed.

User enters a URL

Depending on what user is trying to perform, it either loads a form bean or if any action
class has to be loaded, it will check into its key-value map and executes the matching
object.

S-ar putea să vă placă și