📄 oneguestbookform.java
字号:
package com.enlen.book;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import com.uniland.common.CallService;
import com.uniland.common.TaxServiceForm;
import com.uniland.dao.RowSet;
public class OneGuestBookForm extends TaxServiceForm {
/**
* Constructor
*/
public OneGuestBookForm() {
super();
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
String strSQL = "";
strSQL="select * from guestbook where id='"+request.getParameter("id")+"'";
RowSet rsQuery = null;
try{
rsQuery = CallService.getDao().runSQLReturnRS(strSQL);
}catch(Exception e){
e.printStackTrace();
}
// request.getSession().setAttribute("guestbook",rsQuery );
//RowSet rsQuery=(RowSet)request.getSession().getAttribute(Tokens.TEXT_QUERY );
if (rsQuery==null) {
return;
}
if(rsQuery.rowCount()==0)
{
rsQuery.addEmptyRow();
}
mrs=rsQuery;
}
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
// Validate the fields in your form, adding
// adding each error to this.errors as found, e.g.
// if ((field == null) || (field.length() == 0)) {
// errors.add("field", new ActionError("error.field.required"));
// }
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -