JSP和JSTL有什么区别? [英] What is the difference between the JSP and the JSTL?

查看:63
本文介绍了JSP和JSTL有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前已经了解过servlet和JSP,但是我不知道JSTL是什么,以及JSP和JSTL之间的区别.

I have learned about servlets and the JSP's before, but I don't know what is the JSTL and the difference between the JSP and the JSTL.

推荐答案

JSP是一项类似于ASP的技术,它使您可以将Java代码嵌入HTML页面中.可以通过<%%>块或JSP标记来插入此代码.通常,第一个选项比第一个选项更可取,因为标签可以更好地适应HTML自己的标签表示形式,因此您的页面看起来更具可读性. JSP甚至允许您定义自己的标记(您必须编写实际上在Java中实现这些标记逻辑的代码). JSTL 只是Sun提供的标准标记库(嗯,现在是Oracle)来执行常见任务(例如循环,格式化等).

JSP is a technology similar to ASP that let you embed Java code inside HTML pages. This code can be inserted by means of <% %> blocks or by means of JSP tags. The last option is generally preferred over the first one, since tags adapt better to own tag representation form of HTML, so your pages will look more readable. JSP lets you even define your own tags (you must write the code that actually implement the logic of those tags in Java). JSTL is just a standard tag library provided by Sun (well, now Oracle) to carry out common tasks (such as looping, formatting, etc.).

这篇关于JSP和JSTL有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆