tailieunhanh - Java C13. Struts
Describe the necessity and the advantage of the framework Develop the Web application by using the framework. Struts: The Apache Software Foundation JSF (JavaServer Faces): The Java Community Process(JCP) Webcoordinator: FUJITSU to develop the Web app. by using Servlet and JSP. Starts according to the request from a client Offers the mechanism to process request, storage of data, screen transition control, etc. Defines screen transition information in XML file (strutsconfig. xml). | Chapter 13. Struts ITSS Java Programming Ngo Hong Son, HUT Outline Describe the necessity and the advantage of the framework Develop the Web application by using the framework Processing of screen control framework View Control Model Request Call Refer Transfer Response Typical screen control framework Struts: The Apache Software Foundation JSF (JavaServer Faces): The Java Community Process(JCP) Webcoordinator: FUJITSU Ltd. When framework is not used (1) public class ControllerServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException { try { ("JISAutoDetect"); } catch (UnsupportedEncodingException e) {();} try{ String page = ""; String flag = ("flag"); if (("1")) { page = "/jsp/"; } getServletContext().getRequestDispatcher(page).forward(req,res); } } When framework is not used (2) 1. Acquire the request parameter 2. Decide . | Chapter 13. Struts ITSS Java Programming Ngo Hong Son, HUT Outline Describe the necessity and the advantage of the framework Develop the Web application by using the framework Processing of screen control framework View Control Model Request Call Refer Transfer Response Typical screen control framework Struts: The Apache Software Foundation JSF (JavaServer Faces): The Java Community Process(JCP) Webcoordinator: FUJITSU Ltd. When framework is not used (1) public class ControllerServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException { try { ("JISAutoDetect"); } catch (UnsupportedEncodingException e) {();} try{ String page = ""; String flag = ("flag"); if (("1")) { page = "/jsp/"; } getServletContext().getRequestDispatcher(page).forward(req,res); } } When framework is not used (2) 1. Acquire the request parameter 2. Decide transition destination’s screen according to request parameter 3. Transfer to the transition destination‘s screen When framework is used Struts description Framework to develop the Web app. by using Servlet and JSP. Starts according to the request from a client Offers the mechanism to process request, storage of data, screen transition control, etc. Defines screen transition information in XML file () Functions of Struts Screen control Execute the screen transition based on “file of the transition. Validator function Verify function of input data from the client Internationalization Change the language displayed on the client side by the browser's language setting Struts components ActionServlet class Receives the request of the “” form After referring to “”, it calls the form class and the action class corresponding to the request Executes the View‘s call Configuration file () Specifies the form Bean and the action class according
đang nạp các trang xem trước