Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hans-Georg Menz
Function definition in facelet-taglib.
July 26, 2008 12:35 AM
Answer

Hans-Georg Menz

Rank: Junior Member

Posts: 37

Join Date: June 30, 2007

Recent Posts

I am trying to match a function with the help of faces-taglib. Therefor I created the file /WEB-INF/tld/faces-taglib.xml and added the following

 1<?xml version="1.0"?>
 2<facelet-taglib xmlns="http://java.sun.com/JSF/Facelet">
 3    <namespace>http://www.xampire.de/ms</namespace>
 4    <function>
 5        <function-name>testen</function-name>
 6        <function-class>de.xampire.TestClass</function-class>
 7        <function-signature>boolean testen(java.lang.String)</function-signature>
 8    </function>
 9</facelet-taglib>


The de.xampire.TestClass class contains a static method boolean testen(String s). Further I added

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE web-app PUBLIC
 3    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 4    "http://java.sun.com/dtd/web-app_2_3.dtd">
 5<web-app> &gt;
 6
 7    [...]
 8   
 9    <context-param>
10        <param-name>facelets.LIBRARIES</param-name>
11        <param-value>/WEB-INF/tld/faces-taglib.xml</param-value>
12    </context-param>
13
14    [...]
15
16    <taglib>
17        <taglib-uri>http://www.xampire.de/ms</taglib-uri>
18        <taglib-location>/WEB-INF/tld/faces-taglib.xml</taglib-location>
19    </taglib>   
20   
21</web-app>


to /WEB-INF/web.xml. (See these sites for more information (1) and (2).)

The goal is to use the function in a /index.jspx file like
 1<f:view xmlns:h="http://java.sun.com/jsf/html"
 2    xmlns:f="http://java.sun.com/jsf/core"
 3    xmlns:jsp="http://java.sun.com/JSP/Page"
 4    xmlns:ice="http://www.icesoft.com/icefaces/component"
 5    xmlns:ms="http://www.xampire.de/ms"
 6    xmlns:liferay-security="http://liferay.com/tld/security"
 7    xmlns:liferay-ui="http://liferay.com/tld/ui">
 8
 9    <ice:outputDeclaration doctypeRoot="HTML"
10        doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
11        doctypeSystem="http://www.w3.org/TR/html4/transitional.dtd" />
12
13    <ice:portlet>
14        <ice:panelGroup visible="#{ms:testen('test')}">
15        </ice:panelGroup>
16    </ice:portlet>
17</f:view>

See the line with #{ms:testen('test')}".

I always get the following error:
 125.07.2008 20:34:12 com.sun.faces.el.impl.FunctionInvocation evaluate
 2SCHWERWIEGEND: Dem Namen "ms:testen" ist keine Funktion zugeordnet
 325.07.2008 20:34:12 com.icesoft.faces.webapp.parser.Parser parse
 4SCHWERWIEGEND: Failed to execute JSP lifecycle.
 5javax.servlet.jsp.JspException: javax.faces.el.EvaluationException:
 6            com.sun.faces.el.impl.ElException:
 7            Dem Namen "ms:testen" ist keine Funktion zugeordnet
 8        at com.icesoft.faces.component.PanelGroupTag.doEndTag(PanelGroupTag.java:533)
 9        at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:239)
10        at com.icesoft.faces.webapp.parser.Parser.executeJspLifecycle(Parser.java:222)
11    [...]

The error message is German and says something like There is no function linked to the name "ms:testen". Can someone please help me to debug this problem or even tell me what I am doing wrong.

Greetings,
Hans-Georg
Jan Phillip Höft
RE: Function definition in facelet-taglib.
August 7, 2008 6:30 AM
Answer

Jan Phillip Höft

Rank: New Member

Posts: 4

Join Date: July 30, 2008

Recent Posts

Hi,
are there any updates to this post? I faced the same error msg. Did you manage to implement an EL function ?
Hans-Georg Menz
RE: Function definition in facelet-taglib.
August 19, 2008 5:18 AM
Answer

Hans-Georg Menz

Rank: Junior Member

Posts: 37

Join Date: June 30, 2007

Recent Posts

I am still looking for a solution to this problem. BTW I also asked the same question in the ICEfaces forum, but have not received any answer there either.

Greetings,
Hans-Georg