1.String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
这个语句是用来拼装当前网页的相对路径的。
String basePath 这个应该是一个存放URL的变量
request.getSchema()可以返回当前页面使用的协议,就是“http”
request.getServerName()可以返回当前页面所在的服务器的名字,就是“localhost"
request.getServerPort()可以返回当前页面所在的服务器使用的端口,就是8080,
request.getContextPath()可以返回当前页面所在的应用的名字,如名称为“mystudy”。
<base href="...">是用来表明当前页面的相对路径所使用的根路径的。
比如,页面内部有一个连接,完整的路径应该是 http://localhost:8080/mystudy/action/login.do
其中http://server/是服务器的基本路径,mystudy是当前应用程序的名字,那么我的根路径应该是http://localhost:8080/mystudy/。
2.
3.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="author" content="Csdn" />
<meta name="Copyright" content="Csdn" />
<meta name="description" content="" />
<meta content="" name="keywords" />
第一行说明了他的文字编码