📄 queryaction.java
字号:
/*
* Created on 2004-5-20
*
*/
package com.esimple.framework.web.action.support;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.esimple.framework.web.action.BaseForm;
import com.esimple.framework.web.action.IbatisSupportAction;
/**
* @author steven
*
*/
public class QueryAction extends IbatisSupportAction {
/* (non-Javadoc)
* @see com.esimple.framework.web.action.BaseAction#execute(com.esimple.framework.web.action.BaseForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
protected String execute(
BaseForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
int begin;
int length;
String statement = form.getValueAsString(Constants.INPUT_dbstat,true);
try{
begin = form.getValueAsInt( Constants.INPUT_beginNum );
length = form.getValueAsInt( Constants.INPUT_pageLength);
}catch(Exception e) {
logger.info( "intput para beginNum,length not correct" );
begin = 0;
length = -1;
}
if( statement == null ) return FORWARD_FAILURE;
List list=null;
if( length > 0 ){
list = sqlMapDao.paginatedQuery(statement,form.getValues(),begin,length);
}else{
list = sqlMapDao.query(statement,form.getValues());
}
if( list != null){
request.setAttribute(Constants.OUT_result, list);
form.setValue(Constants.OUT_recordCount, list.size());
}
return FORWARD_SUCCESS;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -