⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 faq.fml

📁 分页标签
💻 FML
字号:
<?xml version="1.0" encoding="UTF-8"?><faqs title="Frequently Asked Questions">    <part id="general">        <title>General</title>        <faq id="samples">            <question>                When I was trying to copy and paste the samples from the website I would get compile time errors looking                for TestList, ReportList, etc. This would happen even if I included the display tag binary distribution                jar file.            </question>            <answer>                <p>                    Within the display tag binary distribution the "org.displaytag.sample" class files are not included.                    So if you are trying to use TestList, ReportList which are part of the org.displaytag.sample package                    you'll get a compile error telling you they can't find the classes. The solution I came up with was                    to download the source file distribution and copy the org.display.sample source files into your                    build. If you do this you probably need to copy over files from the                    <code>org.displaytag.decorator</code>                    and                    <code>org.displaytag.exception</code>                    packages since there are dependencies between them all.                </p>            </answer>        </faq>        <faq id="editable">            <question>                One thing that I really wanted to do was create tables that contained things other than text fields.                Drop Downs, CheckBoxes and Input Fields were stuff that I was looking for. On the examples page there                wasn't an example that showed how to do this.            </question>            <answer>                <p>                    There is a really good example of how to use displaytag to create an editable row of data located at                    <a href="http://demo.raibledesigns.com/appfuse/demos/users-edit.jsp">                        http://demo.raibledesigns.com/appfuse/demos/users-edit.jsp                    </a>                    . It contains the source code for how to do it.                </p>            </answer>        </faq>        <faq id="ctag">            <question>                What is the c tag library? In the examples there is a tag library called the c tag library which was                used in a lot of places (c:if, c:out, etc.).            </question>            <answer>                <p>                    The c tag library is actually the JavaServer Pages Standard Tag Library (JSTL). To import it you use                    the line                    <code>                        <![CDATA[<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>]]>                    </code>                    . You also have to download the library from sun and include the jstl.jar, standard.jar within your                    war, in the appropriate places.                </p>            </answer>        </faq>        <faq id="id">            <question>Can I use a java variable as the value of the id attribute?</question>            <answer>                <p>                    Yes, from version 1.0rc2 displaytag will allow you to use a java variable as the value of the id                    attribute. But you have to be aware that, while usually displaytag declares a variable named with                    the value of the id attribute, this is not possible when using a runtime expression. You can however                    fetch the value of the row object from the pagecontext, as showed in the following example.                </p>                <source>                    <![CDATA[<% String myId = "row"><display:table id="<%=myId%>" ...>  <display:column><%=row%></display:column> <-- will not work  <display:column><%pageContext.getAttribute("row")></display:column> <-- works ]]>                </source>                <p>In the EL version of the tag library you are also allowed to do:</p>                <source>                    <![CDATA[<c:set var="myId" value="row" /><display:table id="${myId}" ...>  <display:column><c:out value="${row}" /></display:column>]]>                </source>                <p>                    Note that                    <code>pageContext.getAttribute()</code>                    is the preferred way for accessing the object in the current row and the declared variable will                    probably be removed in future (it is already not used in the EL version of the tag library).                </p>                <p>                    Some containers don't allow the id attribute to be a runtime expression at all (this has been                    reported in earlier versions of Tomcat 5 and ATG Dynamo 5), so an attribute with the name                    <code>uid</code>                    has been added. Simply use                    <code>uid</code>                    instead of                    <code>uid</code>                    in the table tag.                </p>            </answer>        </faq>    </part>    <part id="struts">        <title>Displaytag and Struts</title>        <faq id="action">            <question>                How do I use this tag with Struts? The links that it creates for sorts and exports all point back to the                JSP page, not my Action!            </question>            <answer>                <p>                    Use the requestURI attribute of the column tag. When the requestURI attribute is present, links for                    sorting, exports, and paging are formed by adding any tag generated parameters to the value of                    requestURI attribute. So if your page is served under                    <code>/ManageLatin.do</code>                    , you should have                    <code>requestURI="/ManageLatin.do"</code>                    on your display:table.                </p>                <p>                    Using the requestURI attribute with an empty "" attribute is another strategy. Sometimes you don't                    know what the uri is because the table might be part of an included tile. The resulting URL will be                    a link that is based upon the original requestURI + the appended display tag parameters.                </p>            </answer>        </faq>    </part>    <part id="rendering">        <title>Rendering</title>        <faq id="headers">            <question>                How can I display static headers in a table, so that headers remain visible while user scrolls the table                body?            </question>            <answer>                <p>                    You can do that simply using css, adding an height and the                    <code>overflow: scroll</code>                    property to the                    <code>tbody</code>                    element. Unfortunately this will work perfectly in Netscape/Mozilla, but not in Internet Explorer.                </p>                <p>                    A table with a scrollable body can be made in Internet Explorer using javascript or a more complex                    css.                    <a href="http://www.imaputz.com/cssStuff/bigFourVersion.html" title="Pure CSS Scrollable Table">                        Here                    </a>                    you can find a good css example.                </p>            </answer>        </faq>    </part>    <part id="appservers">        <title>App Servers specific problems</title>        <faq id="jrunlog4j">            <question>                After deployed the displaytag war in JRun 4 I get a                <code>java.lang.NoClassDefFoundError: org/apache/log4j/Layout</code>            </question>            <answer>                <p>This is due to a known bug in JRun.</p>                <p>To make the sample webapp working you will need to:</p>                <ul>                    <li>                        remove                        <code>commons-logging-*.jar</code>                        from                        <code>displaytag.war/WEB-INF/lib</code>                    </li>                    <li>                        move                        <code>log4j-1.2.8</code>                        to                        <code>$JRUN/servers/lib/</code>                        (create this directory if it doesn't exist)                    </li>                </ul>                <p>                    You can find more info related to this jrun bug on google:                    <a href="http://www.google.it/search?q=jrun+%22org%2Fapache%2Flog4j%2FLayout%22">                        searching jrun "org/apache/log4j/Layout"                    </a>                </p>            </answer>        </faq>        <faq id="jruntld">            <question>                The &lt;example> elements in the                <code>displaytag-el.tld</code>                and                <code>displaytag-12.tld</code>                are invalid according to JRun4. When adding displaytag.jar to a JRun4 web application I get the                following stacktrace:                <code>                    jrun.jsp.compiler.JRunTagLibraryInfo$InvalidTLDElementException: The tag example on line 244 is not                    a valid TLD element at                    jrun.jsp.compiler.JRunTagLibraryInfo$TLDParser.startElement(JRunTagLibraryInfo.java:613)                </code>            </question>            <answer>                <p>Again, this appears to be a JRun fault.</p>                <p>                    The &lt;example> elements are absolutely valid according to the sun dtd                    <code>http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd</code>                    but JRun doesn't accept them. A bug report has already been submitted to Macromedia hoping they will                    fix this.                </p>                <p>In the meanwhile, you have two available solutions to make displaytag work pacefully with JRun:</p>                <ul>                    <li>                        If you don't need to use the EL version, simply delete the                        <code>displaytag-el.tld</code>                        and                        <code>displaytag-12.tld</code>                        files from displaytag.jar and use the 1.1 version. This one works without problems.                    </li>                    <li>                        If you need the EL version, extract                        <code>displaytag-el.tld</code>                        from the jar and remove all the &lt;example> tags. Replace the original tld in the jar with this                        modified one.                    </li>                </ul>                <p>                    We are sorry for this extra step needed with JRun, but at the moment we decided to not to remove the                    example tags in the main tld since they are needed for the generated documentation.                </p>            </answer>        </faq>    </part></faqs>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -