aspose file tools*
The moose likes JSP and the fly likes reset param values in c:url tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "reset param values in c:url tag" Watch "reset param values in c:url tag" New topic
Author

reset param values in c:url tag

Kaylee Sebi
Greenhorn

Joined: Jun 29, 2007
Posts: 10
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: 61001
    
  65

There is no way to remove a parameter already on a URL using <c:url>.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kaylee Sebi
Greenhorn

Joined: Jun 29, 2007
Posts: 10
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: 61001
    
  65

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
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: 61001
    
  65

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reset param values in c:url tag