jsp基础

声明:<%! int i = 0; %>
表达式:<%= numguess.getHint() %>

包含静态文件:<%@ include file="relativeURL" %>
paege指令:
<%@ page 
[ language="java" ] 
[ extends="package.class" ] 
[ import="{package.class | package.*}, ..." ] 
[ session="true | false" ] 
[ buffer="none | 8kb | sizekb" ] 
[ autoFlush="true | false" ] 
[ isThreadSafe="true | false" ] 
[ info="text" ] 
[ errorPage="relativeURL" ] 
[ contentType="mimeType [ ;charset=characterSet ]" | "text/html ; charset=ISO-8859-1" ] 
[ isErrorPage="true | false" ] 
%> 

<%jsp:forwrad%>:
<jsp:forward page="/servlet/login" /> 
<jsp:forward page="/servlet/login"> 
<jsp:param name="username" value="jsmith" /> 
</jsp:forward> 

Bean::
<jsp:useBean id="calendar" scope="page" class="employee.Calendar" /> 
<h2> 
<jsp:setProperty name="mybean" property="*" /> 
<jsp:setProperty name="mybean" property="username" /> 
<jsp:setProperty name="mybean" property="username" value="Steve" /> 
Calendar of <jsp:getProperty name="calendar" property="username" /> 
</h2> 

<%jsp:include %>:静态和动态
<jsp:include page="scripts/login.jsp" /> 
<jsp:include page="copyright.html" /> 
<jsp:include page="/index.html" /> 
<jsp:include page="scripts/login.jsp"> 
<jsp:param name="username" value="jsmith" /> 
</jsp:include> 

<%jsp:plugin  %>
<jsp:plugin 
type="bean | applet" 
code="classFileName" 
codebase="classFileDirectoryName" 
[ name="instanceName" ] 
[ archive="URIToArchive, ..." ] 
[ align="bottom | top | middle | left | right" ] 
[ height="displayPixels" ] 
[ width="displayPixels" ] 
[ hspace="leftRightPixels" ] 
[ vspace="topBottomPixels" ] 
[ jreversion="JREVersionNumber | 1.1" ] 
[ nspluginurl="URLToPlugin" ] 
[ iepluginurl="URLToPlugin" ] > 
[ <jsp:params> 
[ <jsp:param name="parameterName" value="{parameterValue | <%= expression %>}" /> ]+ 
</jsp:params> ] 

[ <jsp:fallback> text message for user </jsp:fallback> ] 

</jsp:plugin> 



你可能感兴趣的:(html,jsp,bean,servlet)