业务逻辑层Servlet和JSP [英] Business Logic Layerin Servlet and JSP

查看:146
本文介绍了业务逻辑层Servlet和JSP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始从.NET平台转移到J2EE。我是Eclipse构建应该使用业务逻辑层的JSP和Servlet应用程序。



.NET中的方法非常简单,我在解决方案中构建Web应用程序项目,然后创建类库项目,并在Web应用程序引用中引用其输出。



如何在Eclipse中执行?我应该创建单独的项目并构建JAR文件作为输出,并在Web项目中引用它?



我是Java的新手,所以任何评论都会更受欢迎。



Danny。 >

解决方案

是的,创建一个单独的Java项目将是要走的路。只需一个简单的Java项目即可。要在动态Web项目中使用它,您不应该将其作为项目添加到构建路径中。您还需要在动态Web项目中将其称为Java EE模块。然后,Eclipse会关注建立和放置JAR的正确方法。



如果您使用的是Eclipse 3.5或更早版本,那么请检查动态Web项目的属性中的Java EE模块依赖关系部分。你应该在那里添加Java项目。





如果您使用的是Eclipse 3.6或更高版本,那么请检查基本相同的部署程序集部分(刚刚更名/按其他功能分组3.6 )




Recently I started to move from a .NET platform to J2EE. I'm Eclipse to build JSP and Servlet applications which should use Business Logic layer.

The approach in .NET is very simple I'm building web Application Project inside the solution, then Creating Class Library project and refers its output in Web Application References.

How should I do it in Eclipse? Should I create separate project and build JAR file as output and refer it in Web Project?

I'm new to Java so any comment will be more then welcomed.

Danny.

解决方案

Yes, creating a separate Java project would be the way to go. Just a simple Java Project suffices. To use it in the dynamic web project, you should not only add it as a project in the Build Path. You also need to refer it as Java EE module in the dynamic web project. Eclipse will then take care about buiding and placing the JAR the right way.

If you're on Eclipse 3.5 or older, then check the Java EE Module Dependencies section in the properties of the dynamic web project. You should add the Java project there.

If you're on Eclipse 3.6 or newer, then check the Deployment Assembly section which does essentially the same (it has just been renamed/grouped with other functions as per 3.6).

这篇关于业务逻辑层Servlet和JSP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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