注意事项:

输出台乱码

a链接以post提交

表单提交前验证

onsubmit 属性在提交表单时触发。

onsubmit 属性只在 中使用。

  1. <form action="/demo/demo_form.asp" onsubmit="checkForm()">
  2. 姓:<input type="text" name="lname"><br>
  3. 名:<input type="text" name="fname"><br>
  4. <input type="submit" value="提交">
  5. <script>
  6. function checkForm()
  7. {
  8. alert("表单已提交!");
  9. }
  10. </script>

跳转前确认

在跳转链接前,需要判断该用户是否有权限打开页面,没有权限的弹出一个确认框提示“没有权限”,有权限的则直接跳转页面。

参考资料一:

http://jingyan.baidu.com/article/425e69e6d043bebe15fc16db.html

a标签点击时跳出确认框

方法一:

  1. <a href="http://www.baidu.com" onClick="return confirm('确定删除?');">[删除]</a>

方法二:

  1. <a onclick="confirm(‘确定要跳转吗?')?location.href='www.baidu.com':''" href="javascript:;">百度</a>

参考资料二:

http://blog.csdn.net/wujiangwei567/article/details/40352689

①在html标签中出现提示

  1. <a href="http://www.baidu.com" onclick="if(confirm('确认百度吗?')==false)return false;">百度</a>

②在js函数中调用

  1. function foo(){
  2. if(confirm("确认百度吗?")){
  3. return true;
  4. }
  5. return false;
  6. }

对应的标签改为:

  1. <a href="http://www.baidu.com" onclick="return foo();">百度</a>

注意事项:

以上参考资料总结:

1.跳转的方法:

1>. 把连接放在a元素的href属性中进行页面跳转

2>. 使用location.href进行页面跳转

c:if 判断

字符串与域中的字符串是否相等

1、<c:if test="${student.sex eq '男'}我是空格"></c:if>,注意是${student.sex eq '男'}后面的空格

2、<c:if test="${student.sex eq '男'}"></c:if>

注意不要有多余的空格,判断相等用eq关键字

jsr303验证表单

  1. @PostMapping("/editStudent")
  2. public String editStudentUI(@Valid @ModelAttribute Student student , BindingResult result, Model model){
  3. if (!bindResult(result, model)){
  4. return "error";
  5. }
  6. try {
  7. studentServiceImpl.update(student);
  8. } catch (Exception e) {
  9. e.printStackTrace();
  10. }
  11. return "redirect:/admin/showStudent";
  12. }
  13. public boolean bindResult(BindingResult result, Model model){
  14. if (result.hasErrors()){
  15. List<String> errors=new ArrayList<>();
  16. List<ObjectError> errorList = result.getAllErrors();
  17. for(ObjectError error : errorList){
  18. errors.add(error.getDefaultMessage());
  19. }
  20. model.addAttribute("error",errors);
  21. return false;
  22. } else{
  23. return true;
  24. }
  25. }
  1. package com.system.pojo.base;
  2. import org.hibernate.validator.constraints.NotBlank;
  3. import org.springframework.format.annotation.DateTimeFormat;
  4. import javax.validation.constraints.NotNull;
  5. import java.util.Date;
  6. public class Student {
  7. private Integer userid;
  8. @NotBlank(message = "姓名不能为空")
  9. private String username;
  10. private String sex;
  11. private Date birthyear;
  12. private Date grade;
  13. private Integer collegeid;
  14. public Integer getUserid() {
  15. return userid;
  16. }
  17. public void setUserid(Integer userid) {
  18. this.userid = userid;
  19. }
  20. public String getUsername() {
  21. return username;
  22. }
  23. public void setUsername(String username) {
  24. this.username = username == null ? null : username.trim();
  25. }
  26. public String getSex() {
  27. return sex;
  28. }
  29. public void setSex(String sex) {
  30. this.sex = sex == null ? null : sex.trim();
  31. }
  32. public Date getBirthyear() {
  33. return birthyear;
  34. }
  35. public void setBirthyear(Date birthyear) {
  36. this.birthyear = birthyear;
  37. }
  38. public Date getGrade() {
  39. return grade;
  40. }
  41. public void setGrade(Date grade) {
  42. this.grade = grade;
  43. }
  44. public Integer getCollegeid() {
  45. return collegeid;
  46. }
  47. public void setCollegeid(Integer collegeid) {
  48. this.collegeid = collegeid;
  49. }
  50. @Override
  51. public String toString() {
  52. return "Student{" +
  53. "userid=" + userid +
  54. ", username='" + username + '\'' +
  55. ", sex='" + sex + '\'' +
  56. ", birthyear=" + birthyear +
  57. ", grade=" + grade +
  58. ", collegeid=" + collegeid +
  59. '}';
  60. }
  61. }

Ajax

参数:

​ url: 请求地址

​ type: 请求方式 (默认是get请求)

​ headers:

​ data: 待发送的参数数据key/value

​ success:成功之后的回调函数

​ dataType: 将服务器端返回的数据转成指定类型("xml","json","text","html","jsonp"...)

  1. $.post

shiro

shiro注解

Shiro的常用注解

@RequiresPermissions :要求当前Subject在执行被注解的方法时具备一个或多个对应的权限。

@RequiresRoles("xxx") :要求当前Subject在执行被注解的方法时具备所有的角色,否则将抛出AuthorizationException异常。

@RequiresAuthentication:要求在访问或调用被注解的类/实例/方法时,Subject在当前的session中已经被验证。

jsp中Shiro使用的标签

需要在jsp页面中引入标签

<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>

标签:

shiro:authenticated 认证且不是记住我

shiro:notAuthenticated 未身份认证,包括记住我自动登录

shiro:guest 用户没有认证在没有RememberMe时

shiro:user 用户认证且在RememberMe时

<shiro:hasAnyRoles name="abc,123" > 在有abc或者123角色时

<shiro:hasRole name="abc"> 拥有角色abc

<shiro:lacksRole name="abc"> 没有角色abc

<shiro:hasPermission name="abc"> 拥有权限资源abc <shiro:lacksPermission name="abc"> 没有abc权限资源

shiro:principal 显示用户身份名称

<shiro:principal property="username"/> 显示用户身份中的属性值

shiro使用

Subject:相当于用户

SecurityManager:相当于DispatcherServlet

Realm:相等于DataSource

  • 导入依赖

    1. <dependency>
    2. <groupId>org.apache.shiro</groupId>
    3. <artifactId>shiro-core</artifactId>
    4. <version>1.2.3</version>
    5. </dependency>
    6. <dependency>
    7. <groupId>org.apache.shiro</groupId>
    8. <artifactId>shiro-web</artifactId>
    9. <version>1.2.3</version>
    10. </dependency>
    11. <dependency>
    12. <groupId>org.apache.shiro</groupId>
    13. <artifactId>shiro-spring</artifactId>
    14. <version>1.2.3</version>
    15. </dependency>
    16. ....
    17. //– shiro-all-1.3.2.jar
    18. //– log4j-1.2.15.jar
    19. //– slf4j-api-1.6.1.jar
    20. //– slf4j-log4j12-1.6.1.jar
  • web.xml

    1. <!-- name要和 applicationContext.xml中的对应的bean的id一致 -->
    2. <!--Shiro拦截器 shiro入口-->
    3. <filter>
    4. <filter-name>shiroFilter</filter-name>
    5. <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    6. <init-param>
    7. <!-- 该值缺省为false,表示生命周期由SpringApplicationContext管理,设置为true则表示由ServletContainer管理 -->
    8. <param-name>targetFilterLifecycle</param-name>
    9. <param-value>true</param-value>
    10. </init-param>
    11. </filter>
    12. <filter-mapping>
    13. <filter-name>shiroFilter</filter-name>
    14. <url-pattern>/*</url-pattern>
    15. </filter-mapping>
  • 配置文件

    1. 配置自定义的realm类、(或者自动扫描)--》创建realm对象,如:myRealm
    2. 配置DefaultWebSecurityManager,需要用到realm对象--》创建DefaultWebSecurityManager,如:securityManager
    3. 配置ShiroFilterFactoryBean,需要用到DefaultWebSecurityManager对象---》创建ShiroFilterFactoryBean,如:shiroFilter(与web.xml中过滤器名字配置的一致)

    URL 权限采取第一次匹配优先的方式

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <beans xmlns="http://www.springframework.org/schema/beans"
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4. xmlns:context="http://www.springframework.org/schema/context"
    5. xsi:schemaLocation="http://www.springframework.org/schema/beans
    6. http://www.springframework.org/schema/beans/spring-beans.xsd
    7. http://www.springframework.org/schema/context
    8. http://www.springframework.org/schema/context/spring-context.xsd
    9. ">
    10. <!--配置自定义realm类-->
    11. <!-- <bean id="myRealm" class="com.system.realm.MyRealm">
    12. <property name="credentialsMatcher">
    13. <bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
    14. <property name="hashAlgorithmName" value="MD5"></property>
    15. <property name="hashIterations" value="1024"></property>
    16. </bean>
    17. </property>
    18. </bean>-->
    19. <context:component-scan base-package="com.system.realm" />
    20. <!--安全管理器-->
    21. <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    22. <property name="realm" ref="myRealm"/>
    23. </bean>
    24. <!--与web.xml中过滤器名称一致-->
    25. <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    26. <!-- Shiro的核心安全接口,这个属性是必须的 -->
    27. <property name="securityManager" ref="securityManager"/>
    28. <!-- 身份认证失败,则跳转到登录页面的配置 -->
    29. <!-- 要求登录时的链接(登录页面地址),非必须的属性,默认会自动寻找Web工程根目录下的"/login.jsp"页面 -->
    30. <!--<property name="loginUrl" value="/login.jsp"/>
    31. <property name="successUrl" value="/index.jsp"/>-->
    32. <!-- 权限认证失败,则跳转到指定页面 -->
    33. <!--<property name="unauthorizedUrl" value="/login.htmls"/>-->
    34. <!-- Shiro连接约束配置,即过滤链的定义 -->
    35. <property name="filterChainDefinitions">
    36. <value>
    37. <!--anon 表示匿名访问,不需要认证以及授权-->
    38. <!--authc表示需要认证 没有进行身份认证是不能进行访问的-->
    39. <!--当访问login时,不用进行认证-->
    40. /login = anon
    41. <!--配置静态资源可以匿名访问-->
    42. /css/** = anon
    43. /dist/** = anon
    44. /js/** = anon
    45. /fonts/** = anon
    46. /admin/** = authc,roles[admin]
    47. /teacher/** = authc,roles[teacher]
    48. /student/** = authc,roles[student]
    49. /logout = logout
    50. <!--只有登陆界面可以匿名访问,其他路径都需要登录认证才能访问,没有登陆访问其他路径回跳转登陆页面-->
    51. /**=authc
    52. </value>
    53. </property>
    54. </bean>
    55. <!-- 生命周期 -->
    56. <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
    57. <!-- 启用shiro注解 -->
    58. <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    59. <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    60. <property name="securityManager" ref="securityManager"/>
    61. </bean>
    62. </beans>
  • 自定义realm

    1. package com.system.realm;
    2. import com.system.pojo.base.Role;
    3. import com.system.pojo.base.User;
    4. import com.system.service.RoleService;
    5. import com.system.service.UserLoginService;
    6. import org.apache.shiro.authc.*;
    7. import org.apache.shiro.authz.AuthorizationInfo;
    8. import org.apache.shiro.authz.SimpleAuthorizationInfo;
    9. import org.apache.shiro.realm.AuthorizingRealm;
    10. import org.apache.shiro.subject.PrincipalCollection;
    11. import org.springframework.beans.factory.annotation.Autowired;
    12. import org.springframework.stereotype.Component;
    13. import java.util.HashSet;
    14. import java.util.Set;
    15. /**
    16. * @Description: 自定义的Realm
    17. * @Date 2020/3/21
    18. **/
    19. @Component
    20. public class MyRealm extends AuthorizingRealm {
    21. @Autowired
    22. private UserLoginService userLoginServiceImpl;
    23. @Autowired
    24. private RoleService roleServiceImpl;
    25. /**
    26. * @Description: 权限验证,获取身份信息
    27. * @Param0: principalCollection
    28. * @Return: org.apache.shiro.authz.AuthorizationInfo
    29. **/
    30. @Override
    31. protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
    32. //1、获取当前用户名
    33. String username = (String) getAvailablePrincipal(principalCollection);
    34. Role role = null;
    35. //2、通过当前用户名从数据库中获取用户信息
    36. try {
    37. User user = userLoginServiceImpl.findByName(username);
    38. //3、获取角色信息
    39. role=roleServiceImpl.findById(user.getRole());
    40. } catch (Exception e) {
    41. e.printStackTrace();
    42. }
    43. //4、为当前用户设置角色和权限
    44. SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
    45. //用来存放角色码的集合
    46. Set<String> r = new HashSet<String>();
    47. if (role != null) {
    48. r.add(role.getRolename());
    49. //5、把用户角色码交给shiro
    50. info.setRoles(r);
    51. }
    52. return info;
    53. }
    54. /**
    55. * @Description: 身份验证,login时调用
    56. * @Param0: authenticationToken
    57. * @Return: org.apache.shiro.authc.AuthenticationInfo
    58. **/
    59. @Override
    60. protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
    61. //用户名
    62. String username = (String) token.getPrincipal();
    63. //密码
    64. String password = new String((char[])token.getCredentials());
    65. //获取用户信息
    66. User user=null;
    67. try {
    68. user = userLoginServiceImpl.findByName(username);
    69. } catch (Exception e) {
    70. e.printStackTrace();
    71. }
    72. //
    73. if (user == null) {
    74. //没有该用户名
    75. throw new UnknownAccountException();
    76. } else if (!password.equals(user.getPassword())) {
    77. //密码错误
    78. throw new IncorrectCredentialsException();
    79. }
    80. /* ByteSource salt = ByteSource.Util.bytes(user.getSalt());//盐值
    81. SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(user.getName(),
    82. user.getPassWord(),salt,getName());*/
    83. SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(username, password, getName());
    84. return authenticationInfo;
    85. }
    86. }
  • controller中身份验证

    1. 封装用户名,密码
    2. 调用Subject.login方法进行登录,不匹配会出现 AuthenticationException 异常
    3. 自定义的realm类,重写doGetAuthenticationInfo() 方法
  • controller中获取登录信息

    1. SecurityUtils.getSubject()获取subject
    2. subject.getPrincipal()
  • controller中获取授权信息

    1. subject.hasRole("xxx"),角色码集合中的值
    2. 或者subject.isPermitted()
  • controller代码实例:

    1. @RequestMapping(value = "/login", method = {RequestMethod.POST})
    2. public String login(User user,Model model) throws Exception{
    3. UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(),
    4. user.getPassword());
    5. //应用代码直接交互的对象是 Subject,Subject 代表了当前“用户”
    6. Subject subject = SecurityUtils.getSubject();
    7. subject.login(token);
    8. //如果获取不到用户名就是登录失败,但登录失败的话,会直接抛出异常
    9. if (subject.hasRole("admin")) {
    10. return "redirect:/admin/showStudent";
    11. } else if (subject.hasRole("teacher")) {
    12. return "redirect:/teacher/showCourse";
    13. } else if (subject.hasRole("student")) {
    14. return "redirect:/student/showCourse";
    15. }
    16. return "redirect:/login";
    17. }
    1. //获取登录者信息
    2. public User getUserInfo(){
    3. Subject subject = SecurityUtils.getSubject();
    4. String username= (String) subject.getPrincipal();
    5. User user=null;
    6. try {
    7. user= userLoginServiceImpl.findByName(username);
    8. } catch (Exception e) {
    9. e.printStackTrace();
    10. }
    11. return user;
    12. }

日期转换

pojo 类的 日期字段 上,添加注解 @DateTimeFormat(pattern="yyyy/MM/dd") 根据自己情况,写具体的日期格式;

上面的仅仅对一个 po 类有效,如果你有很多 pojo 类,都有日期,则直接写一个日期转换类,然后注册到 springMvc 的配置文件里面,一劳永逸 ;

转换类如下:

  1. import org.springframework.core.convert.converter.Converter;
  2. import java.text.ParseException;
  3. import java.text.SimpleDateFormat;
  4. import java.util.Date;
  5. /**
  6. * 完成日期绑定,全局的 ,替换掉 @DateTimeFormat(pattern = "yyyy/MM/dd")
  7. */
  8. public class DateConverter implements Converter<String, Date> {
  9. /**
  10. * 日期转换类
  11. */
  12. private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
  13. @Override
  14. public Date convert(String source) {
  15. try {
  16. return simpleDateFormat.parse(source);
  17. } catch (ParseException e) {
  18. e.printStackTrace();
  19. }
  20. // 转换失败,就返回 null ;
  21. return null;
  22. }
  23. }

注册到配置文件中

  1. <!--配置 自定义 参数绑定(日期转换)-->
  2. <bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean" id="conversionService">
  3. <!--写上自定义的转换器-->
  4. <property name="converters">
  5. <list>
  6. <!--日期 转换 -->
  7. <bean class="cn.hyc.utils.DateConverter"/>
  8. </list>
  9. </property>
  10. </bean>
  11. <!--添加到 MVC 注解里面-->
  12. <mvc:annotation-driven validator="validator" conversion-service="conversionService">

在使用 @Request 进行 JSON 数据参数绑定的时候,对日期,需要另作操作;

否则就会报 400 bad request,请求也不会进后台方法;

pojo 类的 日期字段的get方法 上 添加 @JsonFormat(pattern="yyyy/MM/dd")

json乱码

解决输出JSON乱码的问题

我们发现即使,我们在 web.xml 中配置了解决乱码的拦截器,但是输出JSON 到前台的时候,JSON 中的中文还会乱码 ;

这与我们配置的过滤器无关了,我 猜测 是在JSON转换器内部,它默认了ISO-8859编码,导致过滤器在拿到数据的时候,就已经是乱码的数据了。它再使用UTF8编码,最终也还是乱码,除非它能智能的先ISO-8859解码,再UTF8编码。

为了解决这个问题,我们需要在springMvc.xml 中的 MVC 注解标签中配置JSON转换器,制定编码为UTF8

  1. <mvc:annotation-driven validator="validator" conversion-service="conversionService">
  2. <mvc:message-converters>
  3. <!-- 处理请求返回json字符串的中文乱码问题 -->
  4. <bean class="org.springframework.http.converter.StringHttpMessageConverter">
  5. <property name="supportedMediaTypes">
  6. <list>
  7. <value>application/json;charset=UTF-8</value>
  8. </list>
  9. </property>
  10. </bean>
  11. <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
  12. </mvc:message-converters>
  13. </mvc:annotation-driven>

注意哦,对日期进行绑定的时候,JSON是在 字段 get 方法上添加注解,表单是在 字段 上添加注解!

上面的方法,都是前台传来 JSON ,然后转成对象,指定 JSON 中的日期格式,以便正确的转换日期对象;

如果反过来呢,对象转成JSON,直接转换的话 date 类型,就会被转成 183138913131 这样long 类型的一串数字,我们也可以指定转成 JSON 串中 date 的格式:@JSONField(format = "yyyy-MM-dd")

  1. /**
  2. * JSON -> 对象,指定JSON 中日期格式,以便转成对象
  3. */
  4. @DateTimeFormat(pattern = "yyyy/MM/dd")
  5. /**
  6. * 对象 -》 JSON 指定转换以后的字符串中日期对象的格式
  7. */
  8. @JSONField(format = "yyyy-MM-dd")
  9. private Date newsTime;

重置按钮

需要指定为:reset 。默认submit

路径跳转问题:

controller跳转

  • redirect:/xxx 跳转到根路径/**,(如果根路径为/,则跳转之后路径为localhost/xxx
  • redirect:xxx 跳转到同级路径请求、即:在同一个controller里面跳转(假设:不同的controller类有不同的请求映射注解@RequestMapping("/abc")....,跳转之后路径localhost/abc/xxx,不能实现controller之间的跳转,因为controller类请求路径(abc)不同
  • forward:同redirect

页面跳转

先配置视图解析器:

  1. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  2. <!--拼接视图地址的前缀和后缀 -->
  3. <property name="prefix" value="/WEB-INF/jsp/" />
  4. <property name="suffix" value=".jsp" />
  5. </bean>

return "(想要跳转jsp路径)xxx"

跳转路径:localhost/xxx

如:return "student/showCourse"; 前面没有斜杠,视图解析器里面已经加了

实际jsp所在 D:\ideaFiles\Examination\src\main\webapp\WEB-INF\jsp\student\showCourse.jsp

PageHelper使用

  1. 依赖

    1. <!-- MyBatis分页插件 -->
    2. <dependency>
    3. <groupId>com.github.pagehelper</groupId>
    4. <artifactId>pagehelper</artifactId>
    5. <version>5.1.2</version>
    6. </dependency>
  2. 配置(5.x.x版本)

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <!DOCTYPE configuration
    3. PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
    4. "http://mybatis.org/dtd/mybatis-3-config.dtd">
    5. <configuration>
    6. <plugins>
    7. <plugin interceptor="com.github.pagehelper.PageInterceptor">
    8. <!-- config params as the following -->
    9. <property name="helperDialect" value="mysql"/>
    10. </plugin>
    11. </plugins>
    12. </configuration>
  3. 实现,sql语句不用更改

    1. public PageInfo<Admin> getPageInfo(String keyword, Integer pageNum, Integer pageSize) {
    2. // 1.调用PageHelper的静态方法开启分页功能
    3. // 这里充分体现了PageHelper的“非侵入式”设计:原本要做的查询不必有任何修改
    4. PageHelper.startPage(pageNum, pageSize);
    5. // 2.执行查询
    6. List<Admin> list = adminMapper.selectAdminByKeyword(keyword);
    7. // 3.封装到PageInfo对象中
    8. PageInfo<Admin> adminPageInfo = new PageInfo<>(list);
    9. return adminPageInfo;
    10. }

    ​ controller条用service返回pageinfo对象,存储到model中

写ssm项目的注意点的更多相关文章

  1. idea导入ssm项目启动tomcat报错404

    用idea写ssm项目,基于之前一直在用spring boot  对于idea如何运行ssm花费了一番功夫 启动Tom act一直在报404 我搜了网上各种解决办法都不行,花费一天多的时间解决不了 就 ...

  2. SSH项目与SSM项目的进入首页的方法

    SSH项目中: jsp页面一般都是存放在WEB-INF下面的目录下,这样我们就不能直接访问到这些jsp页面了,保证了页面的安全性. 在struts的管理中,是利用action来实现页面的跳转,进入in ...

  3. 使用idea建立gradle+SSM项目

    目录: 一.创建一个gradle项目   二 .在gradle中创建SSM项目 一 .创建一个gradle项目 第一步: 第二步:选择gradle,并选中web,然后点击Next进入下一步 第三步:此 ...

  4. 解决ssm项目表单数据提交到数据库乱码问题

    问题:在ssm整合的项目里,从前台页面获取表单数据存到数据库中乱码 先说解决办法然后分析:问题出在form表单的提交方式上,我的web.xml配置过滤器都已经指定了编码集,为什么没有生效?原因是,对于 ...

  5. SSM项目使用GoEasy 获取客户端上下线实时状态变化及在线客户列表

    一.背景 上篇SSM项目使用GoEasy 实现web消息推送服务是GoEasy的一个用途,今天我们来看GoEasy的第二个用途:订阅客户端上下线实时状态变化.获取当前在线客户数量和在线客户列表.截止我 ...

  6. 记一次SSM项目小结(一)

    记一次SSM项目小结(一) ssm框架 环境配置 服务器配置 解决方法  拦截器重定向到localhost nginx和tomcat中session失效 mybatis的xml文件不生效 数据库用户创 ...

  7. 用idea搭建SSM项目,原来这么简单

    目录 前言 软件环境 创建项目 数据库文件 配置文件 pom.xml log4j.properties jdbc.properties applicationContext.xml spring-mv ...

  8. 优雅地搭建整合ssm项目

    spring + spring mvc + mybatis 三大框架建议观看 黑马程序员出品的 Springmvc+Mybatis由浅入深全套视频教程 Spring框架2016版视频 观看顺序 ,我个 ...

  9. 模拟Springboot一:(零xml配置搭建SSM项目)

    在spring官网文档中无论是spring的基础文档,还是spring-mvc文档都推荐我们使用javaconfig的方式来搭建项目 间接说明 (优点:javaconfig配置>xml配置) 其 ...

随机推荐

  1. vue2.x学习笔记(六)

    接着前面的内容:https://www.cnblogs.com/yanggb/p/12571171.html. class与style绑定 操作元素的class列表和内联样式,是数据绑定的一个常见需求 ...

  2. 一口气带你踩完五个 List 的大坑,真的是处处坑啊!

    List 可谓是我们经常使用的集合类之一,几乎所有业务代码都离不开 List.既然天天在用,那就没准就会踩中这几个 List 常见坑. 今天我们就来总结这些常见的坑在哪里,捞自己一手,防止后续同学再继 ...

  3. BUU刷题01

    [安洵杯 2019]easy_serialize_php 直接给了源代码 <?php $function = @$_GET['f']; function filter($img){ $filte ...

  4. Python神库分享之geoip2 IP定位库

    先安装这两个 pip install python-geoip-geolite2 -i https://pypi.douban.com/simple pip install geoip2 然后下载资源 ...

  5. ES6中不得不说的关键字const

    上一节讲了let关键字,它是用来声明一个变量,只在块级作用域起作用.这一节我们来学习ES6新增的另一个关键字const. const 的作用 const是constant(常量)的缩写,const和 ...

  6. tp5--Excel表格导入导出

    来源于:https://www.cnblogs.com/MyIsLu/p/6830579.html PHPExcel 扩展包下载地址:             https://github.com/P ...

  7. OpenCV学习(1)——初步接触

    一.介绍OpenCV           OpenCV的全称是Open Source Computer Vision Library,是一个跨平台的计算机视觉库.OpenCV是由英特尔公司发起并参与开 ...

  8. 电子书下载:C# Database Basics

    下载: http://download.csdn.net/detail/maxwoods/4089269

  9. Windows10中打开git bash闪退解决方案

    重装系统后打开gitbash莫名其妙闪退... 究其原因,好像是盗版系统的null.sys文件损坏 那就在这里附上null.sys文件的下载链接: https://pan.baidu.com/s/1V ...

  10. Python-四则运算-蔡晓晴,杜婷萱

    github链接:https://github.com/Amy-CC/Arithmetic-Operation 一.需求 1.使用-n 参数控制生成题目的个数 2.使用-r 参数控制题目中数值(自然数 ...