New to Alfresco.
I am writing Java-backed AbstractWebScript. I need to use implicit arguments.
My URI looks like:
mydocuments/param1/param2
The caller will call this URI as: documents/value1/value2
I need to get a handle on param1 and param 2 (and their values) inside the execute method.
public class MyWebScript extends AbstractWebScript{
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException {
// I need to get the value of param1 and param2 inside this method
}
My question is:
How do I get a handle on param1 and param2 inside the execute method?
If I defined it as explicit argument in the URI (as /param1=value1¶m2=value2), I know that I can get them as req.getParameter("param1") API. But as because I am using the implicit argument (as opposed to explicit argument), how do I get a handle of param1 and param2?
I found it out.
The API req.getPathInfo() returns the values of the parameters as:
myDocuments/value1/value2
After that, you can use StringTokenizer to get the value of each parameter.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.