从mapper开始编写------------------------------------------------------
id命名规则: find* 查询
del* 删除
update* 修改
save* 保存
dao-------------------------------------------------------------------
每个dao类上都应该有@Repository注解
@Autowired
private SqlSessionTemplate sqlSessionTemplate;
service------------------------------------------------------------------
每个service类上都应该有@Service注解
事物管理注解@Transactional
action-------------------------------------------------------------------
每个action类上都应该有@Controller注解
@Scope("prototype")非单例对象注解
private static final long serialVersionUID = 1L;
每个类中必须有这句话
struts--------------------------------------------------------------------
<package name="虚拟目录名称" namespace="虚拟目录路径" extends="json-default">
<action name="请求上的方法名" class = "对应的action类(首字母要小写)" method = "action类中的方法名">
<result name="success" type="json">
<param name="root">jsonMap</param>
</result>
</action>
</package>
在mybatis-config.xml中需要添加你新写的mapper和bean
<typeAlias alias="bean别名" type="bean对象的路径"/>
<mapper resource="需要添加的mapper路径"/>
id命名规则: find* 查询
del* 删除
update* 修改
save* 保存
dao-------------------------------------------------------------------
每个dao类上都应该有@Repository注解
@Autowired
private SqlSessionTemplate sqlSessionTemplate;
service------------------------------------------------------------------
每个service类上都应该有@Service注解
事物管理注解@Transactional
action-------------------------------------------------------------------
每个action类上都应该有@Controller注解
@Scope("prototype")非单例对象注解
private static final long serialVersionUID = 1L;
每个类中必须有这句话
struts--------------------------------------------------------------------
<package name="虚拟目录名称" namespace="虚拟目录路径" extends="json-default">
<action name="请求上的方法名" class = "对应的action类(首字母要小写)" method = "action类中的方法名">
<result name="success" type="json">
<param name="root">jsonMap</param>
</result>
</action>
</package>
在mybatis-config.xml中需要添加你新写的mapper和bean
<typeAlias alias="bean别名" type="bean对象的路径"/>
<mapper resource="需要添加的mapper路径"/>