`
tanglei198577
  • 浏览: 59956 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类

Knowledge of JSP for interview

    博客分类:
  • SSH
阅读更多

Three compile command of JSP: @page,@include,@taglib

<%@page
[language="Java"]
[extends="package.class"] --the parent class should be extended
[import= "package. class | package. *},…"] --import some package for your java code
[session="true | false"] --whether need HTTP sesison
[buffer="none | 8kb | size kb" 1
[autoFlush="true I false"]
[isThread8afe="true | false"]
[info="text"] --Servlet.getServerInfo()
[errorPage="relativeURL"] --when the error or exception thrown,skip to the errorpage pointed.
[contentType="mimeTyPe[ ;charset=characterSet]" | "text/html;charSet=ISO808859-1"]
[isErrorPage=" true | false"]
%>

<%@include file="include.jsp" %>,this is the static command,if the file included always need change
,it should use <jsp:include> which is the dynamic operation.it always check the jsp file included and
The included jsp and the main jsp joined together when output.
All the setttings of page,the object used of Dynamic include should create itself.but they have the same scope
of request.
The static include jsp can use the settings of main jsp,they are a whole servlet.

 

Seven action command:
jsp:forward: make the page redirect,request of handling will go to the page forward.
 <jsp:forward page=" {relativeURL | <%=expression%>}">
 {<jsp:param.../>}
 </jsp:forward>
jsp:param: deliver the params.
jsp:include: Dynamic include a jsp.
jsp:plugin: download the JavaBean or Applet to client server.
jsp:useBean: use JavaBean .
jsp:setProperty: set the propety of JavaBean instance.
jsp:getProperty: get the propety of JavaBean instance.

 

nine object embedded:
application: the instance of javax.servlet.ServletContext,valid in the whole web application
config:the instance of javax.servlet.ServletConfig
exception:the instance of java.lang.Throwable
out:the instance of javax.servlet.jsp.JspWriter
page: 'this' of Servlet
pageContext: the instace of Javax.servlet.jsp.PageContext
request:the instace of javax.servlet.http.HttpServletRequest
response:the instace of javax.servlet.http.HttpServletResponse
session: the instace of javax.servlet.http.HttpSession

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics