0

Possible Duplicate:
How to URL-encode a String with JSTL?

I am trying to url encode the string..

<c:out value="${filter.value.display}"/>

I tried this way

<%@ taglib prefix="encodeft" uri="http://java.net" %>

<c:out value="${encodeft:URLEncoder.urlEncode(filter.value).display}"/> And now I got this error as

The absolute uri: http://java.net cannot be resolved in either web.xml or the jar files deployed with this application

Any suggestions??

Community
  • 1
  • 1
arsenal
  • 23,366
  • 85
  • 225
  • 331

1 Answers1

0

Maybe

<c:out value="${filter.urlEncode(filter.value).display}"/>?

but I am assuming both that value is a property of filter and that urlEncode(String) is a method of filter, as suggested by your code.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • I tried doing this way:- <%@ taglib prefix="encodeft" uri="http://java.net" %> `` And now I got this error as `The absolute uri: http://java.net cannot be resolved in either web.xml or the jar files deployed with this application`. Also I have updated the question... – arsenal Aug 03 '11 at 02:08
  • So you are telling JSTL that there is a function called `encodeft:URLEncoder.urlEncode()` which you have defined in the namespace `http://java.net`. How have you done that? – user207421 Aug 03 '11 at 07:20
  • I am not sure about that... How can i define function in that.. I thought java.net has some method `URLEncoder.urlEncode` and I just made prefix of that java.net and I am using it... May be I have to define this function somewhere?? – arsenal Aug 03 '11 at 16:28
  • @Raihan Jamal You certainly do. You can't just call arbitrary methods in EL, only the methods that EL knows about. – user207421 Aug 04 '11 at 09:20