facebook

Adding Plugins [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #214640 Reply

    alashoofi
    Member

    Here is my problem:
    When I add this piece into struts-config.xml, I get errors;

    ********
    <plug-in className=”org.apache.struts.tiles.TilesPlugin”>
    <set-property property=”definitions-config” value=”/WEBINF/tiles-defs.xml” />
    <set-property property=”moduleAware” value=”true” />
    <set-property property=”definitions-parser-validate” value=”true” />
    </plug-in>
    *********

    The error is:
    The content of element type, strus-config, must match.

    Is there another way of adding the TilesPlugin without generating an error. I add the TilesPlugin so I can use Tiles in my web app.

    Thanks
    [/b]- System Setup ——————————-
    Operating System and version: XP Pro
    Eclipse version: 3.0
    Eclipse build id:
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins: myeclipse
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
    MyEclipse version: 3.8 beta 2
    Eclipse JDK version:
    Application Server JDK version: Tomcat 4.1
    Are there any exceptions in the Eclipse log file?

    – Message Body ——————————-

    #214649 Reply

    Riyad Kalla
    Member

    It all depends on where in the file you are adding it, order in the struts-config file matters. If you look at the rest of that error: “must match…” it will show you the order of the elements. <plug-in> elements needs to come at the bottom of the struts-config file generally.

    #214652 Reply

    alashoofi
    Member

    Thanks Riyad, I stumbled on that info the hard way a few minutes ago. I am very new to Tiles, so bear with me!
    Now I don’t get that error anymore but I get another runtime error:

    org.apache.jasper.JasperException: Can’t get definitions factory from context.

    My /jsp/siteLayout.jsp looks like so:

    ************************************

    <%@ page language=”java”%>

    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean&#8221; prefix=”bean” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-html&#8221; prefix=”html” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-logic&#8221; prefix=”logic” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-tiles&#8221; prefix=”tiles” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-template&#8221; prefix=”template” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-nested&#8221; prefix=”nested” %>

    <HTML>
    <HEAD>
    <title><tiles:getAsString name=”title” ignore=”true”/></title>
    <html:base/>
    </HEAD>
    <body>
    <table width=”500″ border=”0″ cellspacing=”0″ cellpadding=”0″>

    <tr bgcolor=”#36566E”>
    <td height=”68″ width=”48%”>
    <div align=”left”>
    <img src=”images/struts-power.gif”
    width=”220″ height=”74″>
    </div>
    </td>
    </tr>

    <tr>
    <td height=”68″ width=”2000″>
    <tiles:insert attribute=”header” ignore=”true”>
    <tiles:put name=”title”
    beanName=”title” beanScope=”tile”/>
    </tiles:insert>
    </td>
    </tr>
    <tr>
    <td>
    <div align=”center”>
    <tiles:insert attribute=”content”/>
    </div>
    </td>
    </tr>
    <tr>
    <td>
    <tiles:insert attribute=”footer” ignore=”true”/>
    </td>
    </tr>

    </table>

    <font color=”#FF0000″ >
    <!– DebugUtil.debug(pageContext); –>
    </font>
    </body>
    </HTML>
    *************************************

    The WEB-INF/tiles-def.xml looks like so:

    ***************************
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <tiles-definitions>

    <definition name=”siteLayoutDef” path=”/jsp/siteLayout.jsp”>
    <put name=”title” value=”Alashoofi Choices System” />
    <put name=”header” value=”jsp/header.jsp” />
    <put name=”footer” value=”jsp/footer.jsp” />
    <put name=”content” type=”string”>
    Content goes here
    </put>
    </definition>

    </tiles-definitions>
    *****************************

    The /jsp/footer.jsp like so:

    **************************
    br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />

    <center>
    <table>
    <tr>
    <td width=”100%” bgcolor=”#36566E”>
    Copyright Wrox Corp 2003
    </td>
    </tr>
    </table>
    </center>
    **************************

    And the /jsp/header.jsp like:
    *******

    <%@ page language=”java”%>

    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean&#8221; prefix=”bean” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-html&#8221; prefix=”html” %>
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-logic&#8221; prefix=”logic” %>
    <%@ taglib uri=”/WEB-INF/struts-tiles.tld” prefix=”tiles” %>

    <center>
    <table>
    <tr>

    <td width=”33%”>
    <font color=”#36566E”>
    <tiles:getAsString name=”title” ignore=”true”/>
    </font>
    </td>

    </tr>
    </table>
    </center>

    ******************

    What am I doing wrong?

    Thanks a bunch!!!

    #214660 Reply

    alashoofi
    Member

    I was able to figure it out. My definition was not in sync.
    Thanks for being there everybody, I’m sure I will be needing more help.

    #214675 Reply

    Riyad Kalla
    Member

    Glad you got it, thanks for following up with us.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Adding Plugins [Closed]

You must be logged in to post in the forum log in