Java web开发常见基础知识点集合

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微个日光日

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值