Pure JSP


 

C_One	Over_view

Note: The first time the file is requested,it is compiled into a servlet object and stored in memory,and the output is sent back to the requesting client.After the first request,the server checks to see whether the *.jsp file has changed.If it has not changed,then the server invokes the previously compiled servlet object.

Note:A key thing to remember about JSPs is that they are just servlets that are created from a combination of HTML text and Java source code.This means that they contain all the functionality of a normal servlet.

Directives
Directives are JSP elements that provide global information about an entire JSP page.

The page Directive

<%@page language="java"%>

The inluce Directive

<%@include file="relativeURLspec"%>

The taglib Directive
<%@taglib uri="tagLibraryURI"prefix="tagPrefix"%>

Actions
Actions provide an abstraction that can be used to easily encapsulate common tasks.They typically create
or act on objects,normally JavaBeans.The JSP technology provides some standard actions.These
actions are defined in the following sections

<jsp:useBean>
<jsp:setProperty>
<jsp:getProperty>
<jsp:include>
<jsp:forward>
<jsp:param>
<jsp:plugin>

Implicit Objects
As a JSP author,you have access to certain implicit objects that are available for use in JSP documents,
without being declared first.To satisfy the JSP specification,all JSP scripting languages must provide
access to the objects 

JSP Scripting
JSP scripting is a mechanism for embedding code fragments directly into an HTML page.There are three
scripting language elements involved in JSP scripting.Each of these JSP scripting elements has its
appropriate location in the generated servlet.In this section we will look at these elements and how
together they will result in a complete servlet.
Declarations   
<%!declaration%>
A sample variable declaration using this syntax is declared here:
<%!String name=new String("BOB");%>
A sample method declaration using the same syntax is declared as follows:
<%!public String getName(){return name;}%>
Expressions
<%=expression%>
A code snippet containing a JSP expression is shown here:
Hello<B><%=getName()%></B>
Scriptlets
<%scriptlet source%>




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值