官方JSP教程在哪里 [英] Where's the official JSP tutorial

查看:129
本文介绍了官方JSP教程在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在必须记住如何创建自定义标签库,而且由于我使用servlet 3.0,我决定看到官方的JavaEE6教程。令我惊讶的是,在 JavaEE6教程中没有关于JSP的内容。



另一方面,中有足够的信息JavaEE5教程



似乎JSF现在被认为是JavaEE中唯一的视图技术,尽管我不知道JSP被弃用( q1



我试图搜索一个单独的教程,但该网站是一团糟(我发现一个关于JSP的页面,但它仍然说Java 2平台,企业版。



所以, q2 :JavaEE6的官方JSP教程在哪里。

(我当然会使用JavaEE5教程,但它似乎很奇怪)

解决方案


似乎JSF现在被认为是JavaEE中唯一的视图技术,尽管我不知道JSP被弃用(q1:是吗?) p>

JSF不是视图技术,JSF是一个基于组件的MVC框架,JSP为bei FaceView中成功的Java EE 6中的视图技术。 Java EE 6教程Facelets简介介绍如下: / p>


以前用作JavaServer Faces的演示技术的JavaServer Pages(JSP)技术不支持JavaServer Faces 2.0中可用的所有新功能。 JSP技术被认为是JavaServer Faces 2.0不推荐的演示技术。 Facelets是JavaServer Faces规范的一部分,也是构建基于JavaServer Faces技术的应用程序的首选演示技术。

确实没有任何明确的说法,对于Java EE,它完全不使用纯粹的JSP。 Oracle可能会尝试推送JSF。其中绝对有自己的优势。应该注意的是,Facelets还可以作为独立视图技术与其他servlet结合使用,而不是由第三方请求的MVC框架本身或提供的 FacesServlet (仅限于没有需要JSP taglib的)。您可以在 *。xhtml 上映射 FacesServlet ,并且基本上只需单独使用 ui:xxx> 标签(而不是传统JSP中的< jsp:xxx> )与普通的vanilla HTML相结合,就像你一样在JSP中做在使用Facelets时,您不一定需要 JSF核心和html标签。


我试过搜索一个单独的教程,但该网站是一个混乱(我发现一个关于JSP的页面,但它仍然说Java 2平台,企业版。所以,q2:JavaEE6的官方JSP教程在哪里。 >


没有,只需抓住 Java EE 5 one 或甚至 J2EE 1.4一个,JSP没有改变,JSP 2.2基本上没有什么比JSP 2.1更新,EL 2.2只有一个主要的改变(支持方法参数)与JSP 2.0相比,同样的故事也适用于JSP 2.1,主要变化仅在于EL(对于从JSF 1.0 / 1.1接管的延期EL的支持)。


$ b $你不要通过Java EE 5教程学习JSP时,不要害羞,更不用说J2EE 1.4教程了。您应该不要再进一步回到JSP 1.2 / J2EE 1.3或之前,那就是JSP中不存在EL。你不想这样做:)


I now have to remember how to create custom tag libraries, and since I'm using servlet 3.0 I decided to see the official JavaEE6 tutorial. Much to my surprise there is nothing about JSP in the JavaEE6 tutorial.

On the other hand, there's sufficient information in the JavaEE5 tutorial.

It seems JSF is now considered the only view technology in JavaEE, although I'm not aware of JSP being deprecated (q1: is it?).

I tried to search for a separate tutorial, but the site is a mess (I found a page about JSP, but it still says "Java 2 platform, enterprise edition".

So, q2: where is the official JSP tutorial for JavaEE6.

(I'll of course use the JavaEE5 tutorial, but it just seems weird)

解决方案

It seems JSF is now considered the only view technology in JavaEE, although I'm not aware of JSP being deprecated (q1: is it?).

JSF is not a view technology. JSF is a component based MVC framework. JSP as being a view technology is in Java EE 6 succeeded by Facelets. The Facelets introduction in Java EE 6 tutorial states the following:

JavaServer Pages (JSP) technology, previously used as the presentation technology for JavaServer Faces, does not support all the new features available in JavaServer Faces 2.0. JSP technology is considered to be a deprecated presentation technology for JavaServer Faces 2.0. Facelets is a part of the JavaServer Faces specification and also the preferred presentation technology for building JavaServer Faces technology-based applications.

It does indeed nowhere explicitly say that "pure" JSP at its whole own is deprecated for Java EE. Oracle is this way likely trying to push JSF forward. Which has admittedly its own advantages. Noted should be that Facelets can also be used as a standalone view technology in combination with other servlets than the FacesServlet, either homegrown or provided by a 3rd party request based MVC framework (only ones without the need for JSP taglibs). You can just map the FacesServlet on *.xhtml and basically just use alone the <ui:xxx> tags (instead of the <jsp:xxx> ones in legacy JSP) in combination with plain vanilla HTML like as you would do in JSP. You do not necessarily need the JSF core and html tags when working with Facelets.

I tried to search for a separate tutorial, but the site is a mess (I found a page about JSP, but it still says "Java 2 platform, enterprise edition". So, q2: where is the official JSP tutorial for JavaEE6.

There's none. Just grab the Java EE 5 one or even the J2EE 1.4 one. JSP has not changed that much anyway. There's basically nothing new in JSP 2.2 as compared to JSP 2.1. EL 2.2 has only one major change (the support for method arguments). The same story applies to JSP 2.1 as compared to JSP 2.0. The major changes were in EL only (the support for deferred EL, which is taken over from JSF 1.0/1.1).

You don't need to be shy when learning JSP by Java EE 5 tutorial, let alone by J2EE 1.4 tutorial. You should only not go further back to JSP 1.2 / J2EE 1.3 or before, that's when EL didn't exist in JSP. You don't want to have that :)

这篇关于官方JSP教程在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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