freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

外文翻譯----struts開發(fā)的最佳實踐(文件)

2025-06-11 11:47 上一頁面

下一頁面
 

【正文】 Form in JSP html:form action=/bp1 html:text property=attrib1 / /html:form The ActionForm called BP1AForm includes the attribute attrib1, as well as its getter and setter methods. In the configuration , the action /bp1 maps to bp1AForm using the name attribute. This facilitates data display in the JSP. To implement this best practice, Struts remends you do two things: 1. Create a JavaBean (BP1BForm) with attributes that form an attribute subset in BP1AForm, along with the attributes39。s Model layer, acting as a wrapper around the business logic. Each Action class must provide its casespecific implementation to the perform() method. The perform() method always returns a value of type ActionForward. ActionForm Every ActionForm of your application extends Struts39。Best practices for Struts development Palaniyappan Thiagarajan, Pagadala Suresh Struts: A brief introduction Struts, an open source framework you can use to build Web applications, is based on the popular ModelViewController (MVC2) design paradigm. The framework is built upon standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, and it provides flexible and extensible ponents. Struts implements the Controller layer in the form of ActionServlet and remends building the View layer using JSP tag libraries. Struts also provides a wrapper around the Model layer throughAction classes. Figure 1 illustrates the Struts framework based on the ModelViewController design. Figure 1. Struts and MVC Overview of Struts ponents First, we39。 . ActionForms are simple JavaBeans that encapsulate and validate request parameters. To validate your request data, your ActionForm39。 getter and setter methods. 2. Replace the attributes in BP1AForm with the bean BP1BForm by associating the bean with BP1AForm. Now you can access this attribute subset in BP1AForm through BP1BForm. Listing 2 shows you how. Listing 2. Accessing form attributes in JSP html:form action=/bp1 bean:define name=bp1AForm property=bp1BForm id=bp1B type= / html:text name=bp1B property=subsetAtt1 / /html:form Best Practice 2. Use Action class to handle requests Typically when using the Struts framework, for every action the JSP ponent requests your application to execute, the application must extend Struts39。 ActionError actionError = new ActionError(())。. 4. In BP4Action, create a method performTask() as in public abstract ActionForward performTask(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, ActionErrors actionErrors) throws IOException, ServletException. 5. In BP4Action, declare method perform() as final. Then invoke generic methods, which must always be called before processing the request. Now you can call the method performTask() created in the previous step. 6. While implementing method performTask() in every Action class (by extending BP4Action), handle application exceptions as shown in Listing 4. Listing 4. Using ActionErrors effectively try { //Code in Action class } catch(ApplicationException appException) { //Log exception //Add error
點擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1