Download struts 1.2 plugin for eclipse
Struts reads the file struts-config. After that we have to create a form bean that will be sub class of ActionForm class which will act as model in out application and will contain application state. Following is our form bean named "HelloWorldForm". This form bean class contains single property named as "hello" which stores "Hello World" as default value.
Our next step is to create a controller class that will help to handle a particular url pattern. The url pattern will be specified and associated with our controller helper class in the file struts-config. Our controller helper class must be a subclass of "Action" class.
When the url will be requested to the server, struts will run "execute" method of the associated with the url and returns the view in response. The ActionForm object will contain instance of our form bean i. The execute method returns string "hello" as the ActionForward. All the configuration regarding the action will be made as in the file struts-config. Create struts-config.
We have registered our form bean com. HelloWorldForm with name "helloForm" and declared our controller class com. HelloWorldAction with the following attributes :. Now create jsp file index. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors at the end of the mirrors list that should be available.
You may also consult the complete list of mirrors. Apache Struts 2. It is available in a full distribution, or as separate library, source, example and documentation distributions. Struts 2. If you are looking for other versions than above please check the Apache Archive site.
Struts 1. Older versions of Struts are available from the Archive Site. First download the KEYS as well as the asc signature file for the particular distribution.
0コメント