Author
reset param values in c:url tag
Kaylee Sebi
Greenhorn
Joined: Jun 29, 2007
Posts: 10
posted Jul 31, 2007 16:07:00
0
Hi I am new to jsp. I have a url variable: <c:url var="listingBaseUrl" value="${baseUrl}/> in ${listingBaseUrl} there is a param called "begin" and I would like to reset the value of begin in url. So I try to do : <c:url var="listingBaseUrl"> <c:param name="begin" value="100"/> </c:url> This only added another param begin in the url and listingBaseUrl ended up having duplicate param begin. I tried to do: <c:url var="listingBaseUrl"> <c:set var="begin" value="100"/> </c:url> but it didn't work. Any suggestions?
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
There is no way to remove a parameter already on a URL using <c:url>.
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
Kaylee Sebi
Greenhorn
Joined: Jun 29, 2007
Posts: 10
posted Jul 31, 2007 19:01:00
0
Hi I don't want to remove the parameter I just want to reset the value of the parameter. How do I do that?
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
Replacement implies removal. Can you not make the decision which value to use before setting the parameter in the first place?
Kaylee Sebi
Greenhorn
Joined: Jun 29, 2007
Posts: 10
posted Jul 31, 2007 19:59:00
0
url is the request url so that is what I have to work with. Maybe I can try string replacement? like fn:replace tag?
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
You should be able to reconstruct the base URL without the parameters from the information on the request. [ July 31, 2007: Message edited by: Bear Bibeault ]
subject: reset param values in c:url tag