基于javaweb+mysql的ssm求职招聘管理系统(java+ssm+jsp+jquery+h-ui+mysql)
这是一个基于JavaWeb技术栈的求职招聘管理系统,使用了SSM(Spring MVC + Spring + MyBatis)框架进行开发。
由于代码量较大,我将提供一些核心代码片段和配置文件的示例。
数据库配置文件(applicationContext.xml)
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/recruitment_system"/>
<property name="username" value="root"/>
<property name="password" value="password"/>
</bean>
<!-- 配置SqlSessionFactoryBean -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
</bean>
<!-- 配置Mapper接口 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.recruit.dao"/>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 启用事务注解 -->
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
控制器(RecruitController.java)
@Controller
@RequestMapping("/recruit")
public class RecruitController {
@Autowired
private RecruitService recruitService;
@RequestMapping("/list")
public ModelAndView list() {
List<Recruit> recruitList = recruitService.findAll();
ModelAndView mv = new ModelAndView();
mv.addObject("recruitList", recruitList);
mv.setViewName("recruit/list");
return mv;
}
@RequestMapping("/add")
public String add(Recruit recruit, RedirectAttributes redirectAttributes) {
recruitService.save(recruit);
redirectAttributes.addFlashAttribute("message", "招聘信息添加成功");
return "redirect:/recruit/list";
评论已关闭