?? 0056.htm
字號:
<html>
<head>
<title>新時代軟件教程:操作系統 主頁制作 服務器 設計軟件 網絡技術 編程語言 文字編輯</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body, table {font-size: 9pt; font-family: 宋體}
a {text-decoration:none}
a:hover {color: red;text-decoration:underline}
.1 {background-color: rgb(245,245,245)}
-->
</style>
</head>
<p align="center"><script src="../../1.js"></script></a>
<p align="center"><big><strong>JSP - FAQ (1)</strong></big></p>
<div align="right">摘自互聯網</div>
<p>
Java Server Pages Frequently Asked Questions <br>
<br>
<br>
Maintainer: Richard Vowles, rvowles@esperanto.org.nz (http://www.esperanto.org.nz)<br>
<br>
<br>
<br>
Questions<br>
What is JSP? <br>
What version is the current version of JSP? <br>
Where can I get the specification for JSP? <br>
Who supports JSP? <br>
What books are available for JSP? <br>
Is JSP better than ASP (Microsoft's Active Server Pages)? <br>
What HTML editors support JSP? <br>
Yes, but how does it perform? <br>
How to invoke a JSP page directly from by browser? <br>
How do you invoke a JSP page from a servlet? <br>
How do you pass data (including beans) to a JSP from a servlet? <br>
How can I pool connections to my database? <br>
How do I use other languages in my JSP? <br>
How can I set a cookie in JSP? <br>
Can JSP and Servlet share same Session and Beans? <br>
How do I plug JSP into Microsoft's IIS Web Server? <br>
Are there any newsgroups that discuss JSP? <br>
What do the differing levels of bean storage (page, session, app) mean? <br>
Where can I find the mailing list archives? <br>
What are the important steps in using JDBC in JSP? <br>
How does variable scope work in JSP? <br>
How do I forward to an HTML page? <br>
Are there any white papers or documents explaining how JSP fits? <br>
How to I create dynamic GIFs for my JSP? <br>
Do you know where I could get some code that would encode something to the HTML DTD standard? <br>
What is page compilation? <br>
How are servlets and JSP pages related? <br>
Any good web sites for up to date activities in the Java/JSP/Servlet world? <br>
How do I force a user to log in? <br>
So how can a newbie get started with JSP? <br>
How can I ensure that session objects stay in existence when the web server restarts? <br>
How can I include one JSP inside another JSP? <br>
Is there some sort of event that happens when a session object gets bound or unbound to the session? <br>
Is there a way to execute a JSP from the comandline or from my own application? <br>
What should I use, Model 1 or Model 2? <br>
How do I delete a cookie with JSP? <br>
Are there tips on things to watch out for in JSP? <br>
How do you get started with JSP on the Macintosh? <br>
What Application Servers support JSP? <br>
What happened to the LOOP and DISPLAY tags from JSP 0.92? <br>
Does JSP have a bean providing File Upload features like ActiveX upload control? <br>
So how do I use EJB from JSP? <br>
Can I just abort processing a JSP? <br>
"I'm trying to pass an object between a servlet and a JSP page, but my object is null on the JSP page. What could be wrong?" <br>
<br>
<br>
<br>
<br>
1) What is JSP? TOC <br>
<br>
<br>
JSP is a dynamic scripting capability for web pages that allows Java as well as a few special tags to be embedded into a web file (HTML/XML, etc). The suffix traditionally ends with .jsp to indicate to the web server that the file is a JSP file. JSP is a server side technology - you can't do any client side validation with it.<br>
<br>
JSP files actually get compiled into Servlets, so what is the point? Why not just write Servlets?<br>
<br>
For most people, the benefit is twofold:<br>
<br>
The focus is on HTML. Java and the JSP extensions assist in making the HTML more<br>
functional. Servlets on the other hand allow outputting of HTML but it is a tedious<br>
process. <br>
It is easy to make a change and then let the JSP capability of the Web Server you are<br>
using deal with compiling it into a Servlet and running it. <br>
In the past, people have used servlets because of the problem of redirection - because by the time the JSP engine gets around to writing information back down the HTTP pipe, you could not do a redirect effectively in JSP - leading to the concepts of Model 1 vs Model 2 (see question 38). This has been fixed in JSP 1.0 with the addition of buffered output streams.<br>
<br>
JavaSoft also has a FAQ, covering different questions, and it is located at http://java.sun.com/products/jsp/faq.html.<br>
<br>
2) What version is the current version of JSP? TOC <br>
<br>
<br>
<br>
The current version of JSP is 1.1. It is available from http://java.sun.com/products/jsp.<br>
<br>
The JSP 1.1 is available from http://java.sun.com/products/jsp/techinfo.html.<br>
<br>
The 0.92 spec is available from http://java.sun.com/products/jsp/jsp092.html<br>
<br>
The 0.91 spec is a popular version though, and much software that supports the JSP pre-standard actually supports 0.91 of JSP.<br>
<br>
The 0.91 spec is available from http://www.burridge.net/jsp/Spec91/jsp_spec.html<br>
<br>
3) Where can I get the specification for JSP? TOC <br>
<br>
<br>
<br>
You can get the current spec from http://java.sun.com/products/jsp. This is along with the reference implementation which works with its own web server.<br>
<br>
4) Who supports JSP? TOC <br>
<br>
<br>
<br>
There are the following implementations available:<br>
<br>
Name <br>
Version of JSP Supported <br>
Cost <br>
Comments <br>
JSP Reference 1.1 free TOMCAT - Now included as part of the J2EE Reference Implementation, but also managed by the Jakarta Project as part of Apache. This implementation has a way to go before being ready for production. <br>
GNU JSP 1.0 free, open source, located in CVS at the Giant Java Tree <br>
Sun's Java Web Server 2.0 1.0 commercial Sun's own Java Web Server. Being replaced with iPlanet (Alliance) <br>
PolyJSP 0.92 free, open source PolyJsp is based on XML/XSL and has been designed to be extensible. Now supports WebL Hasn't been updated for a while. <br>
Resin 1.0, 1.1 in beta Unknown Now Open Source. <br>
SJSP 1.1 free for personal use Uses compile time introspection, allows you to replace your existing JSP engine in your web server. <br>
zJSP 0.91 Last updated, Sept 3, 1998 <br>
JRUN 0.92, 1.0 commercial JSP 1.1 support now in beta. <br>
Orion 1.1 commercial Orion is a web application server that implements JSP internally. It also has a lot of JSP vs other JSP and vs ASP stats on its pages. Also supports Servlet 2.2 <br>
ServletExec 1.1 commercial Supports large number of web servers <br>
RocketJSP 1.0 GPL Located in the Giant Java Tree <br>
<br>
<br>
<br>
<br>
5) What books are available for JSP? TOC <br>
<br>
<br>
<br>
There are now a number of books available on JSP from various publishers.<br>
<br>
A quick search of Amazon comes up with<br>
<br>
Professional Java Server Programming: with Servlets, JavaServer Pages (JSP), XML, Enterprise JavaBeans (EJB), JNDI, CORBA, Jini and Javaspaces <br>
Professional Java XML Programming with servlets and JSP <br>
Pure JSP Java Server Pages <br>
Web Development with JavaServer Pages <br>
There is a group of people working on a Web book for JSP - information is located at http://www.esperanto.org.nz/jspbook. There is another at http://www.aptura.com/technology/jspBook_Architectures.html and yet another at Brainopolis.<br>
<br>
6) Is JSP better than ASP (Microsoft's Active Server Pages)? TOC <br>
<br>
<br>
<br>
This is a matter of great debate. Many punters think that JavaSoft has the benefit of hindsight - what works well and what does't. ASP is very complex but supports multiple scripting languages and the ActiveX model of Microsoft. Although ASP _is_ available on many platforms, the ActiveX library support that makes it as powerful as it is is missing and thus makes ActiveX only feasible for an NT platform.<br>
<br>
According to recent statistics (see the RedHat site), 22% of web servers are NT, (21% are Linux), that means there is 78% needing something else, and JSP advocates believe that JSP fits the bill nicely that you very much.<br>
<br>
7) What HTML editors support JSP? TOC <br>
<br>
<br>
<br>
Most of the visual developers do not support JSP in any way, shape or form, they mess up the tags totally. <br>
<br>
The following HTML editors have been known to work with JSP:<br>
<br>
<br>
Product <br>
Location <br>
Comments <br>
HomeSite http://www.allaire.com/ JSP colour coding will be in HS 4.0.1, but you can get a plug in now from http://www.burridge.net/jsp/homesite.html <br>
NetObjects ScriptBuilder 3.0 http://www.netobjects.com/products/html/nsb3.html Win32 product supports JSP <br>
Any text editor <br>
Borland JBuilder 3.5 http://www.borland.com/jbuilder Java Development tool, supports JSP internally, and allows running and debugging of JSPs <br>
DreamWeaver 3 http://www.dreamweaver.com/ Ignores JSP tags, and allows you to edit JSP files as if they are HTML files given you customise the product slightly (you need to edit a special file) <br>
FrontPage 2000 http://www.microsoft.com/frontpage Some reports that Front Page now ignores JSP tags. <br>
<br>
<br>
<br>
8) Yes, but how does it perform? TOC <br>
<br>
<br>
<br>
I have been picking up some comments:<br>
<br>
Brian Burridge, brian_burridge@VALPAK.COM<br>
"Our extranets for 300 franchises, 500+ users, our Intranet for thousands of employees, <br>
and eventually all of our other web sites. New Atlanta has been running for 6 weeks <br>
now without even one problem. Programming in JSP has turned out to be as easy as Perl, <br>
yet all our tests show it to be up to 10x faster."<br>
Also available are a set of benchmarks from the people who make the Orion server, located at http://orion.evermind.net/, and also from the people who do Resin (comparing their JSP implementation with Orion)<br>
<br>
9) How to invoke a JSP page directly from by browser? TOC <br>
<br>
<br>
<br>
JSP files are just like HTML files, so if your index.jsp file is in your root directory of your web site, use http://localhost/index.jsp<br>
<br>
</p>
</table>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -