一、Bootstrap网站 https://v3.bootcss.com/getting-started/#template
二、JQuery
(1)多个元素添加点击事件
(2)获取tag属性值
(3)全选、全不选逻辑
(4)删除多个
@ResponseBody @RequestMapping(value = "/emp/{empIds}",method = RequestMethod.DELETE) public CommonResult deleteEmp(@PathVariable("empIds") String empIds){
if(empIds.contains("-")){
String[] ids=empIds.split("-");
List<Integer> idList=new ArrayList<>();
for(String id:ids){
idList.add(Integer.parseInt(id));
}
employeeService.deleteBatch(idList);
}else {
employeeService.delete(Integer.parseInt(empIds));
}
return CommonResult.success();
}
public void deleteBatch(List idList) { EmployeeExample employeeExample=new EmployeeExample(); EmployeeExample.Criteria criteria = employeeExample.createCriteria(); criteria.andEmpIdIn(idList); employeeMapper.deleteByExample(employeeExample); }
三、Ajax直接发送PUT请求
四、Spring的单元测试--模拟网络请求 @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration(locations = {"classpath:applicationContext.xml", "classpath:dispatcherServlet-servlet.xml"}) public class MvcTest {
//传入SpringMvc的ioc
@Autowired
WebApplicationContext context;
//虚拟mvc请求,获取到处理结果
MockMvc mockMvc;
@Before
public void initMockMvc() {
mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
}
@Test
public void testPage() throws Exception {
//模拟请求拿到返回值
MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get("/emps").param("pn", "1")).andReturn();
//请求成功后,请求域中会有pageInfo
MockHttpServletRequest request = result.getRequest();
PageInfo pageInfo = (PageInfo) request.getAttribute("pageInfo");
System.out.println("当前页码"+pageInfo.getPageNum());
System.out.println("总页码"+pageInfo.getPages());
System.out.println("总记录数"+pageInfo.getTotal());
int[] nums=pageInfo.getNavigatepageNums();
for(int i :nums){
System.out.println(" "+i);
}
List<Employee> list = pageInfo.getList();
for(Employee employee: list){
System.out.println("ID "+employee.getdId()+" name "+employee.getEmpName());
}
}
}