Last updated Dec 8, 2017

How do I get hold of the GET-Parameters within a macro?

If you want to get hold of the GET-Parameters within your Macro (Java-Code), you need to access the Java servlet.

First add a dependency for the servlet-api to your pom.xml:

1
2
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>

Now you can easily access every parameter you wish like this:

1
2
String showParam = ServletActionContext.getRequest().getParameter("show");

Rate this page: