文章分类 -  路径问题

每当创建一个servlet时,myeclipse会自动帮你在WEB-INF下面 的web.xml里面帮你 配置好<servlet-name> <servlet-class> <url-pattern>
摘要:<servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display 阅读全文

posted @ 2016-07-12 19:55 雪的心 阅读(185) 评论(0) 推荐(0)

创建一个web项目时 上面会默认给出Context root URL 这应该是上下文路径,或者项目根路径
摘要:n 阅读全文

posted @ 2016-07-12 19:47 雪的心 阅读(584) 评论(0) 推荐(0)

servlet的url是在创建servlet文件时配置的,也可以在web.xml中查看,src下的是java文件,这里访问的是映射后的url地址。
摘要:在index.jsp跳转到helloservlet时,相对路径为什么不是src/servlet/helloservlet?这个地方我要看那些资料呢? 在index.jsp跳转到helloservlet时,相对路径为什么不是src/servlet/helloservlet?这个地方我要看那些资料呢? 阅读全文

posted @ 2016-07-12 19:41 雪的心 阅读(546) 评论(0) 推荐(0)

上下文路径指的是哪个路径啊 request.getContextPath在这里指的是哪个路径呀
摘要:就是这个web项目的根目录。/webproject 阅读全文

posted @ 2016-07-12 19:28 雪的心 阅读(1037) 评论(0) 推荐(0)

request.getcontextPath() 详解
摘要:request.getcontextPath() 详解 <%=request.getContextPath()%>是为了解决相对路径的问题,可返回站点的根路径。? 但不用也可以,比如<a href="<%=request.getContextPath()%>/catalog.jsp">,可以直接用< 阅读全文

posted @ 2016-07-12 18:41 雪的心 阅读(1535) 评论(0) 推荐(0)

form中的action的默认路径就是当前路径,?? 而struts中的action 的path属性默认路径为根路径,所以要加上所在的文件夹得路径。 还不是太懂
摘要:String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 这个语句是 阅读全文

posted @ 2016-07-12 18:31 雪的心 阅读(2875) 评论(0) 推荐(0)

感觉说的绝对路径有点问题
摘要:在JSP中我们总会出现一个路径问题比如: jstest001是项目名 1、绝对路径 <script type="text/JavaScript" src="/jstest001/ext/ext-base.js"></script>和 2、相对路径 <script type="text/javascr 阅读全文

posted @ 2016-07-12 18:25 雪的心 阅读(122) 评论(0) 推荐(0)

basePath
摘要:<%String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> 阅读全文

posted @ 2016-07-12 18:24 雪的心 阅读(759) 评论(0) 推荐(0)

导航