框架底层综合+快速开发+代码重用框架-设计(Service层)
框架底层综合+快速开发+代码重用框架-设计(Action层)
由于Action是设计业务,不好描述,所以这里不再描述,将源码赋予附件中,感兴趣的朋友自行研究。
实例代码:
@ParentPackage("struts-default")
@Namespace("/security")
@Results( { @Result(name = "modifyerror", type = NullResult.class, value = "/main/admin/security/user/modifyerror.html", params = { "contentType", "text/html;utf-8" }),
@Result(name = "modifyok", type = NullResult.class, value = "/main/admin/security/user/modifyok.html", params = { "contentType", "text/html;utf-8" }),
@Result(name = "error", type = NullResult.class, value = "/error.jsp", params = { "contentType", "text/html;utf-8" }),
@Result(name = "invalid.token", type = NullResult.class, value = "/invalidToken.jsp", params = { "contentType", "text/html;utf-8" }),
@Result(name = "input", type = NullResult.class, value = "/main/admin/security/user/edit.jsp", params = { "contentType", "text/html;utf-8" }),
@Result(name = "close", type = NullResult.class, value = "/main/admin/tip/close.jsp", params = { "contentType", "text/html;utf-8" }),
@Result(name = "complete", type = NullResult.class, value = "/main/admin/tip/success.jsp", params = { "contentType", "text/html;utf-8" }),
@Result(name = "list", type = NullResult.class, value = "/main/admin/security/user/list.jsp", params = { "contentType", "text/html;utf-8" }),
@Result(name = "edit", type = NullResult.class, value = "/main/admin/security/user/edit.jsp", params = { "contentType", "text/html;utf-8" }) })
@Controller("userAction")
public class UserAction extends ActionSupport {}
本文详细介绍了基于Struts框架的Action配置方式,包括不同结果类型的设置及其对应的视图路径,为开发者提供了一个清晰的Action配置示例。

被折叠的 条评论
为什么被折叠?



