Question: I use Struts 2 Framework and i want to pass a parameter in my action like this `localhost:8080/MyApp/ModifierMessage.action?id=9`. In my jsp page i have the following text with the action:

```
<a href=\"/OCC/ModifierMessage.action\">Modifier</a>

```

Someone could help me to add dynamic id to my action ?

Answer: 
Use `<s:url>` and `<s:a>` tags. For example is your dynamic id is called `dynamic_id`:

```
<s:url var="myUrl" action="ModifierMessage.action" namespace="/OCC">
    <s:param name="id">%{dynamic_id}</s:param>
</s:url>

<%-- The link --%>

<s:a href=%{#myUrl}>Modifier</s:a>

```
```
public class MyAction extends ActionSupport {
   private int id;

   public String execute() {
       ...
      this.id = 123;
      return SUCCESS; 
   }

   public int getId() { return this.id; }
   public void setId(int id) { this.id = id; }
   ...
}

```

In the above code if it returns SUCCESS then the browser will be forwarded to

```
/<app-prefix>/myNamespace/otherAction.action?id=123

```