03-30-2017 12:05 PM
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?
03-30-2017 04:40 PM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.