Do something with Hibernate + Struts, I feel comfortable (with content)

xiaoxiao2021-03-06  88

It's relatively busy, I wrote it, I don't know if it can be useful, as a learning note. 1.Hibernate2.12 Hibernate provides MAP mode, it is enough, basically one-to-one, and One-to-man-to-one has been able to solve the problem, no SQL statement operation (direct JDBC operation) for direct databases. Mainly when doing database design, considering Hibernate design mode. Basic Document: Task.htm.xml Task.java TaskHandle In TaskHandle, there is generally the following method (other logic, can be increased by it): gettasklist (int pageindex, string iv; gettask; addtask; updatetask; UpdateTask; UpdateTask; (Task Task); deleteTask; ... 2.struts1.1 Web Page section: Information query (list, delete): tasklist.jsp, delete in Checkbox multi-selection mode. The top of the page is query condition, the main body For information list (pagination display). The query condition section Form is associated with the background QueryTaskform, for query information (this can avoid Chinese coding issues), the main information list directly with GetTasklist's list (Task) List (here As the front desk display information is more complicated, a javabean (for example: largetask.java) can be formed separately, forming a list), the Iterate mode bean: Write, the page: addtask.jsp Form element directly with the struts label One of the two anctions, an actionform, preaddtaskaction, addtaskaction, preddtaskaction, and addtaskaction, the addtaskaction, and the addtaskaction can be turned to the information prompt page after the ADDTskaction is successful. Edit Information Page: Edittask.jsp View Details Page: ViewTask.jsp View Details Page: ViewTask.jsp Only one ViewTaska CTION, used to get information, direct BeanWrite.

The page layout uses Tiles, the basic four-part architecture (TOP, LEFT, BODY, BOTTOM), where the middle body section is used, with the above page Extends. It is convenient to adjust the system page layout at any time. System system verification adopts ordinary HTML: Errors, no use of Validator, feels not used, and it seems to be more complicated :), the page still still has some only part of JavaScript, add UI's friendliness. Permission control uses a centralized way, that is, TILES In the TOP page, determine the URL of the current page, then go to the background to find the keyword section of this URL, what role should belong to, what kind of login personnel need to operate, so that it can be controlled in one place. It is very convenient. If you are not logged in, go directly to the login page (behind the URL of the time, after logging in, you can return to the page). Make a login confirmation operation. System, the front page section is not available to any JSP embedded code Use struts to implement (Struts standard tag). System Chinese Coding Problem Solution: Filter JSP Page Charset Definition (GBK) Chinese Database Drive (optional), mainly to avoid manual GetParameter to get, directly with Actionform getxxx The method can avoid the emergence of Chinese issues, and the entire system is not used to directly encode conversion, and the system portation to the non-Chinese encoding environment. In the system, the art is just the style of the home page and the secondary page. They are all controlled with the Struts tag, embed the information you need to display into the page, but only few parts, do not affect the aesthetics of the page, can perfect the original design idea of ​​the art.

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

New Post(0)