Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf <;jsp属性组>;不使用<;taglib>;标签_Jsf_Weblogic12c - Fatal编程技术网

Jsf <;jsp属性组>;不使用<;taglib>;标签

Jsf <;jsp属性组>;不使用<;taglib>;标签,jsf,weblogic12c,Jsf,Weblogic12c,我正在开发一个JSF应用程序,我需要创建一个自定义标记库。 我需要创建一些函数,这些函数将在jsf页面的el表达式标记中使用 请在下面找到我的taglib文件: <?xml version = "1.0"?> <!DOCTYPE facelet-taglib PUBLIC"-//Sun Microsystems, Inc.//DTD FaceletTaglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_

我正在开发一个JSF应用程序,我需要创建一个自定义标记库。 我需要创建一些函数,这些函数将在jsf页面的el表达式标记中使用

请在下面找到我的taglib文件:

<?xml version = "1.0"?>
    <!DOCTYPE facelet-taglib PUBLIC"-//Sun Microsystems, Inc.//DTD FaceletTaglib 1.0//EN"
    "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
  <facelet-taglib >
   <namespace>http://com.xyz/functions</namespace>

   <function>
      <function-name>customMethodName</function-name>
      <function-class>Custom JavaClass</function-class>
       <function-signature>String customMethodName(java.lang.String) 
      </function-signature>
   </function>
 </facelet-taglib>

http://com.xyz/functions
customMethodName
自定义JavaClass
字符串customMethodName(java.lang.String)
首先,在web.xml中,我用以下方式定义了它:

  <context-param>
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/taglib/mytaglib.taglib.xml</param-value>
 </context-param>

javax.faces.FACELETS\u库
/WEB-INF/taglib/mytaglib.taglib.xml
但是,在编译期间,这是不够的,因为它无法识别URI

在jsf页面中,它包括为:

xmlns:csfn="http://com.xyz/functions"
<h:outputText value="#{csfn:customMethodName(data)}">
xmlns:csfn=”http://com.xyz/functions"
我做了如下修改后:

   <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
     version="3.0">

<jsp-config>
   <jsp-property-group>
      <url-pattern>*.jsf</url-pattern>
      <is-xml>true</is-xml>
  </jsp-property-group>
  <taglib>
    <taglib-uri>http://com.xyz/functions</taglib-uri>
    <taglib-location>/WEB-INF/taglib/mytaglib.taglib.xml</taglib-location>
  </taglib>
 </jsp-config>
 </web-app>

*.jsf
真的
http://com.xyz/functions
/WEB-INF/taglib/mytaglib.taglib.xml
这次应用程序已成功编译,但在weblogic 12.2.1中部署时出错

    Unable to access the selected application.
    Message icon - Error VALIDATION PROBLEMS WERE FOUND <372:7> problem: 
    cvc-complex-type.2.4a: Expected element 'jsp-property-group@http://xmlns.jcp.org/xml/ns/javaee' instead of 
   'taglib@http://xmlns.jcp.org/xml/ns/javaee' here in element jsp- config@http://xmlns.jcp.org/xml/ns/javaee
    Message icon - Error VALIDATION PROBLEMS WERE FOUND <372:7> problem: 
    cvc-complex-type.2.4a: Expected element 'jsp-property-group@http://xmlns.jcp.org/xml/ns/javaee' instead of 
  'taglib@http://xmlns.jcp.org/xml/ns/javaee' here in element jsp- config@http://xmlns.jcp.org/xml/ns/javaee
无法访问所选应用程序。
消息图标-发现错误验证问题问题:
cvc-complex-type.2.4a:预期元素的jsp属性-group@http://xmlns.jcp.org/xml/ns/javaee'而不是
'taglib@http://xmlns.jcp.org/xml/ns/javaee'在元素jsp中-config@http://xmlns.jcp.org/xml/ns/javaee
消息图标-发现错误验证问题问题:
cvc-complex-type.2.4a:预期元素的jsp属性-group@http://xmlns.jcp.org/xml/ns/javaee'而不是
'taglib@http://xmlns.jcp.org/xml/ns/javaee'在元素jsp中-config@http://xmlns.jcp.org/xml/ns/javaee

有人能解决这个问题吗?

嗯,我没有测试任何东西,但错误是
不应该是
的一部分。使用
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
我已经尝试过使用它,但它仍然给出了错误。@Nicholas。