3

I've never really done much web work, but for a project i have to write dynamic website in java.

So originally i started using scriplets in the jsp combined with standard java classes to reduce the amount of code in the jsp files. This was working great for me and i was producing results very quickly.

However when i looked online i saw that this way was disregarded almost a decade ago.

So i started looking into the JSTL libary and the the EL. However after searching for a very long while found it hard to wrap my head round and often got sidetracked with researching the benefits of JSF, pre processing servlets and much more. This project will never actually go into 'production' it will be presented to someone along with my code.

So my question is, what is the fastest and easiest way to display information from my database into a jsp while using standard java classes (Which i am used to, and have already created) to do the most of the work (create connection etc).

I have goggled this endlessly and it has only made me more confused. Much of the infromation from google just involved variables from the pages scope or the request scope, not getting information from java classes.

Thanks very much

4

1 回答 1

1

尽管这是一个小型、简单的项目,但我还是建议使用 Grails 框架。它的设置和使用都非常简单,并且将为您提供 Web MVC 框架的所有好处。

使用 Grails,您可以编写从数据库中检索数据的控制器类,并将其公开给 GSP 页面(非常类似于 JSP)以进行显示。

于 2013-01-12T17:13:40.567 回答