Here Is A Starting Point For Example: Web - XML .Do .Do .Do Actionservlet Struts-Config - XML Actionservlet
Here Is A Starting Point For Example: Web - XML .Do .Do .Do Actionservlet Struts-Config - XML Actionservlet
You
can find plenty on the web, especially for Struts 1. Here is a starting point for example.
But just for the sake of it, here is a high view presentation.
First you add the Struts ActionServlet into your web.xml file and you configure it to
accept requests that match a certain mapping. For Struts this is *.do (you can have
whatever you want for this, *.do is just a convention in the Struts community).
Now, whatever arrives on the server with such a *.do URL pattern is sent to
the ActionServlet.
Now, the content of struts-config.xml file comes into play. The ActionServlet is a front
controllerwhich just dispatches to other more appropriate resources for specific
processing. Those specific resources are the Action classes.
You can have for example a LoginAction that must process requests that arrive on
the login.dopath. In the struts-config.xml you specify this: everything that comes on
the login path must be sent to LoginAction class.
And you can have as many declarations as you want, for path x call XAction,
for y call YActionetc etc.
Normally your client submits data to the server, data that he inputs into a HTML form.
This data you need to process in your Action class. Now enter ActionForm.
The ActionForm is a bean that the Struts framework fills with the data from the HTML
form. Instead of doing request.getParameter("foo") you can work with objects
like formBean.getFoo() for example.
Once you do your processing in the Action class using the ActionForm, you then must
present the results in some view (by the way, Struts is a MVC framework so you must
know a stuff or two about this also).
The views are normally JSP files. When you return from your Actio