【发布时间】:2014-11-11 12:46:29
【问题描述】:
<%
String bn=request.getParameter("branch");
if(bn.equals("MK")){
%>
我在 myeclipse 中遇到错误
字符串无法解析为类型
ServletRequest 类型中的方法 getParameter(String) 引用了缺少的类型 String
在这一行找到多个注释: - 字符串无法解析为类型 - 来自 ServletRequest 类型的方法 getParameter(String) 指的是缺失的 输入字符串
这是 Java 代码/bean 类,我在其中遇到“字符串”的相同错误 代码在这里
public class Customer {//for Customer i am getting this error- Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
private int cid; // No error here
private String cname; //error here- String cannot be resolved to a type
private String email; //error here- String cannot be resolved to a type
private long phone;// No error here
// when i gives no arg constructor it gives this error
// Implicit super constructor Object() is undefined. Must explicitly invoke another constructor
//public Customer(){ }
}
...
...
} }
在它工作之前我在 Eclipse 中,现在它在 Myeclipse 中并且出现错误。 请告诉,我怎么能解决它。谢谢大家
另一个问题是 - 在 myeclipse 中,当我按下 Ctrl+空格(不起作用)时,它没有显示任何选项。
【问题讨论】:
-
不要使用 Scriptlet 而是使用不易出错的
JSTL或EL。 -
试试
java.lang.String?