文献:http://www.verydemo.com/demo_c140_i34322.html
在使用SSH的时候,会在DaoImpl中生成 findByExample 和findByAll
一般情况在 我们都会在execute方法中使用findByAll 去给页面准备数据
加入你jsp页面中 包含了这个Action 那么就会出现数据 覆盖的问题
<s:action name="category" executeResult="false"></s:action>
那么现在 在execute方法中 直接使用 findByExample
查询方法 也在execute中 不必在去写
代码:
public String execute(){
List<Category> cList=(List<Category>)categoryService.findByExample(getCategory());
Map map=(Map)ServletActionContext.getContext().get("