2018/7/4
一.ssh搭建
参考网址:
https://www.cnblogs.com/laibin/p/5847111.html
二.tomcat 在eclipse的server 里没有选项,需要进行配置
1)在环境变量里path添加tomcat安装目录下的bin文件夹路径
2)server 里没有tomcat选项,是因为缺少插件 server adaper,需要在help->install new software 中添加插件
参考网址 :
https://blog.youkuaiyun.com/fengpojian/article/details/70171327
三.jsp 加载css无效(使用myeclipse)
解决方法;
与html不同,html在加载css时,可以直接使用相对路径
例如:
test.html 和test.css在同一文件夹下,在test.html 中可以写
<link rel="stylesheet" type="text/css" href="./test.css">
或<link rel="stylesheet" type="text/css" href="test.css">
但是,在jsp中
需要变为绝对路径
例如,当我的项目名为mypro时,并且test.jsp,test.css 同在该项目的webroot下的web文件夹里
如下图
则在test.jsp中写<link rel="stylesheet" type="text/css" href="./test.css">是无效的
应该改为:<link rel="stylesheet" type="text/css" href="../mypro/web/test.css">
其中 .. 表示服务器ip和端口号, mypro是项目名,web是webroot中的一个文件夹,即jsp和css所在的文件夹
或者也可以这样改:
<link rel="stylesheet" type="text/css" href="<%=basePath%>/web/test.css">
其中basePath是jsp脚本获取的网站根目录:在这里相当于../mypro
获取的方式是以下代码:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
倘若当前服务器的ip个端口号为127.0.0.1:8000 , 项目名为mypro
则打印出的basepath为 http://127.0.0.1:8000/mypro/ , 在这里127.0.0.1 就是localhost