天天看點

一個最簡單的SPRINGMVC示例

持久層,服務層,表現層都涉及到了。

這個分得确實比DJANGO細緻,

多體會,多注解。。:)

一個最簡單的SPRINGMVC示例

The domain layer

The persistence layer

A persistence layer usually contains repository objects to

access domain objects. A repository object makes queries to the data source for the data,

thereafter maps the data from the data source to a domain object, and finally, persists the

changes in the domain object to the data source. So, a repository object is typically

responsible for CRUD operations ( Create , Read , Update , and Delete ) on domain objects.

The @Repository annotation ( org.springframework.stereotype.Repository ) is an

annotation that marks a specific class as a repository.

The service layer:

Controller Layer:

view jsp:

一個最簡單的SPRINGMVC示例