首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

String cannot be resolved to a type异常

2012-02-22 
String cannot be resolved to a type错误common.jsp内容如下:%@ page languagejava contentTypetex

String cannot be resolved to a type错误
common.jsp
内容如下:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
  String appPath = request.getContextPath();
%>


为什么会提示 错误:
  Multiple annotations found at this line:
- String cannot be resolved to a type
- The method getContextPath() from the type HttpServletRequest refers to the missing type String

[解决办法]
查查你jsp的jdk是不是配置正确

热点排行