java - JSP页面HTML标签中可以嵌入JSTL?
阿神
阿神 2017-04-18 09:22:46
0
4
761

为什么在<input>标签中能写JSTL代码?

<input type="text" class="span12" name="loginname" autocomplete="off"                                                        <c:if test="${loginname!=null}">value="${loginname}"</c:if> placeholder="邮箱/用户名/已验证手机" /> 
阿神
阿神

闭关修行中......

reply all(4)
巴扎黑

JSP标准标签库(JSP Standard Tag Library,JSTL)是一个JSP标签集合,它封装了JSP应用的通用核心功能。和JSP里面的标签是可以一起使用的,而JSP包含静态部分(标准的HTML标签、静态的页面内容等)和动态内容(Java程序控制的内容),实际上JSPServlet的一种特殊的形式,每一个JSP的页面就是一个Servlet的实例。所以在<input>标签里面加入JSTL代码,等同于完成一个完成的业务逻辑Servlet, the two can be used together.

小葫芦

Because the jsp file will be compiled into a java class by the servlet container when it is requested for the first time, the JSTL in it will be compiled and converted.

洪涛

tomcat will read the jsp file and parse the non-html tags in the jsp. Like here, tomcat will read this <c:if test=></c:if> code and parse it with a parser (file header taglib corresponding class), in the final analysis, jsp will be converted into outputstream (standard html code) through tomcat compile to client (ie, ff, chrome)

刘奇

Jstl codes have a fixed format and writing method when writing. They will first be parsed by servlet containers such as tomcat to generate corresponding result data. This process occurs on the server side; while html tag parsing occurs on the browser side

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!