Implicit argument in AbstractWebScript

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Implicit argument in AbstractWebScript

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&param2=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?

1 Reply
Member II

Re: Implicit argument in AbstractWebScript

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.