webtier@glassfish.java.net

jsp:element and namespaces

From: Hilco Wijbenga <hilco.wijbenga_at_gmail.com>
Date: Sat, 17 Apr 2010 12:15:56 -0700

Hi all,

In a JSPX file you can use jsp:element to "create" new elements using
tags in the attribute values. E.g.

<jsp:element name="form">
  <jsp:attribute name="action"><c:url value="/bla/bla/bla" /></jsp:attribute>
</jsp:element>

This works fine but now I want to do the same with form:form (Spring
MVC's form tag). The jsp:element tag nicely generates the form:form
tag but it's not being processed.

A simpler example is with c:url:

<c:url value="/bla/bla/bla" />
<jsp:element name="c:url">
  <jsp:attribute name="value">/bla/bla/bla</jsp:attribute>
</jsp:element>

generates

/context/bla/bla/bla
<c:url value="/bla/bla/bla" />

So the jsp:element generated c:url is not processed.

I tried various different incantations with and without xmlns, xmlns:c
(<jsp:element xmlns="..." ...> or <jsp:element xmlns:c="..." ...>) but
nothing seems to work. Google didn't provide any answers and the
JavaServer Pages spec was no help either.

How can I use jsp:element to generate a tag in a namespace *and* have
it processed?

Cheers,
Hilco