File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 56192
    
  13

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
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
    
  13

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: 56192
    
  13

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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: reset param values in c:url tag
 
Similar Threads
EL works in attr value to html, but not in custom tag attr value
c:url
c:url parsing problems
How to open report builder form(oracle) while clicking the jsp page(Online) link
strange JSTL problem