我正在尝试学习如何使用远程分区,所以我一直在查看struts2 jquery插件的展示,但我不太了解它是如何工作的。以下是他们下载的内容:
struts.xml:
<struts>
// some other instructions and constants
<include file="showcase.xml" />
</struts>
showcase.xml:(应该是空的吗??)
<struts>
<package name="showcase" extends="struts-default,json-default" namespace="/">
</package>
</struts>
远程分区.java:
package com.jgeppert.struts2.jquery.showcase;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
@ParentPackage(value = "showcase")
public class RemoteDiv extends ActionSupport {
private static final long serialVersionUID = -6793556760537290969L;
@Action(value = "/remote-div", results = {
@Result(location = "remote-div.jsp", name = "success")
})
public String execute() throws Exception
{
return SUCCESS;
}
}
所以我的问题是:
1) 注释@Action是强制性的还是替换了我们应该在struts.xml中声明的操作?
2) 什么是
/远程div
关于我们应该在struts.xml中提到的动作的名称??
3) 就我而言,我正在使用
瓷砖
,我应该执行location=“mypage.tiles”吗?我指的是tiles.xml中给页面的名称?
4) 怎么样
@ParentPackage(value=“showcase”)
,我们是否应该只提及父包的名称而不提及整个路径??
5) 在这种情况下,我需要
json插件
?
如果我的问题很愚蠢的话,我会提前说错话。但请理解我,伙计们,我还是个初学者。提前表示衷心的感谢!