springboot和jsp,以及引入jquery

包:

   src:

     main:

        java:

        resources:

            static:

            templates:

     test:

2.在static导入jquery源文件,在templates写入jsp文件

3.配置文件:

server.port=8888
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.jsp

4.mvc自动略掉jquery,交个tomcat处理:

   

@Configuration
public class MyMvcConfig extends WebMvcConfigurationSupport {


@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
super.addResourceHandlers(registry);
}
}

5.jquery导入jsp:


转载于:https://www.cnblogs.com/shanshen/p/9888823.html

你可能感兴趣的:(javascript,java,开发工具)