`
zhaojian0910
  • 浏览: 46367 次
社区版块
存档分类
最新评论

jsp页面中用到pageContext.request.contextPath报错问题

    博客分类:
  • jsp
阅读更多

jsp页面部分代码

<frameset frameborder="no" rows="100px, * , 30px">
	<frame name="top" scrolling="no"
		src="${pageContext.request.contextPath}/ui_topUI.action">
	<frameset cols="180px, *" frameborder="no">
		<frame name="left" scrolling="no"
			src="${pageContext.request.contextPath}/ui_leftUI.action">
		<frame name="right" scrolling="no"
			src="${pageContext.request.contextPath}/ui_rightUI">
	</frameset>
	<frame name="bottom" scrolling="no"
		src="${pageContext.request.contextPath}/ui_bottomUI.action">
</frameset>

 此时eclipse报红色感叹号,错误为javax.servlet.jsp.jspException can not reslove a type

从网上查得知,缺少jsp-api.jar

 

我最初是把这个jar包加到了工程WEB/INF/lib目录下,运行又报了错

 空指针异常

 

继续往上搜索答案,终于找到原因了

不能直接把这个jar包加到了工程WEB/INF/lib目录下,而是需要引用tomcat/lib下面的jsp-lib.jar包

 

再次运行,成功

分享到:
评论

相关推荐

    jsp页面中${pageContext.request.contextPath}介绍

    ${pageContext.request.contextPath}是JSP取得绝对路径的方法 例如:浏览器地址栏为”http://localhost:8080/test/index.jsp “ 那么:取出来的就是”http://localhost:8080/test”,简写为”/test” /test 等价于 ...

    JavaScript中${pageContext.request.contextPath}取值问题及解决方案

    在JSP里取${pageContext.request.contextPath},方式一是可以正常取到,但方式二却取到的是 字符“${pageContext.request.contextPath}” 方式一: [removed] var t = "${pageContext.request.contextPath}"; ...

    java web 登录验证码生成类

    ${pageContext.request.contextPath}/checkcode.jsp"/&gt; 另外在web.xml中配置验证码类的加载: &lt;servlet-name&gt;CheckCodeImage &lt;servlet-class&gt;com.netshop.common.util.CheckCodeImage&lt;/servlet-class&gt; ...

    jsp+mysql师生作业互动系统

    &lt;li&gt;&lt;a href="${pageContext.request.contextPath}/student!list"&gt;学生信息管理&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="${pageContext.request.contextPath}/exam!list"&gt;学生作业情况查询&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="${pageContext....

    springMVC+mybatis

    ${pageContext.request.contextPath}/my/login" method="post"&gt; ${message } 邮箱: 密码: 登录"&gt; ${pageContext.request.contextPath}/my/regist"&gt;注册 ${pageContext.request....

    jsp运行时的问题集合

    自己在实际开发中,发现并解决问题的总结。

    人脸识别研究综述

    人脸识别,用于进行人脸检测.二、javaEE框架学习笔记 2、的涵义: ...其中:“${pageContext.request.contextPath}”就是获取request的绝对路径,它的作用相当于“&lt;%=pageContext.request.contextPath%&gt;” 3、

    基于iframe实现类似于ajax的页面无刷新

    form id=”form0″ action=”${pageContext.request.contextPath}/news/baikeAdd.form” enctype=”multipart/form-data” method=”POST” target=”hidden_frame”&gt; … … &lt;/form&gt; &lt;iframe name=’...

    kindEditor中关于上传处理

    link rel=”stylesheet” href=”${pageContext.request.contextPath}/common/kingeditor/themes/default/default.css”/&gt; &lt;link rel=”stylesheet” href=”${pageContext.request.contextPath}/common/...

    JSTL高级用法

    ${pageContext.request.contextPath} 服务的web application 的名称 ${pageContext.request.method} 取得HTTP 的方法(GET、POST) ${pageContext.request.protocol} 取得使用的协议(HTTP/1.1、HTTP/1.0) ${...

    ext时间控件,可以选择时分秒

    link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extjs/pulgins/datetime/datetime.css" /&gt; [removed][removed] [removed][removed] [removed][removed] [removed]...

    struts2<s:if>使用心得

    href="${pageContext.request.contextPath}/ga/changeTaskAssigment.action?taskInstanceId=&lt;s:property value="id"/&gt;" &gt;我来处理)&lt;/s:if&gt; 受评对象准备评级资料"}'&gt; ${pageContext.request.contextPath}/ga/...

    flash-swf格式计算器使用Object控件嵌入html即可使用(文件内有dom)

    codebase="${pageContext.request.contextPath }/common/plugins/calc/swflash.cab#version=6,0,0,0" id="BAPPFlash116526140886070277838"&gt; value="${pageContext.request.contextPath }/common/plugins/calc...

    轮播jar包

    link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/css/login/login.css?version=20200311" /&gt; &lt;/head&gt; &lt;body&gt; &lt;li&gt;&lt;img src = "${pageContext....

    ec标签在struts2.0中的使用

    imagePath="${pageContext.request.contextPath}/images/*.gif" action="${pageContext.request.contextPath}/presidents.run" filterable="false" sortable="false" &gt; ... 里的属性还有......

    jQuery实现标签子元素的添加和赋值方法

    一、在jsp页面中定义&lt;select&gt;标签,如下: 科室: &lt;select class="dept-name-show" style="width: 70%;...var url = "${pageContext.request.contextPath}/getDepts.do";//请求路径 $(".dept-name-show").cli

    CONVERT函数方法大全_JAIMY.files ajax test url

    url:"${pageContext.request.contextPath}/module/updateModuleOrder.html", dateType:"json", data:"moduleId="+id+"&num="+demo1.value, type:"post", success:function(result,textStatus){ ...

    HTML+CSS实现动态背景登录页面

    主要介绍了HTML+CSS实现动态背景登录页面的相关资料,需要的朋友可以参考下

    java.lang.NoSuchMethodError: javax/servlet/jsp/PageContext.getELContext()Ljavax/

    NULL 博文链接:https://albert0707.iteye.com/blog/562969

Global site tag (gtag.js) - Google Analytics