1、同一个包内的class不需要import。
2、project classpath 通常指的是pom.xml里的依赖。
3、How java Launcher finds Classes?
The virtual machine searches for and loads classes in this order:
Bootstrap classes
Extension classes
User classes(use classpath to specify)
reference: https://docs.oracle.com/javase/7/docs/technotes/tools/findingclasses.html#jarclass
4、为什么要配置classpath变量?
配置classpath变量,才能使得java解释器知道到哪里去找标准类库,这些标准类库是别人已经写好了的,我们只管使用。比如我们常用到java.lang包中的类,在配置classpath变量后被设为默认导入,所以在写程序时就不用import这个包了。
5、那么这些标准类库在哪呢?
在以JDK的lib目录下以jar为后缀的文件中:一个是dt.jar,一个是tools.jar,这两个jar包都位于C:/jdk1.6.0/lib目录下,所以通常我们都会把这两个jar包加到我们的classpath环境变量的值为:.; C:\Program Files\Java\jdk1.5.0_17\\lib\tools.jar; C:\Program Files\Java\jdk1.5.0_17\\lib\dt.jar;
6、web.xml的作用?
For any web application, entry point is web.xml(under WEB-INF directory)
which describes how the incoming http requests are served / processed
Further, it describes about the global-context and local-context param (i.e.; <context-param> & <init-param>) for loading the files particular to project requirements & contains respective listener
7、springboot默认不支持jsp, 只支持模板引擎,加上spring-boot-starter-thymeleaf在依赖中就解决了
`<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>`
8、intellij 不会自动hot reload
The easiest solution: run app debug mode and press Ctrl + f9 (short-cut for build)
or
You need to enable the “Make project automatically” option. You can find it in Settings – Build, Execution, Deployment – Compiler
To open the registry, Press Ctrl-Alt-Shift-/ and select "Registry" from the menu that appears, enable the “compiler.automake.allow.when.app.running” check-box。
9、解决浏览器访问跨域
在类或者方法加上@CrossOrigin注解
10、pom.xml文件在inteliji idea出现删除线并且是灰色
file->settings->maven->ignore files