帮助我进行简单的3层项目 [英] help me for the simple 3 tier project

查看:89
本文介绍了帮助我进行简单的3层项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助我创建一个简单的3层项目,该项目需要用户输入并将用户条目添加到数据库中.
另外,我还需要使用servlet和我的sql数据库来检索用户查询的信息.

问题:是否必须使用jsp?

解决方案

完全不需要使用JSP页面!它使构建动态网页更加容易,但是您也可以通过单独使用servlet来做到这一点.您必须通过Response.Write等自行完成所有HTML呈现,但是仍然可以实现.

干杯!

-MRB


创建类库-BusinessLogic
创建一个类库-DataAccess

现在,从您的UI,使用对象模型并传递给BusinessLogic项目类.此类是业务逻辑类.在此处根据您的需要进行更改.
现在,将更改后的数据从业务逻辑类传递到dataAccess项目类.

为了获取数据,数据将从DA传输到BL,然后从BL传输到UI层. (带有代码)为您完成此操作.但说实话.您应该自己尝试一下.


Help me to create a simple 3 tier project which takes the user input and adds the user entry to the database.
Also I need to retrieve the information for the user queries using servlet and my sql database.

Question: Is it compulsory to use jsp?

解决方案

Using JSP pages is not at all nescessary! It makes building dynamic web pages easier, but you can also do that by using servlets alone. You''ll have to do all the HTML rendering yourself via Response.Write etc. , but it''s doable nevertheless.

Cheers!

-MRB


Create a class library - BusinessLogic
Create a class library - DataAccess

Now, from your UI, use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.
Now, pass on the changed data from business logic class to dataAccess project class.

For getting back data, it will be transferred from DA to BL and then BL to UI layer.


If you search on the internet, you will be able to find at least a few good samples (with code) that do this for you. But honestly. you should try something on your own.


这篇关于帮助我进行简单的3层项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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