Binary Lion Studios

I code for fun and for food.

Spring form taglib and portlet namespace

If you do something like this:

1
<form:input path="<portlet:namespace />firstName" />

it will render something like this:

1
<input type="text" name="<portlet:namespace />firstName" />

It does that because it doesn’t interpret the <portlet:namespace /> tag as a tag at all. It’s just a bunch of text as far as the <form:input> tag is concerned. You can get around it by doing something like this:

1
2
<c:set var="ns"><portlet:namespace /></c:set>
<form:input path="${ns}firstName" />

That should generate the form output with the namespace prepended, like you would expect.