日期:2014-05-17 浏览次数:20669 次
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>/category/main.jsp</welcome-file>
</welcome-file-list>
<struts>
<include file="struts-authorize.xml"/>
<include file="struts-category.xml"/>
<include file="struts-cart.xml"/>
<include file="struts-order.xml"/>
<package name="dang-default" extends="json-default">
</package>
</struts>
$(function(){
$.get(
"cat.action",
function(data){
$("#left").html(data);
}
);
});
<package namespace="/category" name="category-default" extends="dang-default">
<action name="cat" class="dangdang.actions.category.CategoryAction">
<result name="success">/category/category.jsp</result>
</action>
</package>
/**
*...
*/
public String execute(){
ICategoryDAO dao=new DCategoryDAO();
cats=dao.findByid(1, true);
return "success";
}
/**
*...
*/