request.getRealPath("..\")
request.getRealPath("..\classes")
request.getRealPath("..\classes")
解决方案 »
- ${m.chindrenMenu[0].menuId?c}请问错在什么地方,求教
- tomcat6.0 jndi配置问题
- 代码不懂,能详细解释一下吗?
- javascript如何得到两个时间的差值? (时间格式:2008-06-12 15:30:25)
- 各位大虾们,谁有FCKeditor 在JSP中的用法相关的文章吗!在线等!
- 问一下weblogic7把由jsp编译出来的.java文件都放在哪里了?
- 求救:如何使下拉列表框不可以选择?
- 如何判断两个STRING类型完全相等(==):简单吧--可惜我书没有带来,忘了!
- 高分求Jdk下载地址,提供地址都有分
- 我想把查询显示的数据导入到excel中 或着是 把查询的数据生成报表 用什么技术实现 谢谢大家
- 自己写的servlet为什么不能显示出来呢?初学者的问题!
- 我做了个留言簿,运行出错,帮忙看看。谢谢
<br>
<%=request.getRealPath("..\classes") %>出错:
Note: sun.tools.javac.Main has been deprecated.
/test.jsp:47: String not terminated at end of line.
out.print((request.getRealPath("\") ));
^
/test.jsp:48: ')' expected.
pageContext.write(_jsp_string3, 0, _jsp_string3.length);
^
/test.jsp:49: Invalid escape character.
out.print((request.getRealPath("..\classes") ));
^
3 errors, 1 warning
//javax.servlet.ServletConfig config
ServletContext context = config.getServletContext();
System.out.println(context.getRealPath("/"));//output the webcontent directory
String contextpath=request.getContextPath();
String relativePath = requesturl.substring(contextpath.length());
String filepath= getServletConfig().getServletContext().getRealPath(relativePath);另外request.getRealPath("")这方法已经不用了
System.out.println(context.getRealPath("/")) // 这个在Jsp和servlet中都可以用,JSP中把system.去掉。
classpath: String s=System.getProperty("java.class.path");