在 Eclipse 中构建 Web 应用程序
作为数据管理课程中教授的技术的总结作业,我们必须使用整个课程中教授的技术编写一个 Web 应用程序,这主要包括 xhtml、css、JSP、servlet、JDBC、AJAX、webservices。该项目最终将使用tomcat进行部署。我们可以选择我们认为合适的技术。因为这是我第一次开发 Web 应用程序,所以我对从哪里开始有一些不确定性,所以例如现在我正在编写将在数据库中使用的对象类并实现将在数据库上执行的操作,但是我不确定如何通过网站向客户端提供这些操作,我的意思是我认为我必须编写一个 servlet,通过它我可以提取请求参数并相应地设置响应,但我仍然想要一个更具体的概述我要做什么,所以如果有人可以将我链接到一个教程,其中包含一个使用这些技术的示例,同时说明设计的各个阶段,以便我可以看到所有这些东西如何在 Web 项目中链接在一起。
谢谢
As a concluding assignment for the technologies taught in a data management course, we have to write a web application using the technologies taught throughout the course, this mostly includes xhtml, css, JSP, servelets, JDBC, AJAX, webservices. the project will eventually be deployed using tomcat. we are given the option of choosing the technologies that we see fit. since this is my first time developing a web application I am having some uncertainties about where to start, so for example now I am writing the object classes that will be used in the database and implementing the operations that will be performed on the database, but I am not sure about how to make these operations available to a client through the website, I mean I think I have to write a servlet through which I can extract the request parameters and set the response accordingly, but I would still like a more specific overview of what I am going to do, so if someone can link me to a tutorial with an example that makes use of these technologies while illustrating the stages of the design so that I can see how all these things are linked together in a web project.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Java 企业应用程序通常使用分层架构,如下所示:
简而言之
我不想让事情变得太混乱,也不想引入太多适合这张图的技术或框架(你可以使用框架吗?)。只要告诉我是否应该。
关于你关于表示层的问题,我已经暗示了答案:使用MVC模式。
基本上,视图是呈现用户界面(例如JSP)的部分。从视图来看,用户将输入发送到控制器(充当入口点的 Servlet)。控制器与模型(标准 Java 类)进行通信和交互,在 HTTP 请求或会话中设置适当的数据,并将请求和响应转发到视图。这又重新开始循环。
如果您需要更多详细信息,请告诉我。
Java Enterprise applications typically use a layered architecture as illustrated below:
In short:
I don't want to make things too confusing and to throw in too much technologies or frameworks (are you allowed to use frameworks?) that could fit in this diagram. Just tell me if I should.
Regarding your question about the presentation layer, I already hinted the answer: use the MVC pattern.
Basically, the View is the part that renders the user interface (e.g. JSP). From the view, the user sends input to a controller (a Servlet acting as entry point). The controller communicates and interacts with the model (standard Java classes), set appropriate data in the HTTP request or Session and forwards the request and response to a view. And this restarts the cycle.
If you need more details, let me know.
需要婴儿学步。让某些东西运行起来,然后对其进行扩展。
从本教程开始,运行它,然后开始提问 http:// /www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html
这将为您提供一个在 Eclipse 中在 Tomcat 上运行的 Servlet 和 JSP。从那里您可以扩展。
Baby steps are needed. Get something running and then expand on it.
Start with this tutorial, get it running and then start asking questions http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html
This will give you a Servlet and a JSP running on Tomcat from Eclipse. From there you can expand.
Sun 文档非常好:Java EE 6 教程,第一卷。
Sun 的 Java BluePrints 程序还发布了一个工作示例应用程序,称为 Pet Store Demo。
我还整理了一系列教程 面向想要学习如何构建 Java Web 应用程序(在 Eclipse 环境中)的初学者。我尽力让它尽可能简单。
Sun documentation is pretty good: The Java EE 6 Tutorial, Volume I.
There is also a working sample application released by the Java BluePrints program at Sun called the Pet Store Demo.
I have also put together a string of tutorials aimed at beginners who are wanting to learn how to build Java web applications (within the Eclipse environment). I have tried to keep it as simple as possible.