当前位置: 代码迷 >> Java Web开发 >> String cannot be resolved to a type异常
  详细解决方案

String cannot be resolved to a type异常

热度:4465   发布时间:2016-04-17 01:05:27.0
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是不是配置正确
  相关解决方案