• springboot


    要访问jsp页面时应作如下处理:

      1 必须是war包

      2  引入外部组建:

    	
    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter-tomcat</artifactId>
    		</dependency>
    		<dependency>
    			<groupId>org.apache.tomcat.embed</groupId>
    			<artifactId>tomcat-embed-jasper</artifactId>
    		</dependency>
    

      3  配置:

    spring:
      mvc:
        view:
          prefix: /WEB-INF/jsp/
          suffix: .jsp
          
    

      日志配置:

    log4j.properties

    #log4j.rootLogger=CONSOLE,info,error,DEBUG
    log4j.rootLogger=info,error,CONSOLE,DEBUG
    log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender     
    log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout     
    log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd-HH-mm} [%t] [%c] [%p] - %m%n     
    log4j.logger.info=info
    log4j.appender.info=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.info.layout=org.apache.log4j.PatternLayout     
    log4j.appender.info.layout.ConversionPattern=%d{yyyy-MM-dd-HH-mm} [%t] [%c] [%p] - %m%n  
    log4j.appender.info.datePattern='.'yyyy-MM-dd
    log4j.appender.info.Threshold = info   
    log4j.appender.info.append=true   
    #log4j.appender.info.File=/home/admin/pms-api-services/logs/info/api_services_info
    log4j.appender.info.File=/Users/dddd/Documents/testspace/pms-api-services/logs/info/api_services_info
    log4j.logger.error=error  
    log4j.appender.error=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.error.layout=org.apache.log4j.PatternLayout     
    log4j.appender.error.layout.ConversionPattern=%d{yyyy-MM-dd-HH-mm} [%t] [%c] [%p] - %m%n  
    log4j.appender.error.datePattern='.'yyyy-MM-dd
    log4j.appender.error.Threshold = error   
    log4j.appender.error.append=true   
    #log4j.appender.error.File=/home/admin/pms-api-services/logs/error/api_services_error
    log4j.appender.error.File=/Users/dddd/Documents/testspace/pms-api-services/logs/error/api_services_error
    log4j.logger.DEBUG=DEBUG
    log4j.appender.DEBUG=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout     
    log4j.appender.DEBUG.layout.ConversionPattern=%d{yyyy-MM-dd-HH-mm} [%t] [%c] [%p] - %m%n  
    log4j.appender.DEBUG.datePattern='.'yyyy-MM-dd
    log4j.appender.DEBUG.Threshold = DEBUG   
    log4j.appender.DEBUG.append=true   
    #log4j.appender.DEBUG.File=/home/admin/pms-api-services/logs/debug/api_services_debug
    log4j.appender.DEBUG.File=/Users/dddd/Documents/testspace/pms-api-services/logs/debug/api_services_debug
    

      

    application.yml

    spring:
      application:
        name: login-demo
      mvc:
        view:
          prefix: /WEB-INF/jsp
          suffix: .jsp
      datasource: 
        url: jdbc:mysql://localhost:3306/user
        username: root
        password: 123456
        driver-class-name: com.mysql.jdbc.Driver
    mybatis: 
      configuration:
        log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    

      pom.xml

    <!-- spring boot start -->
    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter</artifactId>
    			<exclusions>
    				<!-- 排除自带的logback依赖 -->
    				<exclusion>
    					<groupId>org.springframework.boot</groupId>
    					<artifactId>spring-boot-starter-logging</artifactId>
    				</exclusion>
    			</exclusions>
    		</dependency>
    
    		<!-- springboot-log4j -->
    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter-log4j</artifactId>
    			<version>1.3.8.RELEASE</version>
    		</dependency>
    

      

  • 相关阅读:
    TelephonyManager对黑名单的管理
    1125: 零起点学算法32——输出四位完全平方数
    1124: 零起点学算法31——开始新的起程
    1123: 零起点学算法30——参加程序设计竞赛
    1122: 零起点学算法29——等级分制度
    1121: 零起点学算法28——判断是否闰年
    1120: 零起点学算法27——判断是否直角三角形
    1119: 零起点学算法26——判断奇偶数
    1118: 零起点学算法25——求两点之间的距离
    1117: 零起点学算法24——求正弦和余弦
  • 原文地址:https://www.cnblogs.com/MyJavaStudy/p/9681792.html
Copyright © 2020-2023  润新知