我正在开发一个 Web 应用程序,其中我们有一个客户端小程序应用程序,它将检查客户端计算机上是否安装了证书。
但大家都知道 Mozilla 很快就会停止支持小程序。
谁能建议做同样事情的替代选择是什么?
我正在使用java 6,我的应用程序非常庞大,它是在java 6中开发的.现在我们尝试将java版本升级为7.
但是当我尝试使用java 7时,它会在枚举类中给出编译错误.在枚举类中,我定义了valueOf()方法,所以在java 7中它给出了编译错误.
码
public enum TestEnum {
TESTONE,TESTTWO, NONE;
public String toString() {
switch(this) {
case TESTONE:
return "Test one";
case TESTTWO:
return "Test two";
case NONE:
return "None";
}
return null;
};
public static TestEnum valueOf(Class<TestEnum> enumType, String value){
if(value.equalsIgnoreCase(TESTONE.toString()))
return TestEnum.TESTONE;
else if(value.equalsIgnoreCase(TESTTWO.toString()))
return TestEnum.TESTTWO;
else if(value.equalsIgnoreCase(NONE.toString()))
return TestEnum.NONE;
else
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
错误
Name clash: The method valueOf(Class<TestEnum>, String) of type TestEnum has the
same erasure as valueOf(Class<T>, String) of type Enum<E> …Run Code Online (Sandbox Code Playgroud)