如何开始使用 Java 构建 Web 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1385105/
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
How do I get started building web apps with Java?
提问by Radi
I want to start web developing with java. I don't know how to start, what to learn, or what is the best web framework to learn and use. Help me out?
我想开始用java进行网络开发。我不知道如何开始,学习什么,或者什么是最好的学习和使用的 web 框架。帮帮我?
采纳答案by janko
I assume, that you're only new to web apps and not to Java itself.
我假设您只是 Web 应用程序的新手,而不是 Java 本身。
For a starter, I can recommend the Apache Wicketframework for the front end. Their web site is full of examples, the mailing lists are a great place to get started, and Wicket in Actionwas an enjoyable read.
对于初学者,我可以推荐前端的Apache Wicket框架。他们的网站充满了示例,邮件列表是入门的好地方,Wicket in Action读起来很愉快。
If you want to work with Java Server Pages (JSP), then you should definitely also include Java Server Faces (JSF) which make working with JSPs a lot easier. I can't advocate any good books to you as I went for web tutorials mainly. You might want to have a look at Apache MyFaces.
如果您想使用 Java Server Pages (JSP),那么您绝对还应该包含 Java Server Faces (JSF),它使使用 JSP 变得更加容易。我不能向你推荐任何好书,因为我主要是为了网络教程。您可能想看看Apache MyFaces。
For the business logik, I guess the standard is Enterprise JavaBeans (EJB). I liked Mastering Enterprise JavaBeans 3.0. An older version of the book is available for free at TheServerSide.com. You should avoid EJB versions older than 3.0, because they are a PITA!
对于业务逻辑,我猜标准是 Enterprise JavaBeans (EJB)。我喜欢Mastering Enterprise JavaBeans 3.0。在TheServerSide.com 上可以免费获得该书的旧版本。您应该避免使用早于 3.0 的 EJB 版本,因为它们是 PITA!
A separate part of the EJB 3.0 specification is the Java Persistence API 1.0 (see, e.g., Apache OpenJPAthough the documentation is patchy). Other frameworks that support JPA are, e.g., Springor JPOX (now being called DataNucleus).
EJB 3.0 规范的一个单独部分是 Java Persistence API 1.0(参见,例如,Apache OpenJPA,尽管文档不完整)。其他支持 JPA 的框架有Spring或 JPOX(现在称为DataNucleus)。
Finally, if you want an application server for testing, there are JBoss by RedHat, SUN's Glassfishand Apache Geronimo(I preferred the last one, but you may have noticed my preference for Apache projects already ;-))
最后,如果您想要一个用于测试的应用程序服务器,可以使用 RedHat 的 JBoss、SUN 的 Glassfish和Apache Geronimo(我更喜欢最后一个,但您可能已经注意到我对 Apache 项目的偏好;-))
Good luck!
祝你好运!
回答by adatapost
Well if you do not know much about Java, then first I suggest going back and getting your foundation in Java strong first (cause after all JSPs are java code embedded inside HTML), then proceed to learning about servlets and then move on to JSPs.
好吧,如果您对 Java 不太了解,那么首先我建议先回去巩固您的 Java 基础(因为毕竟 JSP 都是嵌入在 HTML 中的 Java 代码),然后继续学习 servlet,然后继续学习 JSP。
As far as learning JSPs is concerned, I would suggest buy a book, Head First Servlets and JSP is pretty good book.
就学习 JSP 而言,我建议买一本书,Head First Servlets and JSP 是一本不错的书。
Getting Started with Web application - JSP/Servlet
回答by Xinus
If you know java you can always start reading this book, https://secure.manning.com/books/deshmukhIt will give you the basic foundation for java web development.
如果您了解java,您可以随时开始阅读这本书,https://secure.manning.com/books/deshmukh它将为您提供java web 开发的基本基础。
回答by Dan Lynn
I think Grailsis a great way to get started. You can use the scaffolding to get started quickly, which allows you to dip down into the more complex aspects of Java web development at your own pace. I recommend you watch this screencastto see what you think.
我认为Grails是一个很好的入门方式。您可以使用脚手架快速入门,这使您可以按照自己的步调深入了解 Java Web 开发的更复杂方面。我建议您观看此截屏视频以了解您的想法。
回答by Thorbj?rn Ravn Andersen
This is a big subject and you will need to learn a lot.
这是一个很大的课题,你需要学习很多东西。
I can recommend first learning Java very well.
我可以推荐先学好Java。
- Head First Java - http://books.google.dk/books?id=5VTBuvfZDyoC
- The Java Tutorial - http://java.sun.com/docs/books/tutorial/
- Head First Java - http://books.google.dk/books?id=5VTBuvfZDyoC
- Java 教程 - http://java.sun.com/docs/books/tutorial/
You will need to be very proficient in Java, as most framework documentation expect this of you.
您需要非常精通 Java,因为大多数框架文档都希望您如此。
When you have those under your belt, you are much better equipped to determine which framework is best for you, as that very much depends on which facilities you actually need, and which you do not have any use for.
当您拥有这些基础设施时,您就可以更好地确定哪种框架最适合您,因为这在很大程度上取决于您实际需要哪些设施,哪些您没有任何用处。
回答by John O
The WEB4Jtool is likely worth a look.
该WEB4J工具可能是值得一试。
It has a much smaller number of classes in comparison with other tools. It is "full stack", so it helps you build all parts of your web app. Thus, you don't have to learn several different tools - just one.
与其他工具相比,它的类数量要少得多。它是“完整堆栈”,因此可以帮助您构建 Web 应用程序的所有部分。因此,您不必学习几种不同的工具——只需一种。
A college instructor related to me that he felt it was "almost perfect" for his students, since it was at just the right level, and didn't hide things behind complicated abstractions - it was plain to see how all the parts worked together.
一位大学讲师跟我说,他觉得这对他的学生来说“几乎是完美的”,因为它处于正确的水平,并且没有将事情隐藏在复杂的抽象背后——很明显看到所有部分是如何协同工作的。