Vincent
Vincent

Reputation: 257

jsp:param : name parameter can't accept dynamic data?

I'd like to set the "name" param to a jsp:param in a "dynamic-way", that is :

<jsp:param value="<%=paramValue%>" name="<%=pageURL%>"/>

instead of :

<jsp:param value="<%=paramValue%>" name="page"/>

Or a similar way to do it .. I just don't want to decide the url at runtime.

Is it possible ?

Thanks for the anwsers :)

Cheers

Upvotes: 1

Views: 3963

Answers (2)

leccionesonline
leccionesonline

Reputation: 608

you could use Expression Language too:

<jsp:param value="${paramValue}" name="page"/>
<jsp:param value="${pageURL}" name="url"/>

Upvotes: 0

BalusC
BalusC

Reputation: 1108567

That's disallowed as per the syntax reference.

Just add another param.

<jsp:param name="page" value="<%=paramValue%>" />
<jsp:param name="url" value="<%=pageURL%>" />

Unrelated to the problem, scriptlets are not the best practice. Consider learning EL, those ${} things, it's already over a decade the recommend way of accessing backend data in JSPs.

Upvotes: 4

Related Questions