• Post Reply Bookmark Topic Watch Topic
  • New Topic

length of string - JSTL

 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys

I am using JSTL 1.2 in my application and i am making use of "fn" tags like this

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

..other tags
...
<c:if test="${fn:length(confirmation.ccTypeDisplay) > 12 }">
I am HERE
</c:if>

i have scenarios where "confirmation.ccTypeDisplay" is greater than 12, but "I am HERE" is not getting displayed. I am assuming 'fn' tags is not working properly and i am getting this error.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/WEB-INF/c.tld : <p>File [/includes/forms/shopping/_orderConfm.jsp] Line [37] Column [3] tag = 'if' / attribute = 'test': An error occurred while parsing custom action attribute "test" with value "${fn:length("confirmation.ccTypeDisplay") > 12}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported.</p>]: com.ibm.ws.jsp.translator.JspTranslationException: JSPG0048E: Page failed to validate using taglib validator for /WEB-INF/c.tld : <p>File [/includes/forms/shopping/_orderConfirmation.jsp] Line [37] Column [3] tag = 'if' / attribute = 'test': An error occurred while parsing custom action attribute "test" with value "${fn:length("confirmation.ccTypeDisplay") > 12}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported.</p>
at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.validateTagLib(ValidateVisitor.java:956)
at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.visitJspRootStart(ValidateVisitor.java:453)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I have jstl.jar in my web-inf/lib directory.

do i need to make any other settings.

Any help greatly appreciated

thanks
J
[ March 28, 2007: Message edited by: jay roy ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't seem like anything Struts-specific to me. Moved to the JSP forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things first:

/WEB-INF/c.tld


What is c.tld doing in your WEB-INF folder? You didn't extract it out of the jar file, did you?

I have jstl.jar in my web-inf/lib directory.


What about standard.jar?

Have you read the JSTL setup instructions in the JSP FAQ?
[ March 28, 2007: Message edited by: Bear Bibeault ]
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>>>What is c.tld doing in your WEB-INF folder? You didn't extract it out of the jar file, did you?

No i dint extract it. Do i have to extract it from a jar file?

I have jstl.jar and standard.jar in my web-inf\lib

all the <c: >tags works great , but the only problem is with the <fn: > tags . The fn: tags dont seem to work.

thanks,
J
[ March 28, 2007: Message edited by: jay roy ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jay roy:

No i dint extract it. Do i have to extract it from a jar file?


NO! This is a mistake a lot of people make.

Have you made sure that everythinf else is set up appropriately according to the JSP FAQ? If your web.xml declared to be 2.4?
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp">
<display-name>Store</display-name>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>com.store.resources.ApplicationResources</param-value>
</context-param>
<filter>
<filter-name>AuthenticationFilter</filter-name>
<display-name>AuthenticationFilter</display-name>
<filter-class>com.store.servlets.AuthenticationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>action</servlet-name>
....and so on

Is the above web.xml ok?

but when the server starts it shows me that the servlet version is 2.4 at the console but in the above web.xml it says "Web Application 2.3....".
so i am not sure if its problem with version

thanks
J
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jay roy:
Is the above web.xml ok?


No. For the 3rd time, see the JSP FAQ.
[ March 28, 2007: Message edited by: Bear Bibeault ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
 
jay roy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks very much
 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai joy,

is it working now?. what is the final code snippet?
 
KasiMurugan Ramasamy
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai joy,

is it working now?. what is the final code snippet?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!