2019-12-01 15:12
@JFinal 可是我看源码
/**
* Returns the value of a request parameter and convert to Integer.
* @param name a String specifying the name of the parameter
* @return a Integer representing the single value of the parameter
*/
public Integer getParaToInt(String name) {
return toInt(request.getParameter(name), null);
}
是这样的
2019-12-01 14:11
另外 @JFinal controller getParaToXXX 方法应该直接调用getPara方法而不是调用request.getParameter,这样只需要重写getPara就行了,否则还需要重写一堆getParaToXXX
2019-11-30 13:56
@JFinal 不可以 参数注入在拦截器之前执行了,request.getParameterMap()为空,getBean在拦截器之后执行 request.getParameterMap()不为空
2019-11-30 13:28
@JFinal 用的最新版 注入时request.getParameterMap() 为空 getBean时正常获取到了
2019-11-30 12:25
@JFinal 按照以上方法处理json 数据发现在controller可以使用getBean(xxx.class,null) 获取数据 但是无法使用@Para("") 进行参数注入 ,使用表单提交是可以进行注入的,比较烦恼