1.下载软件binary版本和source版本的区别:
前者是编译好的,可以直接使用的版本。
后者是源代码版本,需要自己编译才行。
2.eclipse导入外部jar包
(1)WebContent-WebInf-lib
(2)https://www.cnblogs.com/ruiati/p/3591203.html
选中所有的jar包:打开lib文件夹—>按住shift键—>鼠标左键选中第一个,再选中最后一个。
3.org.apache报错
参考https://www.crifan.com/java_eclipse_the_import_org_apache_cannot_be_resolved/可知是缺少依赖的jar包。
4.eclipse import existing project失败
在root directory下必须要有.project文件才能被Eclipse认为是一个工程。如果没有,可以自己新建一个文件,内容照着别的工程抄一下,或者自己在Eclipse里新建一个工程,但是不要勾选Use default location,在下面选择要导入的工程。
5.eclipse导入文件时中文注释乱码问题
https://blog.csdn.net/yj310873325/article/details/72830095/
6.java web启动报错:
The origin server did not find a current representation for the target resource
这是因为路径问题,点击入口界面如login.jsp登陆。另外jsp页面要在webcontent下?
7.
8.下载及使用hibernate tools
参考:https://blog.csdn.net/u014470581/article/details/51985535
在jboss官网上找到适合eclipse及jdk版本的tool,将下图中的网址复制到
help->install new software中,选择hibernate tools下载。
选择项目的src文件夹选择生成cfg文件并创建console configuration。其中hibernate 选择版本号3.5(项目中需要有对应的jar包)。之前用了5.3版本的hibernate一直报错Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set!!并且jdk版本不能选择jdk11的而是选择安装jdk8的版本,否则也会报错,我看一些博客中写的添加jar包的方法,亲测无效!!此外要注意的是,看报错一定不要忘了看cause by!!
9.启动web项目报错
org.dom4j.DocumentException: Connection reset Nested exception: Connection reset
发现是连接的问题,对比以往项目,注销sessionFactory.close();
或者不用管,过一会就好了??
DocumentException: www.hibernate.org Nested exception: www.hibernate.org
https://www.cnblogs.com/xiaoluo501395377/archive/2012/11/06/2756204.html
10.
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
检查web.xml是否放错了位置。
11.Hibernate 中的 openSession和getCurrentSession 方法的区别
https://blog.csdn.net/chuck_kui/article/details/54845235
此外,对于getCurrentSession,与数据库有关的操作包括查询都需要开启及关闭事务。
12.
(1)jsp页面取值方式
http://www.cnblogs.com/wuyun-blog/p/6922999.html
(2)request.getParameter() 和request.getAttribute() 区别
一般通过表单和链接传递的参数使用getParameter,getAttribute()常用于servlet页面传递参数给jsp。HttpServletRequest 类有setAttribute()方法,而没有setParameter()方法。
https://blog.csdn.net/ryelqy/article/details/79230513
13.打包war文件
必须勾选”Export source files“选项,将java源文件也一起导出到war包里。
14.servlet三大作用域
https://www.cnblogs.com/z0228-0322x/p/6170588.html
https://blog.csdn.net/u013938465/article/details/48712137
request的作用域是一次请求,我认为一次请求不在于url地址是否发生变化,而是是否在该页面上执行了action请求操作。
至于转发和重定向最重要的区别:转发属于一次请求,重定向属于两次请求。
eclipse+StrutsHibernate框架
最新推荐文章于 2021-07-13 11:11:13 发布