Java EE Web开发,我从哪里开始,我需要什么技能? [英] Java EE web development, where do I start and what skills do I need?

查看:163
本文介绍了Java EE Web开发,我从哪里开始,我需要什么技能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习,至少在基础层面,如何构建Java Web应用程序(来自.NET背景)。我希望能够从头开始构建,部署一个简单的CMS类型应用程序。

I want to learn, at least at a basic level, how to build Java web applications (coming from a .NET background). I would like to be able to build, deploy a simple CMS type application from the ground up.

我究竟需要学习什么?

Tomcat似乎是一个很好的Java Web服务器。

Tomcat seems to be a good web server for Java.

网络有哪些选项?我知道有一个ORM的 Hibernate

What options are there for the web? I know there is Hibernate for an ORM.

Java有MVC吗?那么 JSP 呢? MVC和JSP可以在一起吗? NetBeans

Does Java have MVC? What about JSP? Can MVC and JSP be together? NetBeans?

也许是一本书涵盖所有这些?

Maybe a book that covers all of these?

推荐答案

(2018年9月更新)


我到底需要学习什么?

我认为你已经熟悉了 HTML CSS JS ,所以我不会详细介绍。我还假设你已经熟悉了基本的Java。关注Oracle的 Java教程,如果可能的话,去一个 OCA书籍或课程。

I assume that you're already familiar with client side technologies like HTML, CSS and JS, so I won't go in detail with that. I also assume that you're already familiar with basic Java. Follow Oracle's The Java Tutorials and if possible, go get a OCA book or course as well.

然后,您可以从JSP / Servlet开始学习Java Web开发的基本概念。可以在Oracle的 Java EE 5教程第二部分第3章 - 中找到好的教程 - 8 和Coreservlets.com(初级中级和< a href =http://courses.coreservlets.com/Course-Materials/msajsp.html =nofollow noreferrer>高级,还有JDBC )。请注意,自Java EE 6起, JSP从Java EE教程中删除,转而使用JSF 从那时起,JSP基本上没有改变。这就是为什么你可以安全地使用相当旧的Java EE 5教程。关于JSP最重要的事情是使用<% scriptlets %> 自2003年以来正式受到劝阻。另请参阅如何避免使用Java代码JSP文件?因此,任何仍然包含scriptlet的教程都应该被忽略,因为它们肯定会让你陷入学习不良行为的恶性循环中。

Then you can start with JSP/Servlet to learn the basic concepts of Java web development. Good tutorials can be found in Oracle's Java EE 5 tutorial part II chapters 3 - 8 and at Coreservlets.com (Beginner-Intermediate and Advanced, also JDBC). Note that since Java EE 6, JSP is removed from the Java EE tutorial in favor of JSF and that JSP has basically not changed since then. That's why you could safely use the fairly old Java EE 5 tutorial for this. Most important thing with regard to JSP is the fact that writing plain Java code in JSP files using <% scriptlets %> is officially discouraged since 2003. See also How to avoid Java code in JSP files? So any tutorials which still cover scriptlets should be skipped as they will definitely take you into a downward spiral of learning bad practices.

我们也有关于 JSP 的精彩维基页面Servlets JSTL EL ,您可以在那里学习必需品并找到更多有用的链接。

We have also nice wiki pages about JSP, Servlets, JSTL and EL where you can learn the essentials and find more useful links.


Tomcat似乎是一个很好的Java Web服务器。

它是。但是它的能力有限。它基本上是一个准系统servlet容器,只实现巨大的Java EE API的JSP / Servlet部分。如果你想进入EJB或JPA,那么你想选择另一个,例如 WildFly TomEE Payara Liberty WebLogic ,否则你必须使用Spring而不是Java EE。在没有修改核心引擎的情况下,无法在完整的servlet容器中安装EJB,如果Tomcat基本上重新发明了TomEE。另请参见 Java EE究竟是什么?

It is. It is however limited in capabilities. It's basically a barebones servlet container, implementing only the JSP/Servlet parts of the huge Java EE API. If you ever want to go EJB or JPA, then you'd like to pick another, e.g. WildFly, TomEE, Payara, Liberty, WebLogic, etc. Otherwise you have to use Spring instead of Java EE. It's namely not possible to install EJB in a barebones servlet container without modifying the core engine, you'd in case of Tomcat basically be reinventing TomEE. See also What exactly is Java EE?


我知道ORM有Hibernate。

以前,在J2EE时代,当JPA不存在且EJB2很糟糕时,Hibernate是一个独立的框架,经常与Spring结合使用来取代EJB。自Java EE 5(2006)中引入JPA以来,Hibernate已成为JPA实现。您可以在 Java EE教程第八部分中学习JPA。此外,基于从Spring学到的经验教训,EJB3得到了很大改进。另请参见何时需要或方便地将Spring或EJB3或所有这些一起使用?

Previously, during the J2EE era, when JPA didn't exist and EJB2 was terrible, Hibernate was a standalone framework and often used in combination with Spring to supplant EJB. Since the introduction of JPA in Java EE 5 (2006), Hibernate has become a JPA implementation. You can learn JPA at Java EE tutorial part VIII. Also, EJB3 was much improved based on lessons learnt from Spring. See also When is it necessary or convenient to use Spring or EJB3 or all of them together?


Java有MVC吗? JSP怎么样? MVC和JSP可以在一起吗? JavaBeans?

你可以,但是当谈到这个问题时,很多重新发明轮子用视图绑定模型(转换,验证,更改侦听器等)。 Java EE的MVC框架称为 JSF 。在Java EE 6之前,它曾经在JSP上运行,这是一种相当传统的视图技术。 JSP已被 Facelets 取代。您可以在 Java EE教程第III部分第7-17章中学习JSF。顺便说一下,你也可以在Tomcat上使用JSF,你只需要单独安装它。有关安装说明,请访问 Mojarra主页。 WildFly,TomEE,Payara,Liberty,WebLogic等作为一个完整的Java EE实现已经开箱即用,提供了JSF(以及CDI,BV,JSONP,JAX-RS,EJB,JPA等),因此您不需要单独安装。另请参见如何通过Maven正确安装和配置JSF库?

You can, but that's a lot of reinvention of the wheel when it comes to tying the model with the view (conversion, validation, change listeners, etc). Java EE's MVC framework is called JSF. Prior to Java EE 6 it used to run on JSP, which is a fairly legacy view technology. JSP is been replaced by Facelets. You can learn JSF at Java EE tutorial part III chapters 7 - 17. You can by the way also use JSF on Tomcat, you only have to install it separately. Installation instructions can be found at Mojarra homepage. WildFly, TomEE, Payara, Liberty, WebLogic, etc as being a complete Java EE implementation already provide JSF (and CDI, BV, JSONP, JAX-RS, EJB, JPA, etc) out the box, so you don't need to install it separately. See also How to properly install and configure JSF libraries via Maven?


也许是一本涵盖所有这些内容的书?

有几本书。我建议首先阅读一本书一般的Java EE,一本书更专注于JSF 和一本书更专注于JPA 。确保您选择涵盖主题的最新书籍。因此,不是Java EE 5或JSF 1.0左右的旧书。

There are several books. I would recommend to start with a book focused on Java EE in general, a book more focused on JSF, and a book more focused on JPA. Ensure that you choose the most recent book covering the subject. Thus not an old book for Java EE 5 or JSF 1.0 or so.

最后但并非最不重要的是,请忽略由业余爱好者维护的代码片段抓取网站,主要关注广告收入而不是教学,如roseindia,tutorialspoint,javabeat,journaldev,javatpoint,codejava等。通过令人不安的广告链接/横幅和包含 scriptlet 的JSP代码片段,可以轻松识别它们。

Last but not least, please ignore code snippet scraping sites maintained by amateurs with primary focus on advertisement income instead of on teaching, such as roseindia, tutorialspoint, javabeat, journaldev, javatpoint, codejava, etc. They are easily recognizable by disturbing advertising links/banners and JSP code snippets containing scriptlets.

这篇关于Java EE Web开发,我从哪里开始,我需要什么技能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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