SpringSide是个什么东西呢?这么说吧,就是采众家之长的一个一站式框架,它吸取了开源界许多优秀组件的精华部分,非常简约的一个东西,具体就不多介绍了,自己可以参考官方文档。

下面来看看运用这个框架实现一个简单的用户管理究竟有多么容易。

先来看表现层:

新增或修改用户页面:



用户列表页面:

对应的控制器类UserAction.java:


SpringSide示例之HelloWorldpackage org.springside.helloworld.web;
SpringSide示例之HelloWorld
SpringSide示例之HelloWorld
import org.springside.core.web.StrutsEntityAction;
SpringSide示例之HelloWorld
import org.springside.helloworld.model.User;
SpringSide示例之HelloWorld
import org.springside.helloworld.service.UserManager;
SpringSide示例之HelloWorld


然后是业务逻辑层,

SpringSide示例之HelloWorldpackage org.springside.helloworld.service;
SpringSide示例之HelloWorld
SpringSide示例之HelloWorld
import org.springside.core.dao.HibernateEntityDao;
SpringSide示例之HelloWorld
import org.springside.helloworld.model.User;
SpringSide示例之HelloWorld

然后是模型层


SpringSide示例之HelloWorldpackage org.springside.helloworld.model;
SpringSide示例之HelloWorld
SpringSide示例之HelloWorld
import javax.persistence.Entity;
SpringSide示例之HelloWorld
import javax.persistence.GeneratedValue;
SpringSide示例之HelloWorld
import javax.persistence.GenerationType;
SpringSide示例之HelloWorld
import javax.persistence.Id;
SpringSide示例之HelloWorld
import javax.persistence.Table;
SpringSide示例之HelloWorld


那么代码部分就这些了,可以看到不需要我们自己去写重复的CRUD代码,仅仅从一些特定的基类继承下来就可以了,而Jdk新加入的泛型技术的运用更是如虎添翼。那么对于配置文件部分,我个人感觉比以前好像更加复杂了呢,也许是还不习惯吧。。。

相关文章:

  • 2021-07-06
  • 2021-10-16
  • 2021-10-19
  • 2022-12-23
  • 2021-05-30
  • 2021-08-20
  • 2022-01-08
猜你喜欢
  • 2021-04-02
  • 2021-09-04
  • 2021-08-24
  • 2021-06-07
  • 2021-05-25
  • 2021-11-23
  • 2021-08-02
相关资源
相似解决方案