添加自己的taglib后,在视图

时间:2015-06-06 13:50:41

标签: liferay liferay-6 taglib

我尝试创建自己的taglib,它扩展了现有的一个:来自liferay-ui的input-asset-links。所以我在my-ext-web中的WEB-INF / tld中创建了文件liferay-ui-ext.tld,这个xml:

<taglib
    version="2.1"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    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-jsptaglibrary_2_1.xsd"
    >
<description>Provides the Liferay UI component tags, prefixed with <![CDATA[<code>liferay-ui:</code>]]>.
</description>
<tlib-version>1.0</tlib-version>
<short-name>liferay-ui-ext</short-name>
<uri>http://liferay.com/tld/ui-ext</uri>
<tag>
    <name>input-asset-links-with-order</name>
    <tag-class>com.liferay.taglib.ui.InputAssetLinksTagWithOrder</tag-class>
    <body-content>JSP</body-content>
    <attribute>
        <name>assetEntryId</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <name>className</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <name>classPK</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
        <name>orderable</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
    </attribute>
</tag>

我在web.xml中也添加了这段代码:

  <jsp-config>
    <taglib>
        <taglib-uri>http://liferay.com/tld/ui-ext</taglib-uri>
        <taglib-location>path-to-file-with-tld/taglib-location>
    </taglib>
</jsp-config>

最后我编写了自己的类InputAssetLinksTagExt,它在my-ext-impl中扩展了InputAssetLinksTag。

之后我部署了一个ext-plugin。我在浏览器控制面板中打开,我想添加新文章(JournalArticle)。而且我得到了这个错误:

  

13:32:41,978 ERROR [http-bio-8080-exec-14] [IncludeTag:129]当前URL / group / control_panel / manage?p_p_auth = LfoI5AiI&amp; p_p_id = 15&amp; p_p_lifecycle = 0&amp; p_p_state = maximized&amp; p_p_mode =视图&安培; doAsGroupId = 10182&安培; refererPlid = 10648&安培; controlPanelCategory = current_site.content&安培; _15_struts_action =%2Fjournal%2Fedit_article&安培; _15_redirect = HTTP%3A%2F%2Flocalhost%3A8080%2Fgroup%2Fcontrol_panel%2Fmanage%3Fp_p_auth%3DLfoI5AiI%26p_p_id%3D15 %26p_p_lifecycle%3D0%26p_p_state%3Dmaximized%26p_p_mode%3Dview%26doAsGroupId%3D10182%26refererPlid%3D10648%26controlPanelCategory%3Dcurrent_site.content&amp; _15_groupId = 10182&amp; _15_folderId = 0&amp; _15_articleId = 10659&amp; _15_status = -1生成异常:/ html / portlet /journal/article/content.jsp(第474行,第5列)无法找到属性的setter方法:checkRequired   org.apache.jasper.JasperException:/html/portlet/journal/article/content.jsp(line:474,column:5)无法找到属性的setter方法:checkRequired       在org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)       在org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)       在org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)       at org.apache.jasper.compiler.Generator $ GenerateVisitor.evaluateAttribute(Generator.java:2868)       at org.apache.jasper.compiler.Generator $ GenerateVisitor.generateSetters(Generator.java:3092)       at org.apache.jasper.compiler.Generator $ GenerateVisitor.generateCustomStart(Generator.java:2262)       在org.apache.jasper.compiler.Generator $ GenerateVisitor.visit(Generator.java:1757)       在org.apache.jasper.compiler.Node $ CustomTag.accept(Node.java:1539)       在org.apache.jasper.compiler.Node $ Nodes.visit(Node.java:2376)       在org.apache.jasper.compiler.Node $ Visitor.visitBody(Node.java:2428)       在org.apache.jasper.compiler.Generator $ GenerateVisitor.visit(Generator.java:1773)       在org.apache.jasper.compiler.Node $ CustomTag.accept(Node.java:1539)       在org.apache.jasper.compiler.Node $ Nodes.visit(Node.java:2376)       在org.apache.jasper.compiler.Node $ Visitor.visitBody(Node.java:2428)       在org.apache.jasper.compiler.Generator $ GenerateVisitor.visit(Generator.java:1773)       在org.apache.jasper.compiler.Node $ CustomTag.accept(Node.java:1539)       在org.apache.jasper.compiler.Node $ Nodes.visit(Node.java:2376)       在org.apache.jasper.compiler.Node $ Visitor.visitBody(Node.java:2428)       在org.apache.jasper.compiler.Node $ Visitor.visit(Node.java:2434)       在org.apache.jasper.compiler.Node $ Root.accept(Node.java:475)

我没有改变任何其他事情。当我尝试访问控制面板中的网站页面时,会出现相同的情况。我有这个错误:

  

13:48:19,661 ERROR [http-bio-8080-exec-22] [IncludeTag:129]当前URL /group/control_panel?refererPlid=10648&doAsGroupId=10182&controlPanelCategory=current_site.pages&p_p_id=156生成exception:/html/portlet/layouts_admin/view.jsp(line:98,column:2)无法找到属性的setter方法:displayStyle   org.apache.jasper.JasperException:/html/portlet/layouts_admin/view.jsp(line:98,column:2)无法找到属性的setter方法:displayStyle       在org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)       在org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)

我使用liferay 6.2 GA3 CE和JDK 1.7。

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我是如此愚蠢......我没有注意到在pom.xml中的ext-plugin中我有错误的taglib版本。上帝会审判我......