I'm trying to learn how to use a remote division, so I've been checking the showcase of struts2-jquery-plugin and I didnt understand much how things are working. Here what they have in the download :
struts.xml :
<struts>
// some other instructions and constants
<include file="showcase.xml" />
</struts>
showcase.xml : ( Should it be empty?? )
<struts>
<package name="showcase" extends="struts-default,json-default" namespace="/">
</package>
</struts>
RemoteDiv.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;
}
}
So my questions are :
1) Is the annotation @Action obligatory or is it replacing the actions which we should declare in struts.xml?
2) What is /remote-div about? The name of the action which we should mention in struts.xml??
3) In my case I'm using tiles, should I do location = "mypage.tiles" , I mean the name given to the page in tiles.xml ?
4) what about @ParentPackage(value = "showcase"), should we mention the name of the parent package only without the entire path??
5) In which case I would need json plugin?
I do appologise in advance if my questions are stupid. But understand me guys, I'm still a beginner. A big Thanks in advance!