Wednesday, 28 August 2013

Struts make a link with wildcard parameter

Struts make a link with wildcard parameter

So say I have the following action mapping:
<action path="/admin/nst-*/manage/"
type="com.company.backend.actions.admin.nstManageAction"
name="nstMgmtForm" attribute="form"
validate="false" scope="request"
parameter="{1}"
input="/WEB-INF/company/pages/nstMgmt.jsp">
<forward name="view" path="/WEB-INF/company/pages/nstMgmt.jsp"/>
</action>
As you can see, it has a wildcard for institution which is passed in with
the parameter attribute.
Say on another JSP page I wanted to link to this action with a struts html
tag. How would I automagically insert the institution id into the the link
with the struts link tag? For instance /admin/nst-22/manage/ or
/admin/nst-99/manage. Is it possible to do this with the the link tag?

No comments:

Post a Comment