Java Web Development Learning Summary

xiaoxiao2021-03-05  21

Recently, I have learned Java Web development due to work. The company's development architecture is a traditional multi-layer system. It is only the full separation of page script code and JSP code in the performance layer. The control layer uses ActionServlet / Actionform, business The logical layer and data persistence use Java Bean and DAO. At the same time, I would like to thank my colleagues to my guidance in my learning process, so that I have left many detours and less confused.

1. Tags that require dynamic display data to increase the ID attribute and modify the Name property of the element you need to submit to the Form, which is required to use the data when displaying data. Compile the static page to generate a Java file.

2. Write a method of implementing the DAO layer code to implement the business logic layer.

3. Write business logic layer code to implement specific business functions, generate interfaces and corresponding APIs.

4. Write an ActionForm, an Actionform object equivalent to a Java model in the static page, and all data objects must be identified as the Name property of the elements in the static page Form form.

If you do not take the value of the page element through the getxxx method in the ActionForm, check if the page element has a name attribute value and whether it is identified with the data object in Form.

5. Write an ActionServlct, an ActionServlet call the interface of the business logic layer to achieve a specific business function. At the same time, it is necessary to return the result according to the business logic interface to determine the next steering of the page. Here, objects and Struts-Config. Configuration files are involved here.

If the ActionSerlet is not found when the page is submitted, it is possible that the Path property setting of the corresponding action in the Struts-Config configuration file is inconsistent with the page form property settings. There is also a need for a package that must be in the web-inf / lib directory. If you need data in the Action, you need to configure and when configuring the Struts-Config configuration file. The value in the Action in Action in Action-maping must exist in the Form-Beans in Form-Beans.

Simultaneous Struts1.1 supports multiple Struts profiles, as long as each configuration file is added to the web.xml file, with a half-angle comma, you can solve the development of the division Many people have changed conflicts when the same file is modified. config /web-inf/strutsluo-config.xml ,/web-inf/strutsljq-config.xml ,/web-inf/strutslqd -config.xml

When the error page dynamically loads an error description information in the error page, the error is unusually: javax.servlet.jsp.jspexception: cannottion: cannottion: cannottion: cannot 帖子,, finally, finally found is my Struts- There is less than a paragraph in the config.xml file, plus it. If the Struts package used is downloaded online, this error should not be reported. The red code section should be modified according to its own actual packet path.

6. Configuration:

转载请注明原文地址:https://www.9cbs.com/read-39267.html

New Post(0)