这两天找到一个老师的JAVAWEB课讲的十分的透彻,其中就有一开始自学没有学到的部分以下是一些总结
一.
每一个web项目webContent都有一个web.xml文件,其中的一个内容就是控制了文件的读取先后顺序。
这是一个以前没有注意的地方,而且这个文件的建立也是要勾选的在创建的时候需要勾选。
二.
jsp文件其实一个可以嵌入一些java语句的html语法的拓展。它的本质是一个servlet,在它第一次运行的时候它会被先由一个.jsp文件解析为.java文件再解析成.class文件然后服务器以html文件来进行显示
而在起初是没有jsp文件的,servlet是一个java程序它的优势是利与业务逻辑流程操作,页面显示方面不方便,而html是一个页面显示文件,但是处理动态数据方面不方便。
所以jsp出现了,中和了这两者的一个优势。
同时在第二次以及以后的网页访问服务器会直接访问那个.class文件,所以这也就是第一次登录会慢 第二次会变快的一个原因。
还有就是jsp文件和servlet是可以相互转化的。