在 Java EE 6 中制作 Java Web 应用程序需要学习什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1960280/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 01:49:18  来源:igfitidea点击:

What to learn for making Java web applications in Java EE 6?

javajakarta-eeweb-applications

提问by creativz

My goal is to make web applications!

我的目标是制作网络应用程序!

I finished reading the Books "Headfirst - Java" and "Headfirst - Servlets and JSP".

我读完了“Headfirst - Java”和“Headfirst - Servlets and JSP”这本书。

Because this topic (web applications) is so big and complicated, I would like to ask what I should learn next. I feel overstrained when I read catchwords like Java EE, EJB, JSF, JPA, Glassfish ... but I won't give up.

因为这个话题(web应用)又大又复杂,我想问一下我接下来应该学习什么。当我阅读 Java EE、EJB、JSF、JPA、Glassfish 之类的流行词时,我感到压力过大……但我不会放弃。

Can anyone please tell me how I should proceed with learning? Should I grab a book like this: Beginning Java EE 6 Platform with GlassFish 3: From Novice to Professionalor should I just make some Online tutorials?

谁能告诉我我应该如何继续学习?我应该买一本这样的书: 使用 GlassFish 3 开始 Java EE 6 平台:从新手到专业,还是我应该制作一些在线教程?

Thanks!

谢谢!

采纳答案by Pascal Thivent

Even if I know that this will be controversial, my advice would be to start with Java EE 6 only. So, grab GlassFish v3 and either get the book Beginning Java EE 6 Platform with GlassFish 3: From Novice to Professionalor follow the Java EE 6 tutorial. In my opinion, the book (that I've started to read so I know what I'm talking about) provides more guidance which might be preferable if "everything" is new for you (it covers both the Java EE platform and its APIs andthe environment to build, deploy your applications).

即使我知道这会引起争议,我的建议还是只从 Java EE 6 开始。因此,获取 GlassFish v3 并获取使用 GlassFish 3 开始 Java EE 6 平台一书:从新手到专业人士,或者遵循Java EE 6 教程。在我看来,这本书(我已经开始阅读,所以我知道我在说什么)提供了更多的指导,如果“一切”对你来说都是新的,这可能更可取(它涵盖了 Java EE 平台及其 API以及构建、部署应用程序的环境)。

Now, as I said, I can already hear voices saying things like "Java EE is heavy, use Spring instead, learn Struts or Wicket or Stripes for the presentation layer, learn Hibernate for persistence, or not because I don't like ORM, use iBatis or straight JDBC instead (you'll see, it's cool with Spring, Spring is so cooool), and use Tomcat (and why not Jetty), or JBoss, or just forget all this and go for Grails, and bla bla bla...".

现在,正如我所说,我已经可以听到这样的声音:“Java EE 很重,改用 Spring,学习 Struts 或 Wicket 或 Stripes 用于表示层,学习 Hibernate 以获得持久性,或者不因为我不喜欢 ORM,改用 iBatis 或直接的 JDBC(你会看到,Spring 很酷,Spring 太酷了),并使用 Tomcat(为什么不使用 Jetty)或 JBoss,或者只是忘记这一切而选择 Grails,然后 bla bla bla ……”

But I don't think that this is really helping you and, without mentoring or guidance (and you won't find a non outdated unique resource covering all combinations), this must sound very confusing for a beginner.

但是我不认为这真的对您有帮助,而且如果没有指导或指导(并且您不会找到涵盖所有组合的非过时的独特资源),对于初学者来说这听起来一定很混乱。

So, because I think that Java EE 6 is a big improvement over previous versions of Java EE, because it provides really nicestandard APIs for all your needs (Servlet 3.0, JSF 2.0, JPA 2.0, EJB 3.1 lite, Bean Validation 1.0, CDI, etc), because these APIs are all more than decent, because there is nothing really wrong in learning them, because this is already a big task, because you have to start somewhere, I'd focus on Java EE 6 only and forget the other frameworks for now. More precisely, I'd start with the Java EE 6 Web Profile(and then add things if you want to go further).

所以,因为我认为 Java EE 6 比以前版本的 Java EE 有很大的改进,因为它为您的所有需求提供了非常好的标准 API(Servlet 3.0、JSF 2.0、JPA 2.0、EJB 3.1 lite、Bean Validation 1.0、CDI等),因为这些 API 都非常不错,因为学习它们并没有什么错,因为这已经是一项艰巨的任务,因为你必须从某个地方开始,我只会专注于 Java EE 6 而忘记了目前其他框架。更准确地说,我将从Java EE 6 Web Profile 开始(如果您想进一步了解,然后添加内容)。

By doing this, 1) you'll get started and you'll learn brand new things and 2) you'll give some time to all other frameworks and/or tools to adapt and prove that there is still a need for them. And if there is, it will still be time to experiment the survivors and you'll be able to understand much better why they exist.

通过这样做,1) 你会开始,你会学到全新的东西,2) 你会给所有其他框架和/或工具一些时间来适应和证明它们仍然是需要的。如果有的话,仍然需要对幸存者进行实验,您将能够更好地理解它们存在的原因。

回答by danben

For Tomcat, read the manualon the website. It is very good. Particularly, the first few chapters on web app organization and deployment, and the chapters on the Servlets API and JSPs.

对于 Tomcat,请阅读网站上的手册。这很棒。特别是关于 Web 应用程序组织和部署的前几章,以及关于 Servlet API 和 JSP 的章节。

For Spring, the Manning book Spring in Action is very good. Similarly for Hibernate (the Manning book) but I think Hibernate is mostly outside the scope of webapps. Your call, though.

对于 Spring,Manning 的 Spring in Action 一书非常好。类似的 Hibernate(曼宁书)但我认为 Hibernate 主要在 webapps 的范围之外。不过,你的电话。

Wicket - Manning book also. But really, just write your front-end code in Javascript. It will be less painful, IMO.

检票-曼宁书也。但实际上,只需用 Javascript 编写前端代码即可。IMO,它会不那么痛苦。

回答by Will Hartung

Java EE 6 is really amazing. The only problem is that it's about 2 weeks old, and there is only 1 container currently offering it's features -- Glassfish.

Java EE 6 真的很棒。唯一的问题是它已经使用了大约 2 周,目前只有 1 个容器提供它的功能——Glassfish。

I have nothing against Glassfish, I use it all over the place, several production instances, I love the product and the project.

我不反对 Glassfish,我到处使用它,有几个生产实例,我喜欢这个产品和项目。

That said, the details of Java EE 6 do not translate back to Java EE 5. Some do, many do, but the Web Profile, Servlet 3.0, the new Bean types, JPA 2, etc. Those aren't there.

也就是说,Java EE 6 的细节不会转换回 Java EE 5。有些可以,很多可以,但是 Web Profile、Servlet 3.0、新的 Bean 类型、JPA 2 等。这些都不存在。

So, by learning Java EE 6 first, you're simply constraining yourself to a single container. More are coming, but they're not here yet.

因此,通过首先学习 Java EE 6,您只是将自己限制在单个容器中。更多的人来了,但他们还没有来。

Tomcat, JBoss, OpenEJB, Glassfish, Jetty, Resin, Geronimo, etc. all work well with the Java EE 5 spec (at least those parts of the spec that they support, Tomcat doesn't have EJB for example).

Tomcat、JBoss、OpenEJB、Glassfish、Jetty、Resin、Geronimo 等都适用于 Java EE 5 规范(至少它们支持规范的那些部分,例如 Tomcat 没有 EJB)。

I can't think of anything in Java EE 5 that wasn't carried forward to Java EE 6. Java EE 6 made some very old aspects optional, and those you simply wouldn't learn today anyway. Java EE 6 made some Java EE 5 stuff even easier (packaging notably, EJB Lite for example).

我想不出 Java EE 5 中的任何内容都没有被继承到 Java EE 6。Java EE 6 使一些非常古老的方面成为可选的,而这些方面无论如何您今天都学不会。Java EE 6 使一些 Java EE 5 的东西变得更加容易(特别是打包,例如 EJB Lite)。

Learn Java EE 5 now so that you can actually apply what you learn in a variety of environments, rather that learning Java EE 6 now and discovering you may not be able to use much of what you learn.

现在学习 Java EE 5,这样您就可以在各种环境中实际应用所学,而不是现在学习 Java EE 6 并发现您可能无法使用所学的大部分内容。

No single book will teach you what you need to know. Servlets, for example, are a nice foundation, but for anything larger than a couple of pages or endpoint, you will want to use one of the many 3rd party frameworks, or JSF, and no book covers the core and then a framework on top of that.

没有一本书会教你你需要知道的东西。例如,Servlet 是一个很好的基础,但是对于任何大于几个页面或端点的内容,您将需要使用许多 3rd 方框架中的一个或 JSF,并且没有一本书涵盖核心,然后在顶部使用框架其中。

The Java EE 5 tutorial is good at getting the foundations down, my major complaint is that they don't show you the source code. Rather they expect you to just download and run it. It's not discussed in the tutorial. I've found the Head First books to be pretty good.

Java EE 5 教程很擅长打下基础,我的主要抱怨是他们没有向您展示源代码。相反,他们希望您只需下载并运行它。教程中没有讨论。我发现 Head First 的书非常好。

For web programming, raw Servlets are important enough just to understand the request/response cycle but you don't need a deep understanding to make a leap to a 3rd party framework.

对于 Web 编程,原始 Servlet 非常重要,只需了解请求/响应周期即可,但您不需要深入了解即可跳到第 3 方框架。

I'm a big fan of Stripes for an Action framework (vs a component framework), and the single Stripes book available is excellent (making choosing that an easy choice).

我是 Action 框架(相对于组件框架)的 Stripes 的忠实粉丝,并且可用的单一 Stripes 书非常好(使选择成为一个简单的选择)。

I can't suggest a Component framework book, and I actually would not recommend one right off. The component frameworks truly bury the HTTP core request/response structures. They bury them for a reason, and they gain value BY burying them, but I believe to be effective you need to have a solid understanding of these concepts early on. That's why I don't suggest learning a Component framework first.

我不能推荐一本组件框架书,而且我实际上不会立即推荐一本。组件框架真正隐藏了 HTTP 核心请求/响应结构。他们埋葬它们是有原因的,他们通过埋葬它们获得价值,但我认为要有效,你需要尽早对这些概念有充分的了解。这就是为什么我不建议先学习组件框架的原因。

The JAX-RS REST framework, included in Java EE 6, but readily installable in Java EE 5 or any servlet container, is excellent. Arguably it is what Servlet 3.0 should have been. But I don't know any books for that.

JAX-RS REST 框架包含在 Java EE 6 中,但可以轻松安装在 Java EE 5 或任何 servlet 容器中,非常出色。可以说这是 Servlet 3.0 应该有的样子。但我不知道有什么书可以做。

回答by Stephen C

My advice1is to stop reading books and start implementing stuff. In my experience, book learning is poor a substitute for the knowledge you get by actually doing things.

我的建议1是停止阅读书籍并开始实施。根据我的经验,书本学习无法替代您通过实际做事获得的知识。



1 - Context: this is advice to someone who has just finished reading two books on the topic, and is looking for more books to read. In practice you need to balance reading and doing. Especially if you have a specific problem you are trying to solve.

1 - 背景:这是给刚读完关于该主题的两本书并正在寻找更多书籍阅读的人的建议。在实践中,你需要平衡阅读和做事。特别是如果你有一个你想要解决的特定问题。

回答by motiver

I won't comment on other technologies but if you want to learn Hibernate get "Hibernate Made Easy" by Cameron McKenzie(www.hiberbook.com). It is worth every penny. You can finish reading that book in 2 days(literally). it is like a novel and at the end you find yourself dealing with Hibernate like a Semi-Pro.

我不会评论其他技术,但如果你想学习 Hibernate,请阅读 Cameron McKenzie (www.hiberbook.com) 的“Hibernate Made Easy”。值得全力投资。你可以在 2 天内读完那本书(字面意思)。它就像一本小说,最后你会发现自己像半专业人士一样处理 Hibernate。

回答by Apeirogon Prime

If you just want to create web applications in Java, check out the Play Framework. It is similar to "Ruby on Rails"

如果您只想用 Java 创建 Web 应用程序,请查看Play Framework。它类似于“Ruby on Rails”

回答by Hymantrades

Jpassionprovides good videos and material to learn Java EE 6 and other stuff.

Jpassion提供了很好的视频和材料来学习 Java EE 6 和其他东西。

You should also see applications examples:

您还应该看到应用程序示例:

  1. Petstore. Requires Maven, Glassfish recommended. Written by Antonio Goncalves who wrote the mentioned book.
  2. JBoss Ticketmonster. Requires Maven & Jboss Forge. Deploy in Jboss.
  1. 宠物店。需要 Maven,推荐使用 Glassfish。由撰写上述书籍的安东尼奥·贡萨尔维斯 (Antonio Goncalves) 撰写。
  2. JBoss Ticketmonster。需要 Maven 和 Jboss Forge。在 Jboss 中部署。