求大神指导,我这个是根据微信号查询,字符串类型,绝对是字符串类型,但是我的代码如下。查什么都是全部都显示,求改正啊
action:
public String getList() throws Exception
{
dingDanGuanLiList = dao.getList(weiXinHao);
return SUCCESS;
}
public List<DingDanGuanLi> getList(String weixinhao)
{
String Where="";
if(weixinhao!=null){
Where = Where + " where weiXinHao='"+weixinhao+"'";
}
return this.findAll(Where);
}
private List<DingDanGuanLi> findAll(String where)
{
Session sess = this.getSessionFactory().openSession();
try
{
Query query = sess.createQuery(" From DingDanGuanLi " + where + " order by id ");
return query.list();
}
finally
{
sess.close();
}
}
JSP:
微信号:<input type="text" name="weiXinHao" size="15" >
<s:submit theme="simple" name="List" action="List" value="查询" cssClass="button_style"/>
<s:submit theme="simple" name="Add" action="Add" value="添加" cssClass="button_style" method="add"/>