loadClass
public Class loadClass(String name)
throws ClassNotFoundExceptionLoads the class with the specified name.
public Class loadClass(String name)
throws ClassNotFoundExceptionLoads the class with the specified name.
ClassLoader.getSystemClassLoader().loadClass("Integer");
//Class.forName("Integer");
}catch(ClassNotFoundException e){
System.out.println("222"+e.getMessage());
}
是这样吗?为什么还抛出异常呀?
222Integer
说明是进入异常处理了
意思是说这二个语句在执行时都被catch了
你用java.lang.Integer试试
<event type="java" path="com.sinosoft.service.app.JavaTestEvent" invoke="exportToFile" />
<response name="success" type="view" value="test"/>
<input name="arg1" type="java.lang.Integer" />
<input name="arg2" type="java.lang.String" />
</request-map>
把type都改成全路径就对了,必须得这样吗?这样配制起来不是有点麻烦?有什么解决办法使只写个"Integer"就行了?(我的path已设了.;了)
java.lang.String
用反射一定要把类些完整,不只是类名就够了,还要包名
java.lang.String