# Struts2 Showcase - Non UI Tags - Action Prefix (Freemarker)

# Non Ui Tag - Action Prefix (Freemarker)

Action Prefix
By clicking on 'action prefix' button, the request will go to the action alias 'actionPrefix' instead of the normal 'submit' action alias.

Method Prefix
By clicking on the 'method prefix' button, the request will cause Struts to invoke 'submit' action alias's 'alternateMethod' method instead of the default 'execute' method.

Redirect Prefix
By clicking on the 'redirect prefix' button, the request will get redirected to www.google.com instead

Redirect Action Prefix
By clicking on the 'redirect-action prefix' button, the request will get redirected to an action alias of 'redirectActionPrefix' instead of 'submit' action alias. Since this is a redirect (a new request is issue from the client), the text entered will be lost.

<@s.url var="url" action="viewSource" namespace="/tags/non-ui/actionPrefix" /> The JSP code can be read <@s.a href="%{#url}">here. <@s.form action="submit" namespace="/tags/non-ui/actionPrefix" method="POST"> <@s.textfield label="Enter Some Text" name="text" /> <@s.submit action="actionPrefix" value="%{'action prefix'}" cssClass="btn" /> <@s.submit method="alternateMethod" value="%{'method prefix'}" cssClass="btn" /> <@s.submit value="Normal Submit" cssClass="btn" /> <@s.submit action="redirectActionPrefixAction" value="%{'redirectAction without prefix'}" cssClass="btn" />