JSP directives & standard actions

Three jsp directives

1. the page directive

first, refere the explaination of it in jsp specificiation:

the page directive defines a number of page dependent properties and communicates these to the JSP container.

 this directive is so common that always can  be see in the top of JSP pages, and used just like this:

 

<%@ page contentType="text/html;charset=utf-8" language="java" %>

  the directive above indiciates that the scripting language is based on java, and the MIME type is 'text/html' and the character encoding of output is 'utf-8'.

Now that the directive involved the concept of encoding. i will simply explain the difference between charset and pagEcoding .

 In jsp specificiation, the two conceptions are  described as follows:

contentType

Defines the MIME type and the character encoding for the response of the JSP page, and is also used in determining the  character encoding of the JSP page.
Values are either of the form “TYPE” or “TYPE;charset= CHARSET”with an optional white space after the “;”. “TYPE” is a MIME type, see the IANA registry at http://www.iana.org/assignments/media-types/index.html
for useful values. “CHARSET”, if present, must be the IANA name for a character encoding. The default value for “TYPE” is “text/html” for JSP pages in standard syntax, or “text/xml” for JSP documents in XML syntax. If “CHARSET” is not specified, the response character encoding is determined as described in
Section JSP.4.2, “Response Character Encoding”. See Chapter JSP.4 for complete details on character
encodings.


pageEncoding

Describes the character encoding for the JSP page. The value is of the form “CHARSET”, which must be the IANA name for a character encoding. For JSP pages in standard syntax, the character encoding for the JSP page is the charset given by the pageEncoding attriute if it is present, otherwise the charset given by the contentType attribute if it is present, otherwise “ISO-8859-1”. For JSP documents in XML syntax, the character encoding for the JSP page is determined as described in section 4.3.3 and appendix F.1 of the XML specification. The pageEncoding attribute is not needed for such documents. It is a translation-time error if a document names different encodings in its XML prolog / text declaration and in the pageEncoding attribute. The corresponding JSP configuration element is page-encoding (see Section JSP.3.3.4, “Declaring Page Encodings”). See Chapter JSP.4 for complete details on character encodings.

 as we kown,  JSP page be compiled to servlet in the server side. the value of pageEncoding specifies the encoding would be used to compile the jsp page, otherwise, the web container will make use of the value of file.encoding.  So 'pageEncoding' is the key factor of avoid chinese problem. if we didnt specify it,  the application work correctly when deployed on windows would  occur chinese character problem if was deployed on linux.  On the other side,  ' charset' specifies the encoding of the response of the jsp page. That is to say, the server encoded the data using the encoding specified by 'charset' before sending it to client.

2. the taglib directive

the jsp specificiation defines it as follow:

the taglib directive in a jsp page declares that the page uses a tag library, uniquely identifies the tag library using a URI and associates a tag prefix that will distinguish usage of the actions in the library.

 typically, this directive is necessary if we wanna use JSTL and struts defined tag library in jsp page.

3. the include directive

the include directive is used to substitute text and/or code at JSP page translation-time . It inserts the text of the specified resource into the page or tag file.

 beside the include directive, there is also another way to do the same thing-- using the <jsp:include> action.

A <jsp:include.../> action provides for the inclusion of static and dynamic resources in the same context as the current page.

 So, ws the difference of the two ways ?  Speak in breaf, the include directive would inserts the text of the included resource to the generated servlet when compiling, in contrast, the other would interpret the response of the included file, and plus it to the itself when visiting the page. In another word, the former is suitable for static resource, and the latter  is suitable for both static and dynamic object.  An example usage listed as follows:

<%@ include file=”relativeURI”%>
//the value of flush set to 'true'  indiciates that the buffer is flushed now.
<jsp:include page=”relativeURI” flush=”true” />

 One important point is that the URI of file/page is relatice to the current jsp file/page. If the uri is started with symbol '/' , it means that the uri is relative to the context of web application.

内容概要:本书《Deep Reinforcement Learning with Guaranteed Performance》探讨了基于李雅普诺夫方法的深度强化学习及其在非线性系统最优控制中的应用。书中提出了一种近似最优自适应控制方法,结合泰勒展开、神经网络、估计器设计及滑模控制思想,解决了不同场景下的跟踪控制问题。该方法不仅保证了性能指标的渐近收敛,还确保了跟踪误差的渐近收敛至零。此外,书中还涉及了执行器饱和、冗余解析等问题,并提出了新的冗余解析方法,验证了所提方法的有效性和优越性。 适合人群:研究生及以上学历的研究人员,特别是从事自适应/最优控制、机器人学和动态神经网络领域的学术界和工业界研究人员。 使用场景及目标:①研究非线性系统的最优控制问题,特别是在存在输入约束和系统动力学的情况下;②解决带有参数不确定性的线性和非线性系统的跟踪控制问题;③探索基于李雅普诺夫方法的深度强化学习在非线性系统控制中的应用;④设计和验证针对冗余机械臂的新型冗余解析方法。 其他说明:本书分为七章,每章内容相对独立,便于读者理解。书中不仅提供了理论分析,还通过实际应用(如欠驱动船舶、冗余机械臂)验证了所提方法的有效性。此外,作者鼓励读者通过仿真和实验进一步验证书中提出的理论和技术。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值