Using named anchors with url encoding

I am using url encoding in my jsps and in some of my links I link to a named anchor on a different page. I am having trouble doing this because the only way I can see how to get the anchors to work is to put the named anchor text at the end of the url. When I use

<c:url value="somepage.jsp#anchorname"><c:param name="param1" value="value1"/></c:url>

I get

somepage.jsp#anchorname?param1=value1

and I am unable to read the parameters.

How can I get the anchorname to show up after the parameter values and use <c:url>.

[656 byte] By [tbpckisaa] at [2007-11-26 14:55:04]
# 1

One solution is to create your URL without the named anchor, and then subsequently concat the named anchor to the URL you created previously.

<c:url value="somepage.jsp" var="someURL"><c:param name="param1" value="value1"/></c:url>

<a href="${someURL}#anchorname">Anchor Text</a>

I couldn't find a way to do this with c:url , after refering to the JSTL1.1 spec.

appy77a at 2007-7-8 8:43:33 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...