TAILIEUCHUNG - Mastering Jakarta Struts phần 7

và các thành phần có thể được thúc đẩy để xây dựng chúng ta đã thảo luận trong Chương 1, "Giới thiệu Jakarta Struts dự án và các thành phần hỗ trợ của nó," Xem Struts được đại diện bởi một sự kết hợp của JSP, các thư viện thẻ tùy chỉnh, và các đối tượng ActionForm tùy chọn. | Building the Employees Application import import import import import import import import public class AddEmployeeAction extends Action protected void insertUser ActionForm form throws Exception String user null Connection conn null Statement stmt null ResultSet rs null ServletContext context DataSource dataSource DataSource try EmployeeForm eForm EmployeeForm form conn stmt StringBuffer sqlString new StringBuffer insert into employees values finally if rs null if stmt null if conn null 156 Building the Employees Application public ActionForward execute ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response throws IOException ServletException Default target to success String target success EmployeesActionMapping employeesMapping EmployeesActionMapping mapping Does this action require the user to login if HttpSession session if USER null The user is not logged in target login ActionErrors errors new ActionErrors new ActionError Report any errors we have discovered back to the original form if saveErrors request errors return target if isCancelled request Cancel pressed back to employee list return success try insertUser form catch .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.