想用Java制作网站,我应该实现struts吗?

发布于 2024-09-10 12:28:11 字数 106 浏览 4 评论 0原文

我想使用java制作一个讨论形式的网站,我应该使用JSP-Servlet-Java代码来制作它还是应该使用像struts这样的框架......

我是Java新手,但我有足够的编程经验

I want to make discussion form kind of website using java, should i just make it using JSP- Servlet - Java code or should i use some framework like struts ...

I am new to Java, but i have sufficient exposure of programming

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

十二 2024-09-17 12:28:11

取决于您想要实现的目标。

就框架而言,我建议检查 Spring 而不是 Struts(尽管它们可以一起使用,但 Spring 有一个等效的 Spring-MVC)。

但是对于 Java 新手来说,Spring 可能会有点复杂,即使您确实有其他语言的经验。也许首先尝试使用 JSP/servlet,一旦您熟悉了它们,就可以查看 Spring(我推荐 Spring in Action 作为阅读材料)

...此外,如果我们在框外讨论更多内容(我看到其他人提到过) Scala/Lift),另一个替代方案是 Groovy on Grails。它基于 Spring,由 SpringSource 拥有,但开发起来更有趣/更快。另外,如果您之前有使用动态语言(例如 Python/Ruby)的经验,那么 Groovy 值得一试。

Depends what you're trying to achieve.

As far as frameworks go I would recommend checking out Spring over Struts (Although they can be used together, Spring has an equivalent Spring-MVC).

But Spring might be a bit involved for a Java newbie, even if you do have other language experience. Maybe experiment with JSPs/servlet first and check out Spring once you're comfortable with them (I recommend Spring in Action for reading material)

... Also, if we're talking a bit more outside the box (I see someone else mentioned Scala/Lift), another alternative would be Groovy on Grails. This is based on Spring, and owned by SpringSource, but is much more fun/quick to develop with. Plus if your previous experience happens to be with dynamic langs such as Python/Ruby, Groovy would be worth checking out.

随风而去 2024-09-17 12:28:11

您也可以尝试 Play 框架。我看过他们的演示,它的编程模型对我来说看起来很有希望。

You can try Play framework too. I have watched their demo and it's programming model looks promising to me.

谈场末日恋爱 2024-09-17 12:28:11

如果您打算使用 Struts,那么请确保使用 Struts 2。我不建议任何人在 Struts 1 中编写新应用程序,因为它非常冗长并且需要大量配置。然而,Struts 2 非常棒。我写了一个教程,如果这是你的路线想去。

If you're going to use Struts then make sure to use Struts 2. I would not recommend anyone write a new app in Struts 1 as it is very verbose and requires lots of configuration. However, Struts 2 is pretty awesome. I wrote a tutorial on it if that's the route you'd like to go.

萌面超妹 2024-09-17 12:28:11

您应该对 servlet API 有基本的了解,但您很可能更喜欢使用基于它构建的一些 Web 框架。 Struts 只是其中之一,流行且简单,但有点老旧;还有很多其他的,

仅举几个例子:Struts、Spring-MVC、Stripes、Struts2、Wicket、JSF、Tapestry、GWT...还有很多其他。
(Struts2 不是 Struts 的新版本,而是 Webworks 的新版本)。

不幸的是,他们都不是明显的赢家。

You should have a basic understanding of servlet API, but you will most probably prefer to use some web framework built upon it. Struts is just one of them, popular and simple though a little old; there are many others

To name some: Struts, Spring-MVC, Stripes, Struts2, Wicket, JSF, Tapestry, GWT... an many others.
(Struts2 is not a new version of Struts, it's rather a new version of Webworks).

Unfortunately none of them is a clear winner.

回眸一笑 2024-09-17 12:28:11

您可以考虑使用 Scala 和 Lift。我正在用它构建我的下一个网站,它是一种非常有前途、轻量级、不那么冗长的 Java 语言。

You might consider Scala with Lift. I am building my next site in this and it is a very promising, light weight, less verbose, Java language.

浪漫之都 2024-09-17 12:28:11

需要了解 servlet 以及无论如何可以使用它们做什么,因为所有基于 Java 的现代 Web 平台都构建在其之上。

Sun 的 Servlet 教程位于 http://java.sun .com/j2ee/tutorial/1_3-fcs/doc/Servlets.html

You WILL need to understand servlets and what you can do with them regardless what, as all modern Java-based web platforms build on top of that.

The Sun tutorial for servlets is at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html

浅语花开 2024-09-17 12:28:11

如果您问是否使用框架或仅使用普通的 JSP-Servlet-Java,我会说只要您像其他人所说的那样掌握了该语言和 Servlet API,就不需要付出额外的努力来学习从长远来看,在此之上的框架是非常值得的。如果您不使用框架,您最终会发现,要么您的许多代码变得乏味、重复的“管道”,要么您实际上已经创建了自己的框架。创建框架可能很有趣,但如果您的工作要在截止日期前完成,那么使用现有框架可以节省大量时间和精力。

If you're asking whether to use a framework at all or just use plain JSP-Servlet-Java I'd say that as long as you have a grasp of the language and Servlet API as other have said, the extra effort to learn a framework on top of that is well worth it in the long run. If you don't use a framework you eventually find that either a lot of your code becomes tedious, repetitive 'plumbing' or that you've essentially created your own framework anyway. Creating frameworks can be fun but if you have a job to do with a deadline, using an existing one saves a huge amount of time and effort.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文