翻译基于J2EE Struts的教学管理信息系统

时间:2025-07-05

Struts 翻译 毕业论文 基于J2EE Struts的教学管理信息系统

翻译原文:

The Struts I Know

Struts is available to the public at no charge under the Apache Software

License [ASF, License]. There are no acquisition or other recurring costs for using the software. Unlike some other open source licenses, the Apache Software License is business-friendly. You can use Struts to create a commercial project and

distribute the Struts binary without any red tape, fees, or other hassles. You can also integrate the Struts components into your own framework just as if they were written in-house.

The Struts framework joins together several related technologies so that web developers can create standards-based applications that are easier to build,extend, and maintain. Struts is already the framework of choice for both novice and experienced developers throughout the world.

Applications developed with Struts are based on a number of enabling

nologies.These components are not specific to Struts and underlie every Java web application. A reason that developers use frameworks like Struts is to hide the nasty details behind acronyms like HTTP, CGI, and JSP. As a Struts developer, you don’t need to be an alphabet soup guru, but a working knowledge of these base technologies can help you devise creative solutions to tricky problems.

The centerpiece of Struts is an MVC-style Controller. The Struts Controller bridges the gap between Model and View. The framework also includes other missing pieces developers need to write scalable, leading-edge web applications. Struts is a collection of “invisible underpinnings”that help developers turn raw materials like databases and web pages into a coherent application.

Struts implements Sun’s Model 2 architecture by providing a controller servlet that can be used to manage the flow between JSP pages and other presentation layer devices. Struts implements the MVC/Layers pattern through the use of ActionForwards and ActionMappings to keep control-flow decisions out of the presentation layer. The JSPs can refer to logical destinations. The Controller components provide the actual URIs at runtime.

The Struts ActionServlet works quietly behind the scenes, binding the other components together. Although it can be subclassed, most Struts 1.0 developers treat the ActionServlet as a blackbox: they configure it and leave it alone.

The web protocols, HTTP and HTML, provide a mechanism for submitting data

Struts 翻译 毕业论文 基于J2EE Struts的教学管理信息系统

from a form but leave receiving the data as an exercise for the developer. The Struts framework provides an ActionForm class, which is designed to handle input from an HTML form, validate the input, and redisplay the form to the user for correction(when needed), along with any corresponding prompts or messages. ActionForms are just JavaBeans with a couple of standard methods to manage the validation and revision cycle. Struts automatically matches the JavaBean properties with the attributes of the HTML controls. The developer defines the Action-Form class. Struts does the rest.

The Struts ActionForm (org.apache.struts.action.ActionForm) provides a handy place to store the input properties submitted with an HTTP request. But to

store the input properties, the controller must first create an ActionForm and save it in the request or session context, where the rest of the framework components—such as JSP tags—can find it.

Some flavors of ActionForms, need to be passed additional properties when

they are created. So, we need a place to put these elements as well.The ActionFormBean (org.apache.struts.action.ActionFormBean)resolves all of these issues by serving as a descriptor for an ActionForm object. Each ActionFormBean has properties that describe an ActionForm’s attribute name and type. The ActionFormBean can also contain property attributes. The Struts configuration file provides a <form-bean> element to catalog the ActionFormBeans used by a module. Each ActionFormBean is created by a corresponding <form-bean> element. At runtime, the controller calls up the appropriate ActionFormBean to find out which ActionForm object to

create,where to store it, and what attribute name to use.

Creating an ActionForm subclass is not difficult, but your class must meet some simple requirements:An ActionForm must extend from org.apache.struts.ActionForm. The base ActionForm class cannot be instantiated.

An ActionForm must define a public property for each HTML control it should harvest from the request.The ActionForm may also meet the following optional requirements:If you want the ActionForm to validate the input before passing it to theAction, you can implement the validate method.If you want to initialize properties before they are populated, you can implement the reset method, which is called before the ActionForm is populated.

The Struts solution to HTTP parameter handling is to transform the input fields into JavaBean properties. When a property on the ActionForm matches a parameter

Struts 翻译 毕业论文 基于J2EE Struts的教学管理信息系统

in the request, the framework automatically sets the property to the value of the parameter. A Struts developer can work with a trusty JavaBean and leave the HTTP rigmarole to the framework.To harvest request parameters, all the Struts developer needs to do is provide an ActionForm with JavaBean properties that match the names of the HTTP parameters. The rest is automatic.

In a conventional (non-web) user interface, controls have an internal buffer that captures the user’s input so it can be validated. If validation fails, the user can’t leave the control. If validation succeeds, the data is transferred to another field ofthe appropriate type. The …… 此处隐藏:25080字,全部文档内容请下载后查看。喜欢就下载吧 ……

翻译基于J2EE Struts的教学管理信息系统.doc 将本文的Word文档下载到电脑

    精彩图片

    热门精选

    大家正在看

    × 游客快捷下载通道(下载后可以自由复制和排版)

    限时特价:7 元/份 原价:20元

    支付方式:

    开通VIP包月会员 特价:29元/月

    注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
    微信:fanwen365 QQ:370150219