JSPC(j)ĸNܛİ汾̖Ƕ,
Apache 2.0.52
Tomcat 5.5.20
MySQL 4.1.7
PHP 4.3.9
Zend 2.5.0
JDK 1.5.0_10
JDBC mysql-connector-java-5.0.4
JSPC(j)Ƿ֧Struts
JSPC(j)֧Struts(yng),strutsP(gun)ļҪÑԼς,
JSPC(j)֧ЩʽURL,
Ŀǰjava̓MC(j)ֻ֧2Nʽ
·ԡ/servlet/_^
ļ.jspY(ji)β
ļ.doY(ji)β
JSPC(j)Ƿ֧jspsmart.upload,Ҫעĵطô
˾JSPC(j)֧jspsmart.upload
JSPC(j)Ƿ֧javamail,
˾JSPC(j)֧javamail(yng),
JSPC(j)朽Ӕ(sh)(j)죿
҂hʹJDBC朽MySQL(sh)(j),]Ñվc(yng)øвͬ,Ŀǰ˾߀δƳͨõBӳعÑʹáҪʹÔ(sh)(j)朽ӳ,҂hԼ(chung),
Tomcatϵy(tng)ԎjarЩ
JSPC(j)Ԏjar,Ոעcļa(chn)_ͻ,
commons-el.jar
jasper-compiler.jar
jasper-runtime.jar
jsp-api.jar
mysql-connector-java-5.0.4-bin.jar
naming-factory.jar
naming-java.jar
naming-resources.jar
servlet-api.jar
JSPC(j)ڰȫ_Щ(qun)ޣ
S java.util.PropertyPermission "jaxp.debug", "read"
S java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"
S java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*"
S java.lang.RuntimePermission "getProtectionDomain"
S java.lang.RuntimePermission "accessDeclaredMembers"
S java.lang.reflect.ReflectPermission "suppressAccessChecks"
S java.lang.reflect.ReflectPermission "invoke.*"
S java.util.PropertyPermission "*", "read"
S java.security.SecurityPermission "putProviderProperty.SunJCE"
S java.security.SecurityPermission "insertProvider.SunJCE"
S java.io.FilePermission "/home/ÑC(j)/-", "read, write, delete, execute"
JSPC(j)ֹÑֱ{(dio)Щ,
JSPC(j)ֹÑ{(dio)ַ_^package,@ЩTomcatĵĎļһÑʹõ,ÑվcϳF(xin)˽ֹLϢOпÑςTomcatϵy(tng),Ո͑z WEN-INF/libĿ䛣ȥTomcatϵy(tng)Ԏjar,
sun.
org.apache.catalina.
org.apache.coyote.
org.apache.tomcat.
org.apache.jasper.
sun.beans.
jsp\,
F(xin)404e`Ҳj(lu)spļr,web.xmle`,JSPļܱ(zh)СҪ,
ʲôF(xin) java.security.AccessControlException: access deniede`,
ԭЃc
]Ы@_ę(qun)rLϵy(tng)YԴ,hҪę(qun),վcĿǾx,h(qun),
ϵy(tng)(qun)(jng)zo`ԳF(xin)access deniedF(xin),ܿĴa(zh)ЕrҪę(qun)˾C(j)ĬJ(rn)Sķ,Ոա˾JSPC(j)_ŵę(qun)бijԲܽQ}Ժϵy(tng)T(lin)ϵ,TzĴa,oȫ[ŌԱCij\,
JSP̓MC(j)servletʾ.
аindex.jspweb.xml,HelloWorld.classļ,քeςվcĿ
/wwwroot/index.jsp
/wwwroot/WEB-INF/web.xml
/wwwroot/WEB-INF/classes/HelloWorld.class
ςL http://yourdomain/
£
1web.xml
<?xml version="1.0" ?>
<web-app>
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>
2index.jspļ
<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>The current time : <%= new java.util.Date() %>.</p>
<p>To run the servlet example <a href="/servlet/HelloWorld">click here</a>.</p>
</body>
</html>
3HelloWorld.javaԴļ,ҪڱؾgHellWorld.class
// Filename : HelloWorld.java
// Description : This servlet says hello!
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet ( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("");
out.println("Hello, World!");
out.println("");
out.println("Hello, World !");
out.println("This is my first servlet.");
out.println("");
}// end doGet
}
//code end
13JSPC(j)վcĿf
/wwwrootĿ䛴оW(wng)ļ,jsp/php/htmlȸʽļ,
/WEB-INF/web.xml Web(yng)óļ@һXMLļ, servlet đ(yng)ýMüҎ(gu)t,
/WEB-INF/classes/ @Ŀ䛰վcõ class ļ servlet class ͷservlet class,ܰ .jarļ,վcĴҎ(gu)t(yng)ԓJ(rn)avaĴҎ(gu)t(zh)С磺 һ com.mycompany.mypackage.MyServlet, 㑪(yng)ԓʽ /WEB-INF/classes/com/mycompany/mypackage/MyServlet.class ,
/WEB-INF/lib/ Ŀ䛴ŴwnjarļҪעDzܴÑԼservletjarļ,cϵy(tng)_ͻ,(do)tomcatojsp
eѣ
/WEB-INF/classes//WEB-INF/lib @ɂĿ䛺еļϵy(tng)횵,܄h,t(do)(yng)óo{(dio)ãՈÑע,