JSP框架介绍

合集下载

JSP技术简介

JSP技术简介

第1章JSP技术简介JSP(Java Server Pages)技术是由Sun公司发布的用于开发动态Web应用的一项技术。

它以其简单易学、跨平台的特性,在众多动态Web应用程序设计语言中异军突起,在短短几年中已经形成了一套完整的规范,并广泛地应用于电子商务等各个领域中。

在国内,JSP 现在也得到了比较广泛的重视,得到了很好的发展,越来越多的动态网站开始采用JSP技术。

本章就对JSP及其相关技术进行简单的介绍。

1.1 认识HTTP协议HTTP协议(Hypertext Transfer Protocol,超文本传送协议)是WWW服务器使用的主要协议,对HTTP协议细节的基本理解是编写JSP或Java小程序的开发人员所必需的。

因此在学习JSP技术之前有必要更加仔细地研究一下HTTP消息的格式(这里的讨论源自HTTP/1.1协议规范。

参见规范2616,网址为/rfc/rfc2616.txt)。

HTTP 协议的关键部分有HTTP请求和HTTP响应,以及客户端Web程序设计的一些基础知识,在第4章4.4节将会具体介绍。

1.2 客户端Web程序设计介绍Web浏览器现已成为深受大多数用户喜爱的用户界面。

HTML语言提供了丰富的控件,第三方厂商提供了Visual Basic编写的数百个额外的控件,这些都使得Web浏览器独具特色。

虽然Web浏览器与传统的GUI界面有一定的差距,但它提供了一种独立而又简单的方法来访问分布式资源,尤其是Internet资源。

而且越来越多的客户端Web程序扩展技术变得更加成熟,出现了包括CSS、JavaScript、VBScript、动态HTML、Java1.1.Applet应用程序等技术在内的客户端Web程序设计技术,它们的相互结合使得Web程序更加迷人。

下面简单介绍几种常用的客户端Web程序设计技术的特点。

本书假定读者对这些技术都有一定的了解,不对这些技术作详细介绍。

1.2.1 CSSCSS(Cascading Style Sheets)称为层叠样式表,是动态HTML技术的一个部分,但可以和HTML结合使用。

JSP Ajax Ajax框架概述

JSP Ajax  Ajax框架概述

JSP Ajax Ajax框架概述在使用JavaScript、XML、DOM等技术编写Ajax页面时,我们需要考虑很多问题,如针对不同的浏览器,需要使用不同的方式创建XMLHttpRequest对象,以达到在所有的浏览器都能够浏览演示。

编写一个Ajax案例,如果还是采用以前的A jax设计方法,不可以避免的要产生大量的重复性代码,如每个Ajax页面都需要创建XMLHttpRequest对象,对XML文件的处理方式等。

编写Ajax页面的大量时间浪费在这些重复性的代码上,显然有点不划算。

这些情况对一个优秀的程序员来说,根本不是问题。

我们可以把这些重复性的代码,多次需要调用的代码,以面向对象的方式封装到一个文件里面,如创建XMLHttpReq uest对象。

把重复性、关键性代码封装起来,能够达到代码重复重用的目的,能够很好的维护程序和调试程序。

把重复性代码封装起来,做出独立的文件,这里文件的扩展名为.js。

利用这些封装JavaScript文件可以形成自己的代码库,进而形成属于自己的框架。

创建属于自己的Ajax代码库,会花费大量的时间,并且还需要时刻注意代码库的Bug并进行修正。

对于个人来说,还不如使用一些现成的Ajax框架,毕竟这些框架是经过优秀程序员创建和大量的用户测试。

从Ajax诞生以来,人们就发现使用Ajax框架可以带来极大的方便,节省了大量的时间和精力。

于是,大量的Ajax框架诞生了,Ajax框架很多,几乎每月都要产生一些新的框架。

有些框架基于客户端,有些基于服务器端;有些专门为特定语言设计,如Java。

另外还有一些与语言无关。

其中绝大部分都是开源的,但也有少数是专用的。

经过Ajax框架的发展,一些框架已经逐渐被淘汰,一些框架被保留了下来。

Ajax框架由于代码库封装代码的不同,可以分为基于浏览器的Ajax框架和基于服务器端的Ajax框架。

基于服务器端框架可以划分两种形式,分别为HTML/JS Generation(HTML/JS生成)和远程交互。

Java中的Web开发框架有哪些

Java中的Web开发框架有哪些

Java中的Web开发框架有哪些在Java中,有多种用于Web开发的框架。

这些框架提供了一套工具和结构,帮助开发人员快速构建可靠、高效的Web应用程序。

本文将介绍几种常用的Java Web开发框架。

一、Spring MVCSpring MVC是一个基于Java的轻量级Web框架,它是Spring框架的一部分。

Spring MVC通过使用模型-视图-控制器(MVC)的设计模式,将应用程序的不同组件分离开来。

它提供了灵活的配置选项和强大的功能,包括请求映射、表单处理、数据验证和视图解析等。

Spring MVC也支持RESTful风格的Web服务开发。

二、StrutsStruts是另一个受欢迎的Java Web框架,它遵循MVC设计模式。

Struts框架提供了一种结构化的方法来构建Web应用程序。

它使用Struts配置文件来管理请求和处理逻辑,同时提供了多种标签库和表单验证机制。

Struts还支持国际化和本地化,使得开发多语言应用程序更加简便。

三、JSFJavaServer Faces(JSF)是Java EE的一部分,它是一种用于构建用户界面的Web框架。

相比于其他框架,JSF更加面向组件。

它提供了一系列可重用的UI组件,开发人员可以通过简单地组合这些组件来构建复杂的用户界面。

JSF还具有良好的可扩展性和集成性,可以轻松地与其他Java技术和框架进行集成。

四、Play框架Play框架是一个用于构建Web应用程序的响应式全栈框架。

它采用了基于Actor模型的异步编程模型,这使得Play应用程序能够处理高并发和高吞吐量的请求。

Play框架还提供了内置的开发工具和自动重新加载功能,使得开发变得更加高效。

此外,Play还支持多种数据库和模板引擎,开发人员可以根据自己的需求进行选择。

五、Spring BootSpring Boot是一个用于简化Spring应用程序开发的框架。

它提供了一种约定优于配置的方式,通过自动配置和快速启动器,可以快速构建独立运行的、生产级别的Spring应用程序。

jsp框架frameset和frame的区别和用法(转:zph_0629的日志-网易博客)

jsp框架frameset和frame的区别和用法(转:zph_0629的日志-网易博客)

jsp框架frameset和frame的区别和⽤法(转:zph_0629的⽇志-⽹易博客)【注】可以通过对框架的命名,实现jsp页⾯的target设置⾸先搞清楚框架的两个标签:frameset和frame.1.frameset:声明页⾯是采⽤了框架技术Java代码:<frameset rows="60,*" frameborder="1" border="0" bordercolor="#000FFF" framespacing="1">lt;/frameset>rows="60,*"是把页⾯分为上下两个部分,rows="*,*,*"是把页⾯分成上中下3个部分cols="60,*"是把页⾯分为左右两个部分,以此类推....省略其中⽅法和属性描述2.frame:简单的说framset是页⾯分布的结构,那么frame就是结构中的内容了把页⾯分为上下两个部分,下部分⼜分成左右两个⼩模块组成,代码如下:<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><base href="<%=basePath%>"><title>例⼦</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">--></head><frameset rows="70,*" cols="*" frameborder="No" border="0"framespacing="1"><framesrc="inc/top.jsp"name="topFrame" scrolling="No" noresize="noresize" id="topFrame"title="topFrame" /><frameset cols="160,*" frameborder="No" border="0" framespacing="1"><framesrc="inc/menu.jsp"src="inc/controlMenu.jsp"name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame"title="leftFrame" /><framesrc="exclusiveUpdateCar.jsp"name="mainFrame" noresize="noresize" id="mainFrame" title="mainFrame" /><!--注意id="mainFrame"和 menu.jsp中的target="mainFrame"..看这就明⽩了。

JSP2.0应用教程_14 Struts与JSF

JSP2.0应用教程_14 Struts与JSF


控制器Servlet JSP自定义标记库 工具类
6
Struts组成
2013-9-1
7
安装Struts
• 下载struts-1.2.7.zip : /download.cgi • 解压缩,三个目录:lib、webapps和 contrib • 如果在Web应用中需要使用Struts,需 要将lib/JAR文件复制到对应的Web应用 下的WEB-INF/lib目录下,并且将 lib/TLD文件复制到对应的Web应用下的 WEB-INF/tlds目录下。
– 3. 修改Web应用配置文件web.xml
• ActionServlet、建立URI请求与 ActionServlet的对应关系。
2013-9-1 10
Struts实例
– 4. 编写Struts配置文件 strutsconfig.xml – 5. 使用Struts标记库编写JSP页面 index.jsp Welcome.jsp – 6. 编写资源文件 myResource.properties
2013-9-1 13
4. 安装和配置JSF
• 下载jsf-1_1_01.zip : /j2ee/javaserverfaces /download.html 将下载的zip文件解压缩 将解压缩得到的lib目录下的所有JAR文件 (*.jar)都复制到Web应用目录下的WEBINF\lib目录下;将解压缩得到的lib目录下的 所有TLD文件(*.tld)都复制到WEBINF\tlds目录下 将JSTL中的两个JAR文件jstl.jar和 standard.jar复制到Web应用目录下的 WEB-INF\lib目录下;将JSTL中的所有TLD 文件都复制到WEB-INF\tlds目录下

JSP技术概述和应用框架外文翻译

JSP技术概述和应用框架外文翻译

外文原文Overview of JSP Technology and JSP application frameworksAutor: Zambon Giulio/ Sekler MichaelSource: Springer-Verlag New York Inc1.Benefits of JSPJSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.JSP provides the following benefits over servlets alone: •It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.• You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.• You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit.2.Advantages of JSP Over Competing TechnologiesA number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini,which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, ColdFusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did..So, the question becomes: why use JSP instead of one of these other technologies? Our first response is that we are not arguing that everyone should. Several of those other technologies are quite good and are reasonable options in some situations. In other situations, however, JSP is clearly better. Here are a few of the reasons.2.1 Versus .NET and Active Server Pages (ASP). NET is well-designed technology from Microsoft. is the part that directly competes with servlets and JSP. The advantages of JSP are two fold.First, JSP is portable to multiple operating systems and Web servers; you aren't locked into deploying on Windows and IIS. Although the core .NET platform runs on a few non-Windows platforms, the ASP part does not. You cannot expect to deploy serious applications on multiple servers and operating systems. For some applications, this difference does not matter. For others, it matters greatly.Second, for some applications the choice of the underlying language matters greatly. For example, although .NET's C# language is very well designed and is similar to Java, fewer programmers are familiar with either the core C# syntax or the many auxiliary libraries. In addition, many developers still use the original version of ASP. With this version, JSP has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASP-specific language, so JSP is more powerful and better suited to complex applications that require reusable components.You could make the same argument when comparing JSP to the previous version of ColdFusion; with JSP you can use Java for the "real code" and are not tied to a particular server product. However, the current release of ColdFusion is within the context of a J2EE server, allowing developers to easily mix ColdFusion and servlet/JSP code.2.2 Versus PHPPHP (a recursive acronym for "PHP: Hypertext Preprocessor") is a free, open-source, HTML-embedded scripting language that is somewhat similar to both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is PHP.2.3 Versus Pure ServletsJSP doesn't provide any capabilities that couldn't, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.Does this mean that you can just learn JSP and forget about servlets? Absolutely not! JSP developers need to know servlets for four reasons:1. JSP pages get translated into servlets. You can't understand how JSP works without understanding servlets.2. JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java code? Servlet code! You can't write that code if you don't understand servlet programming.3. Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data,building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.4. Some tasks are better accomplished by a combination of servlets and JSP than by either servlets or JSP alone.2.4 Versus JavaScriptJavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the client. So, JavaScript is not a competing technology; it is a complementary one.It is also possible to use JavaScript on the server, most notably on Sun ONE (formerly iPlanet), IIS, and BroadVision servers. However, Java is more powerful, flexible, reliable, and portable.2.5 Versus WebMacro or VelocityJSP is by no means perfect. Many people have pointed out features that could be improved. This is a good thing, and one of the advantages of JSP is that the specification is controlled by a community that draws from many different companies. So, the technology can incorporate improvements in successive releases.However, some groups have developed alternative Java-based technologies to try to address these deficiencies. This, in our judgment, is a mistake. Using a third-party tool like Apache Struts that augments JSP and servlet technology is a good idea when that tool adds sufficient benefit to compensate for the additional complexity. But using a nonstandard tool that tries to replace JSP is a bad idea. When choosing a technology, you need to weigh many factors: standardization, portability, integration, industry support, and technical features. The arguments for JSP alternatives have focused almost exclusively on the technical features part. But portability, standardization, and integration are also very important. For example, the servlet and JSP specifications define a standard directory structure for Web applications and provide standard files (.war files) for deploying Web applications. All JSP-compatible servers must support these standards. Filters can be set up toapply to any number of servlets or JSP pages, but not to nonstandard resources. The same goes for Web application security settings.Besides, the tremendous industry support for JSP and servlet technology results in improvements that mitigate many of the criticisms of JSP. For example, the JSP Standard Tag Library and the JSP 2.0 expression language address two of the most well-founded criticisms: the lack of good iteration constructs and the difficulty of accessing dynamic results without using either explicit Java code or verbose jsp:useBean elements.3. Misconceptions About JSPForgetting JSP Is Server-Side TechnologyHere are some typical questions Marty has received (most of them repeatedly). • Our server is running JDK 1.4. So, how do I put a Swing component in a JSP page?•How do I put an image into a JSP page? I do not know the proper Java I/O commands to read image files.• Since Tomcat does not support JavaScript, how do I make images that are highlighted when the user moves the mouse over them?• Our clients use older browsers that do not understand JSP. What should we do?• When our clients use "View Source" in a browser, how can I prevent them from seeing the JSP tags?All of these questions are based upon the assumption that browsers know something about the server-side process. But they do not. Thus:• For putting applets with Swing components into Web pages, what matters is the browser's Java version—the server's version is irrelevant. If the browser supports the Java 2 platform, you use the normal APPLET (or Java plug-in) tag and would do so even if you were using non-Java technology on the server. • You do not need Java I/O to read image files; you just put the image in the directory for Web resources (i.e., two levels up from WEB-INF/classes) and output a normal IMG tag.•You create images that change under the mouse by using client-side JavaScript, referenced with the SCRIPT tag; this does not change just because the server is using JSP.• Browsers do not "support" JSP at all—they merely see the output of the JSP page. So, make sure your JSP outputs HTML compatible with the browser, just asyou would do with static HTML pages.• And, of course you need not do anything to prevent clients from seeing JSP tags; those tags are processed on the server and are not part of the output that is sent to the client.Confusing Translation Time with Request TimeA JSP page is converted into a servlet. The servlet is compiled, loaded into the server's memory, initialized, and executed. But which step happens when? To answer that question, remember two points:• The JSP page is translated into a servlet and compiled only the first time it is accessed after having been modified.• Loading into memory, initialization, and execution follow the normal rules for servlets.The most frequently misunderstood entries are highlighted. When referring to the table, note that servlets resulting from JSP pages use the _jspService method (called for both GET and POST requests), not doGet or doPost. Also, for initialization, they use the jspInit method, not the init method.JSP page translated into servlet Servlet compiled Servlet loaded into server's memory jspInit called _jspService called.4.What are application frameworks:A framework is a reusable, semi-complete application that can be specialized to produce custom applications [Johnson]. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products.A framework provides developers with a set of backbone components that have the following characteristics:1.They are known to work well in other applications.2. They are ready to use with the next project.3. They can also be used by other teams in the organization.Frameworks are the classic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before youcan roll your own? If you buy it, you will have to climb the learning curve—and how long is that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projects.Other types of frameworks:The idea of a framework applies not only to applications but to application componentsas well. Throughout this article, we introduce other types of frameworks that you can use with Struts. These include the Lucene search engine, the Scaffold toolkit, the Struts validator, and the Tiles tag library. Like application frameworks, these tools provide semi-complete versions of a subsystem that can be specialized to provide a custom component.Some frameworks have been linked to a proprietary development environment. This is not the case with Struts or any of the other frameworks shown in this book. You can use any development environment with Struts: Visual Age for Java, JBuilder, Eclipse, Emacs, and Textpad are all popular choices among Struts developers. If you can use it with Java, you can use it with Struts.Enabling technologies:Applications developed with Struts are based on a number of enabling technologies.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.Hypertext Transfer Protocol (HTTP):When mediating talks between nations, diplomats often follow a formal protocol.Diplomatic protocols are designed to avoid misunderstandings and to keep negotiations from breaking down. In a similar vein, when computers need to talk, they also follow a formal protocol. The protocol defines how data is transmitted and how to decode it once it arrives. Web applications use the Hypertext Transfer Protocol (HTTP) to move data between the browser running on your computer and the application running on the server.Many server applications communicate using protocols other than HTTP. Some of these maintain an ongoing connection between the computers. The application server knows exactly who is connected at all times and can tell when a connectionis dropped. Because they know the state of each connection and the identity of each person using it, these are known as stateful protocols.By contrast, HTTP is known as a stateless protocol. An HTTP server will accept any request from any client and will always provide some type of response, even if the response is just to say no. Without the overhead of negotiating and retaining a connection, stateless protocols can handle a large volume of requests. This is one reason why the Internet has been able to scale to millions of computers.Another reason HTTP has become the universal standard is its simplicity. An HTTP request looks like an ordinary text document. This has made it easy for applications to make HTTP requests. You can even send an HTTP request by hand using a standard utility such as Telnet. When the HTTP response comes back, it is also in plain text that developers can read.The first line in the HTTP request contains the method, followed by the locationof the requested resource and the version of HTTP. Zero or more HTTP request headers follow the initial line. The HTTP headers provide additional information to the server. This can include the browser type and version, acceptable document types, and the browser’s cookies, just to name a few. Of the seven request methods, GET and POST are by far the most popular.Once the server has received and serviced the request, it will issue an HTTP response. The first line in the response is called the status line and carries the HTTP protocol version, a numeric status, and a brief description of the status. Following the status line, the server will return a set of HTTP response headers that work in a way similar to the request headers.As we mentioned, HTTP does not preserve state information between requests.The server logs the request, sends the response, and goes blissfully on to the next request. While simple and efficient, a stateless protocol is problematic for dynamic applications that need to keep track of their users. (Ignorance is not always bliss.Cookies and URL rewriting are two common ways to keep track of users between requests. A cookie is a special packet of information on the user’s computer. URL rewriting stores a special reference in the page address that a Java server can use to track users. Neither approach is seamless, and using either means extra work when developing a web application. On its own, a standard HTTP web server does not traffic in dynamic content. It mainly uses the request to locatea file and then returns that file in the response. The file is typically formatted using Hypertext Markup Language (HTML) [W3C, HTML] that the web browser can format and display. The HTML page often includes hypertext links to other web pages and may display any number of other goodies, such as images and videos. The user clicks a link to make another request, and the process begins a new.Standard web servers handle static content and images quite well but need a helping hand to provide users with a customized, dynamic response.DEFINITION:Static content on the Web comes directly from text or data files, like HTML or JPEG files. These files might be changed from time to time, but they are not altered automatically when requested by a web browser. Dynamic content, on the other hand, is generated on the fly, typically in response to an individualized request from a browser.Common Gateway Interface (CGI):The first widely used standard for producing dynamic content was the Common Gateway Interface (CGI). CGI uses standard operating system features, such as environment variables and standard input and output, to create a bridge, or gateway, between the web server and other applications on the host machine. The other applications can look at the request sent to them by the web server and create a customized response.When a web serve r receives a request that’s intended for a CGI program, it runs that program and provides the program with information from the incoming request. The CGI program runs and sends its output back to the server. The web server then relays the response to the browser.CGI defines a set of conventions regarding what information it will pass as environment variables and how it expects standard input and output to be used. Like HTTP, CGI is flexible and easy to implement, and a great number of CGI-aware programs have been written.The main drawback to CGI is that it must run a new copy of the CGI-aware program for each request. This is a relatively expensive process that can bog down high-volume sites where thousands of requests are serviced per minute. Another drawback is that CGI programs tend to be platform dependent. A CGI program written for one operating system may not run on another.5. Java servlets:Sun’s Java Servlet platform directly addresses the two main drawbacks of CGI programs.First, servlets offer better performance and utilization ofresources than conventional CGI programs. Second, the write-once, run-anywhere nature of Java means that servlets are portable between operating systems that have a Java Virtual Machine (JVM).A servlet looks and feels like a miniature web server. It receives a request and renders a response. But, unlike conventional web servers, the servlet application programming interface (API) is specifically designed to help Java developers create dynamic applications.The servlet itself is simply a Java class that has been compiled into byte code, like any other Java object. The servlet has access to a rich API of HTTP-specific services, but it is still just another Java object running in an application and can leverage all your other Java assets.To give conventional web servers access to servlets, the servlets are plugged into containers. The servlet container is attached to the web server. Each servlet can declare what URL patterns it would like to handle. When a request matching a registered pattern arrives, the web server passes the request to the container, and the container invokes the servlet.But unlike CGI programs, a new servlet is not created for each request. Once the container instantiates the servlet, it will just create a new thread for each request. Java threads are much less expensive than the server processes used by CGI programs. Once the servlet has been created, using it for additional requests incurs very little overhead. Servlet developers can use the init() method to hold references to expensive resources, such as database connections or EJB Home Interfaces, so that they can be shared between requests. Acquiring resources like these can take several seconds—which is longer than many surfers are willing to wait.The other edge of the sword is that, since servlets are multithreaded, servlet developers must take special care to be sure their servlets are thread-safe. To learn more about servlet programming, we recommend Java Servlets by Example, by Alan R. Williamson [Williamson]. The definitive source for Servlet information is the Java Servlet Specification [Sun, JST].6. JavaServer Pages:While Java servlets are a big step up from CGI programs, they are not a panacea. To generate the response, developers are still stuck with using println statements to render the HTML. Code that looks like:out.println("<P>One line of HTML.</P>");out.println("<P>Another line of HTML.</P>");is all too common in servlets that generate the HTTP response. There are libraries that can help you generate HTML, but as applications grow more complex, Java developers end up being cast into the role of HTML page designers.Meanwhile, given the choice, most project managers prefer to divide development teams into specialized groups. They like HTML designers to be working on the presentation while Java engineers sweat the business logic. Using servlets alone encourages mixing markup with business logic, making it difficult for team members to specialize.To solve this problem, Sun turned to the idea of using server pages to combine scripting and templating technologies into a single component. To build Java Server Pages, developers start by creating HTML pages in the same old way, using the same old HTML syntax. To bring dynamic content into the page, the developer can also place JSP scripting elements on the page. Scripting elements are tags that encapsulate logic that is recognized by the JSP. You can easily pick out scripting elements on JSP pages by looking for code that begins with <% and ends with %>.To be seen as a JSP page, the file just needs to be saved with an extension of .jsp.When a client requests the JSP page, the container translates the page into a source code file for a Java servlet and compiles the source into a Java class file—just as you would do if you were writing a servlet from scratch. At runtime, the container can also check the last modified date of the JSP file against the class file. If the JSP file has changed since it was last compiled, the container will retranslate and rebuild the page all over again.Project managers can now assign the presentation layer to HTML developers, who then pass on their work to Java developers to complete the business-logic portion. The important thing to remember is that a JSP page is really just a servlet. Anything you can do with a servlet, you can do with a JSP.7. JavaBeans:JavaBeans are Java classes which conform to a set of design patterns that make them easier to use with development tools and other components.DEFINITION A JavaBean is a reusable software component written in Java. To qualify as a JavaBean, the class must be concrete and public, and have a noargument constructor. JavaBeans expose internal fields as properties byproviding public methods that follow a consistent design pattern. Knowing that the property names follow this pattern, other Java classes are able to use introspection to discover and manipulate JavaBean properties.The JavaBean design patterns provide access to the bean’s internal state through two flavor s of methods: accessors are used to read a JavaBean’s state; mutators are used to change a JavaBean’s state.Mutators are always prefixed with lowercase token set followed by the property name. The first character in the property name must be uppercase. The return value is always void—mutators only change property values; they do not retrieve them. The mutator for a simple property takes only one parameter in its signature, which can be of any type. Mutators are often nicknamed setters after their prefix. The mutator method signature for a weight property of the type Double would be:public void setWeight(Double weight)A similar design pattern is used to create the accessor method signature. Accessor methods are always prefixed with the lowercase token get, followed by the property name. The first character in the property name must be uppercase. The return value will match the method parameter in the corresponding mutator. Accessors for simple properties cannot accept parameters in their method signature. Not surprisingly, accessors are often called getters.The accessor method signature for our weight property is:public Double getWeight()If the accessor returns a logical value, there is a variant pattern. Instead of using the lowercase token get, a logical property can use the prefix is, followed by the property name. The first character in the property name must be uppercase. The return value will always be a logical value—either boolean or Boolean. Logical accessors cannot accept parameters in their method signature.The boolean accessor method signature for an on property would bepublic boolean isOn()The canonical method signatures play an important role when working with Java- Beans. Other components are able to use the Java Reflection API to discover a JavaBean’s properties by looking for methods prefixed by set, is, or get. If a component finds such a signature on a JavaBean, it knows that the method can be used to access or change the bean’s properties.。

基于Struts2和iBATIS的JSP开发框架设计与实现

基于Struts2和iBATIS的JSP开发框架设计与实现摘要:在jsp应用程序存在异常处理分散、拼接sql语句繁琐易错、上下层次模块间耦合度高等问题,这些问题使系统难以扩展和维护。

本文设计并实现了一个基于struts2和ibatis的jsp开发框架,解决上述问题。

该框架已经实现并在实际开发中使用。

通过对比证明,该框架提高了jsp应用系统的灵活性和扩展性,同时也缩短了开发周期,降低了开发成本。

关键词:struts2;ibatis;jsp开发框架中图分类号:tp311.52jsp(java server pages)是常见的b/s架构(browser/server 架构)[1]实现技术之一。

在笔者为学校开发“奖助贷系统”和“认证考试报名系统”等jsp应用系统的过程中,遇到了以下问题:(1)为系统所有模块增加、修改或者移除一个功能时,需要改动大量代码,异常处理分散,当异常处理方式改变时,代码修改量也很大;(2)系统中需要大量动态拼接sql语句,在java中拼接sql语句非常繁琐,而且容易出错;(3)业务逻辑处理和数据存取之间的接口耦合度高,多个开发人员之间沟通成本也很高。

笔者通过对已开发的两个项目进行研究,设计了一个简单的jsp 开发框架,来解决上述三个问题。

1 关键技术简介1.1 mvc和struts2框架mvc框架模式全称是model-view-controller[2]。

其中,model表示业务逻辑和数据存取,view表示数据显示,controller连接model和view两部分。

mvc把数据显示(v)和数据(m)隔离,同时也把两者之间的联系(c)独立出来,三个部分各司其职,互不干扰。

struts2框架[3]对应于controller部分。

它通过编写xml配置文件,控制页面跳转。

struts2的配置代码示例如下:method=“query”>/list_s.jsp/list_t.jspstruts2的拦截器机制还能对所有请求做相同的处理[4]。

JSP开发框架

提供一组与数据库绑定的HTML控件。
7、 Nutz
Nutz是一组轻巧的开源框架,内容涵盖了:
1.数据持久化(Data Persistence)
2.反转控制(Ioc)
3.Web框架(MVC)
Nutz所有的功能均不依赖第三方的jar包,上面三个部分可以独立使用。
4、 Mantis
Mantis是一个基于Java的小型MVC Web框架,通过Mantis,您可以快速开发一个Web系统,它具有以下特点:
封装数据库访问,事务处理,连接池集成,封装分页控制
封装数据库缓存和刷新机
基于URL反射的方法调用,避免复杂的XML配置;
简化配置文件,只需要一个配置文件即可完成web应用的灵活配置
dtree:树 形显示,简单易用。
jfreechat:统计图表生成。
dwr:适 合java的ajax开发框架,新版本中实现了服务器推模式,颠覆传统的客户端拉模式。
FCKeditor:网 页的所见即所得编辑器,漂亮的外观,多语言支持等,很强大。
jsp layout:是一个用来实现 JSP 布局支持的简单示例项目。该项目只需要一个 Servlet 类,一些配置即可Apache Tiles是一个JavaEE应用的页面布局框架。Tiles框架提供了一种模板机制,可以为某一类页面定义一个通用的模板,该模板定义了页面的整体布 局。布局由可以复用的多个块组成,每个页面可以有选择性的重新定义块而达到组件的复用。
6、 LazyJ
LazyJ是一个Java Web应用程序开发框架。包括:
一个非常快的模板引擎,该引擎能够缓自动存编译过的模板。
提供响应缓存和数据缓存引擎。
封装常用的数据库操作功能,包括连接池。

Jsp详解

Jsp详解1.简介2.Jsp的运行原理3.Jsp的语法1.Jsp模板元素2.Jsp中的脚本表达式3.Jsp中的脚本片段4.Jsp的声明5.Jsp注释6.Jsp指令1.首先我们来看一下page指令的用法2.下面在来看一下include指令3.最后来看一下taglib指令7.Jsp中内置的9个隐式对象8.JSP标签库1.jspinclude标签2.jspforward标签3.jspparam或者jspparams标签4.jspuseBean标签jspsetProperty标签jspgetProperty标签9.Jsp中怎么排查错误简介:JSP全称是JavaServer Pages,它和servle技术一样,都是SUN公司定义的一种用于开发动态web资源的技术。

JSP这门技术的最大的特点在于,写jsp就像在写html,但:它相比html而言,html只能为用户提供静态数据,而Jsp技术允许在页面中嵌套java代码,为用户提供动态数据。

相比servlet而言,servlet很难对数据进行排版,而jsp除了可以用java代码产生动态数据的同时,也很容易对数据进行排版。

不管是JSP还是Servlet,虽然都可以用于开发动态web资源。

但由于这2门技术各自的特点,在长期的软件实践中,人们逐渐把servlet作为web应用中的控制器组件来使用,而把JSP技术作为数据显示模板来使用。

其原因为,程序的数据通常要美化后再输出:让jsp既用java代码产生动态数据,又做美化会导致页面难以维护。

让servlet既产生数据,又在里面嵌套html代码美化数据,同样也会导致程序可读性差,难以维护。

因此最好的办法就是根据这两门技术的特点,让它们各自负责各的,servlet只负责响应请求产生数据,并把数据通过转发技术带给jsp,数据的显示jsp来做。

Jsp的运行原理:目标:Web服务器是如何调用并执行一个jsp页面的?Jsp页面中的html排版标签是如何被发送到客户端的?Jsp页面中的java代码服务器是如何执行的?Web服务器在调用jsp时,会给jsp提供一些什么java对象?思考:JSP为什么可以像servlet一样,也可以叫做动态web资源的开发技术?其实Jsp就是一个Servlet,所以我们要先介绍Servlet的相关技术,当我们第一次访问Jsp 的时候,Jsp引擎都会将这个Jsp翻译成一个Servlet,这个文件存放在Tomcat中的work目录中,这里,我们新建一个MyJsp.jsp页面,然后访问以下,我们看一下翻译后的源码:1.<%@ page language="java"import="java.util.*"pageEncoding="utf-8"%>2.3.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML4.01 Transitional//EN">4.<html>5.<head>6.7.<title>My JSP 'MyJsp.jsp' starting page</title>8.9.</head>10.11.<body>12. This is my JSP page. <br>13.</body>14.</html>1.package org.apache.jsp;2.3.import javax.servlet.*;4.import javax.servlet.http.*;5.import javax.servlet.jsp.*;6.import java.util.*;7.8.public final class MyJsp_jsp extends org.apache.jasper.runtime.HttpJspBase9.implements org.apache.jasper.runtime.JspSourceDependent {10.11.private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();12.13.private static java.util.List _jspx_dependants;14.15.private javax.el.ExpressionFactory _el_expressionfactory;16.private org.apache.AnnotationProcessor _jsp_annotationprocessor;17.18.public Object getDependants() {19.return _jspx_dependants;20. }21.22.public void _jspInit() {23. _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();24. _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class .getName());25. }26.27.public void _jspDestroy() {28. }29.30.public void _jspService(HttpServletRequest request, HttpServletResponse response)31.throws java.io.IOException, ServletException {32.33. PageContext pageContext = null;34. HttpSession session = null;35. ServletContext application = null;36. ServletConfig config = null;37. JspWriter out = null;38. Object page = this;39. JspWriter _jspx_out = null;40. PageContext _jspx_page_context = null;41.42.43.try {44. response.setContentType("text/html;charset=utf-8");45. pageContext = _jspxFactory.getPageContext(this, request, response,46.null, true, 8192, true);47. _jspx_page_context = pageContext;48. application = pageContext.getServletContext();49. config = pageContext.getServletConfig();50. session = pageContext.getSession();51. out = pageContext.getOut();52. _jspx_out = out;53.54. out.write("\r\n");55. out.write("\r\n");56. out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");57. out.write("<html>\r\n");58. out.write(" <head>\r\n");59. out.write(" \r\n");60. out.write(" <title>My JSP 'MyJsp.jsp' starting page</title>\r\n");61. out.write(" \r\n");62. out.write(" </head>\r\n");63. out.write(" \r\n");64. out.write(" <body>\r\n");65. out.write(" This is my JSP page. <br>\r\n");66. out.write(" </body>\r\n");67. out.write("</html>\r\n");68. } catch (Throwable t) {69.if (!(t instanceof SkipPageException)){70. out = _jspx_out;71.if (out != null && out.getBufferSize() != 0)72.try { out.clearBuffer(); } catch (java.io.IOException e) {}73.if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);74. }75. } finally {76. _jspxFactory.releasePageContext(_jspx_page_context);77. }78. }79.}我们看到,这个类继承了org.apache.jasper.runtime.HttpJspBase,要想看到这个类的源码,我1./*2. * Licensed to the Apache Software Foundation (ASF) under one or more3. * contributor license agreements. See the NOTICE file distributed with4. * this work for additional information regarding copyright ownership.5. * The ASF licenses this file to You under the Apache License, Version 2.06. * (the "License"); you may not use this file except in compliance with7. * the License. You may obtain a copy of the License at8. *9. * /licenses/LICENSE-2.010. *11. * Unless required by applicable law or agreed to in writing, software12. * distributed under the License is distributed on an "AS IS" BASIS,13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14. * See the License for the specific language governing permissions and15. * limitations under the License.16. */17.18.package org.apache.jasper.runtime;19.20.import java.io.IOException;21.22.import javax.servlet.ServletConfig;23.import javax.servlet.ServletException;24.import javax.servlet.http.HttpServlet;25.import javax.servlet.http.HttpServletRequest;26.import javax.servlet.http.HttpServletResponse;27.import javax.servlet.jsp.HttpJspPage;28.import javax.servlet.jsp.JspFactory;29.30.import piler.Localizer;31.32./**33. * This is the super class of all JSP-generated servlets.34. *35. * @author Anil K. Vijendran36. */37.public abstract class HttpJspBase38.extends HttpServlet39.implements HttpJspPage40.41.42.{43.44.protected HttpJspBase() {45. }46.47.public final void init(ServletConfig config)48.throws ServletException49. {50.super.init(config);51. jspInit();52. _jspInit();53. }54.55.public String getServletInfo() {56.return Localizer.getMessage("");57. }58.59.public final void destroy() {60. jspDestroy();61. _jspDestroy();62. }63.64./**65. * Entry point into service.66. */67.public final void service(HttpServletRequest request, HttpServletResponse response)68.throws ServletException, IOException69. {70. _jspService(request, response);71. }72.73.public void jspInit() {74. }75.76.public void _jspInit() {77. }78.79.public void jspDestroy() {80. }81.82.protected void _jspDestroy() {83. }84.85.public abstract void _jspService(HttpServletRequest request,86. HttpServletResponse response)87.throws ServletException, IOException;88.}好吧,看到了,继承了HttpServlet类,所以说其实Jsp就是一个ServletJsp的语法:1.JSP模版元素2.JSP表达式3.JSP脚本片段4.JSP注释5.JSP指令6.JSP标签7.JSP内置对象8.如何查找JSP页面中的错误Jsp模板元素JSP页面中的HTML内容称之为JSP模版元素。

JSP Ajax Prototype框架简介

JSP Ajax Prototype框架简介Prototype框架是一个基于客户端的Ajax框架,其实质就是将客户端常用的Aj ax代码,如创建XMLHttpRequest对象这些重复性代码,使用面向对象的方式进行封装,封装成一个js文件。

Prototype框架使用过程,只需要调用相应的对象,而不必关系其具体的实现细节。

从这方面说,Prototype是一个基础的JavaScript应用框架,Prototype的目的是为了更方便的开发JavaScript的应用,使用它可以更加方便简单的使用JavaScript 编程,开发面向对象的JavaScript程序,Prototype框架是JavaScript代码的自然扩展,更容易被人接受。

但是,Prototype是最受欢迎的AJAX框架之一。

比较著名的网站2006年的调查结果显示,Prototype同框架规模庞大的Yahoo! User Interface,Goog le Web Toolkit,and Atlas.等相比较起来,其排名竟然遥遥领先,这不能不令人感到惊异。

答案很简单:Prototype使用起来就像是对于JavaScript语言的自然扩展。

尝试过Prototype框架后,笔者几乎坚信Prototype框架应该被纳入JavaScript语言。

Prototype中包含了一个功能强大好用的Ajax框架,Prototype是一个基础性的框架,很多更高层次的框架都以它为基础,例如scriptaculous效果库。

Prototype框架以面向对象的方式封装JavaScript代码,其封装文件为prototype. js。

使用prototype.js可以大大简化客户端代码的开发工作。

prototype.js引入了类的概念,用其编写的类可以定义一个initialize的初始化函数,在创建类实例的时候会首先调用这个初始化函数。

正如其名字,prototype.js的核心还是prototype,虽然提供了很多可复用的代码,但没有从根本上解决JavaScript的开发和维护问题。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

JSP简介JSP简介JSP技术使用Java编程语言编写类XML的tags和scriptlets,来封装产生动态网页的处理逻辑。

网页还能通过tags和scriptlets访问存在于服务端的资源的应用逻辑。

JSP将网页逻辑与网页设计和显示分离,支持可重用的基于组件的设计,使基于Web的应用程序的开发变得迅速和容易。

Web服务器在遇到访问JSP网页的请求时,首先执行其中的程序段,然后将执行结果连同JSP文件中的HTML代码一起返回给客户。

插入的Java程序段可以操作数据库、重新定向网页等,以实现建立动态网页所需要的功能。

JSP与Java Servlet一样,是在服务器端执行的,通常返回给客户端的就是一个HTML 文本,因此客户端只要有浏览器就能浏览。

JSP的1.0规范的最后版本是1999年9月推出的,12月又推出了1.1规范。

目前较新的是JSP1.2规范,JSP2.0规范的征求意见稿也已出台。

JSP页面由HTML代码和嵌入其中的Java代码所组成。

服务器在页面被客户端请求以后对这些Java代码进行处理,然后将生成的HTML页面返回给客户端的浏览器。

Java Servlet 是JSP的技术基础,而且大型的Web应用程序的开发需要Java Servlet 和JSP配合才能完成。

JSP具备了Java技术的简单易用,完全的面向对象,具有平台无关性且安全可靠,主要面向因特网的所有特点。

自JSP推出后,众多大公司都支持JSP技术的服务器,如IBM、Oracle、Bea公司等,所以JSP迅速成为商业应用的服务器端语言。

JSP可用一种简单易懂的等式表示为:HTML+Java=JSP。

JSP框架介绍WebWorkWebWork是由OpenSymphony组织开发的,致力于组件化和代码重用的拉出式MVC模式J2EE Web框架。

WebWork目前最新版本是2.1,现在的WebWork2.x前身是Rickard Oberg开发的WebWork,但现在WebWork已经被拆分成了Xwork1和WebWork2两个项目。

Xwork简洁、灵活功能强大,它是一个标准的Command模式实现,并且完全从web层脱离出来。

Xwork提供了很多核心功能:前端拦截机(interceptor),运行时表单属性验证,类型转换,强大的表达式语言(OGNL –theObject Graph Notation Language),IoC(Inversion of Control倒置控制)容器等。

WebWork2建立在Xwork之上,处理HTTP的响应和请求。

WebWork2使用ServletDispatcher将HTTP请求的变成Action(业务层Action类), session(会话)application(应用程序)范围的映射,request请求参数映射。

WebWork2支持多视图表示,视图部分可以使用JSP, Velocity, FreeMarker, JasperReports,XML等。

在WebWork2.2中添加了对AJAX的支持,这支持?**菇ㄔ贒WR与Dojo这两个框架的基础之上.【EclipseWork:用于WebWork辅助开发的一个Eclipse插件】StrutsStruts是一个基于Sun J2EE平台的MVC框架,主要是采用Servlet和JSP技术来实现的。

由于Struts能充分满足应用开发的需求,简单易用,敏捷迅速,在过去的一年中颇受关注。

Struts把Servlet、JSP、自定义标签和信息资源(message resources)整合到一个统一的框架中,开发人员利用其进行开发时不用再自己编码实现全套MVC模式,极大的节省了时间,所以说Struts是一个非常不错的应用框架。

【StrutsIDE:用于Struts辅助开发的一个Eclipse插件】EasyJWebEasyJWeb是基于java技术,应用于WEB应用程序快速开发的MVC框架,框架设计构思来源于国内众多项目实践,框架充分借签了当前主要流行的开源Web框架(Struts、JSF、Tapestry 、Webwork),吸取了其优点及精华,利用Velocity作为模板页面引擎,是一个实现了页面及代码完全分离的MVC开发框架。

是一个能实现中小型Web应用系统快速开发的简易Web框架。

通过EasyJWeb Tools提供的配套开发工具,可以实现基于EasyJWeb框架的Web应用快速开发,包括常用应用软件的代码自生成、数据库添删改查(CRUD)代码生成、自动页面模版生成、配置文件管理等。

框架特点:1、零配文件置支持。

以前我们每接触一个框架,开始总都要被他的配置文件折腾一番。

EasyJWeb实现零配置支持,可以不写一句配置文件就在框架基础上构建你的运用。

(适合小型网站系统)。

2、简易的模板页面设计支持:放弃使用jsp,使用简单Velocity脚本语言作为页面模板。

3、页面程序完全分离:实现显示页面与程序逻辑的完全分离,克服了传统jsp页面难于维护的问题。

4、基于页面组件的框架。

灵活的页面组件配置,可以直接通过配置文件设置字段级的5、快速开发支持:通过EasyJWeb Tools,可以自动生成应用软件模板代码,定制并管理自己的J2EE代码模板,代码生成模板支持最流行的实用Java开发框架(如hibernate、Spring等)实现快速开发。

Tapestry Tapestry是一个开源的基于servlet的应用程序框架,它使用组件对象模型来创建动态的,交互的web应用。

一个组件就是任意一个带有jwcid属性的html标记。

其中jwc的意思是Java Web Component。

Tapestry使得java代码与html完全分离,利用这个框架开发大型应用变得轻而易举。

并且开发的应用很容易维护和升级。

Tapestry支持本地化,其错误报告也很详细。

Tapestry主要利用javabean和xml技术进行开发。

【Spindle:Tapestry辅助开发Eclipse插件】.CocoonStefano Mazzocchi于1999年1月创建了Cocoon项目,将其作为ASF之下的开放源代码项目。

Cocoon的目标是帮助分离内容格式、逻辑和对基于XML网站的管理功能。

Cocoon使用XML, Extensible Stylesheet Language Transformations (XSLT), 以及Simple API for XML (SAX) 技术,以帮助创建、部署和维护XML服务器应用程序。

它支持大多数类型的数据源,包括RDBMS、LDAP和文件系统。

在Eclipseh 下进行开发的插件Echo Echo是为用Java开发Web应用程序提供的一个面向对象,事件驱动的框架。

使用Echo 框架来编程类似于使用Swing API来开发应用程序或applets 。

TurbineTurbine是基于Servlet的框架包,也是开放源代码Jakarta项目。

目前还没有关于Turbine 的大量文档。

它类似于Struts,但是有一些主要区别。

突出的一点就是它并没有与JSP耦合。

Turbine的特点是它提供了大量可重用的组件。

此框架包中包含了大量组件,但是这些组件是离散的。

它似乎应该给出更多的组件库,但是由于它缺少文档,所以很难掌握完整的体系结构。

MyFacesMyFaces是JavaServer(tm) Faces(JSF) Web框架(JSR 127)的一个实现。

JavaServer(tm) Faces Web框架是一个新的实现MVC模式的规范.它可以与Struts框架相媲美甚至的一些特性与观念已经超过了Struts.【FacesIDE:Eclipse下的一个辅助开发插件】.JPublish是一个功能强大的Web发布系统,设计为确保开发者角色的清晰的分离。

JPublish 支持多模板引擎,包括Jakarta Apache's Velocity, FreeMarkerand WebMacro。

JPublish支持众多脚本语言,包括Python, BeanShell, and JavaScript。

JappleJapple是一个建造Web应用程序和服务的快速应用程序开发环境。

Japple在Java2平台和开放标准之上建造,和传统方法相比可以让你更快、更容易、更有效地开发和部署Web应用程序。

Jaffa 是为快速应用程序开发提供的一个企业Java框架。

JAFFA 是一个Java Web应用程序开发框架,用基于MVC为基础的Web窗口部件来扩展现存的项目。

AnvilAnvil是一个基于Java的为Web程序开发的平台,独立或伺服式都是可部署的。

它包括大量功能齐全的面向对象的编程语言。

语言的一个子集也可用于一个以tag为基础的模板语言。

所有的脚本和模板都被汇编为Java比特代码。

SiteMeshOS(OpenSymphony)的SiteMesh是一个用来在JSP中实现页面布局和装饰(layout and decoration)的框架组件,能够帮助网站开发人员较容易实现页面中动态内容和静态装饰外观的分离。

BarracudaBarracuda是一个HTML DOM Component + Event/Listener结构的框架。

根据模板文件或配置文件生成静态Java类,并在代码中使用这些生成类,Barracuda需要用XMLC项目把所有的HTML或WML模板文件,静态编译成DOM结构的Java类,作为页面组件。

XMLC会根据HTML元素的id定义,生成相应DOM结点的简便操作方法。

Barracuda的事件类也需要用Barracuda Event Builder工具把event.xml编译成Java类,引入到工程中。

Barracuda直接用Java类的继承关系映射事件之间的父子层次关系。

比如,ChildEvent是ParentEvent的子类。

Barracuda的事件分为两类:Request Events(Control Events)和Response Events(View Events)。

Barracuda事件处理过程类似于Windows系统消息队列的处理机制。

MaverickMaverick是一个轻量而完备的MVC Model 2框架。

Maverick的Action称作Controller。

Controller只接受一个ControllerContext参数。

request,response,servlet config, servelt context等输入信息都包装在ControllerContext里面,而且Model也通过ControllerContext的model属性返回。

相关文档
最新文档