• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reset param values in c:url tag

 
Kaylee Sebi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to remove a parameter already on a URL using <c:url>.
 
Kaylee Sebi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replacement implies removal. Can you not make the decision which value to use before setting the parameter in the first place?
 
Kaylee Sebi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic