facebook

insert attibutes and definition not working

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #306433 Reply

    damien_avoce
    Member

    Hi everybody,
    I am using Myeclipse 8.0 on linux (all in one installed). I cannot make insert work for attributes and definitions. No error was shown on compilation. The jsp file “mainlayout” is not showing the header, footer and body. Am I missing something? Here are my files:
    Thanks

    web.xml
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE web-app PUBLIC
    “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”
    http://java.sun.com/dtd/web-app_2_3.dtd”&gt;
    <web-app>
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>chainConfig</param-name>
    <param-value>org/apache/struts/tiles/chain-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>3</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>3</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping> <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    </web-app>

    ============= ==========
    struts-config
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.3//EN”
    http://struts.apache.org/dtds/struts-config_1_3.dtd”&gt;

    <struts-config>
    <form-beans />
    <global-exceptions />
    <global-forwards />
    <action-mappings />
    <message-resources parameter=”com.fallergroup.struts.ApplicationResources” />

    <plug-in className=”org.apache.struts.tiles.TilesPlugin”>
    <set-property property=”definitions-config”
    value=”/WEB-INF/tiles-defs.xml”/>
    </plug-in>

    </struts-config>

    =============

    mainlayout.jsp
    <%@ taglib uri=”http://struts.apache.org/tags-tiles&#8221; prefix=”tiles” %>
    <h1>I am the main layout</h1>
    <table border=”1″ width=”100%” cellspacing=”5″>
    <tr><td colspan=”2″>A<tiles:insert attribute=”header” flush=”true”/></td></tr>
    <tr>
    <td width=”20%”>a<tiles:insert attribute=”header” flush=”true”/></td>
    <td
    width=”80%”>b<tiles:insert attribute=”header” flush=”true”/></td>
    </tr>
    <tr><td colspan=”2″>B<tiles:insert attribute=”footer” flush=”true”/></td></tr>
    </table>
    ===============

    tiles-defs.xml
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE tiles-definitions PUBLIC
    “-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN”
    http://struts.apache.org/dtds/tiles-config_1_3.dtd”&gt;
    <tiles-definitions>

    <definition name=”main.layout” path=”/jsp/mainLayout.jsp”>
    <put name=”title” value=””/>
    <put name=”header” value=”/jsp/header.jsp” />
    <put name=”menu” value=”/menu/menu.jsp”/><!–navigation.do” />–>
    <!– <put name=”menu” value=”/menu/menu.layout” />–>
    <put name=”body” value=”/welcome.jsp” />
    <put name=”footer” value=”/jsp/footer.jsp” />
    </definition>

    <!– Tiles Definition of welcome page –>
    <!– <definition name=”menu.index” path=”/menu/menu.jsp”>
    <put name=”title” value=”Welcome page” />
    <put name=”body” value=”/index.jsp” />
    </definition>–>
    <definition name=”index” extends=”main.layout”>
    <put name=”title” value=”Index Page” />
    <!– <put name=”managerLogin” value=”/login/managerLogin.jsp” />–>
    <put name=”body” value=”/welcome.jsp” />
    </definition>
    </tiles-definitions>
    ==========================
    header.jsp
    <%@ page language=”java” import=”java.util.*” pageEncoding=”UTF-8″%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”;
    %>

    <%@ taglib uri=”http://struts.apache.org/tags-bean&#8221; prefix=”bean” %>
    <%@ taglib uri=”http://struts.apache.org/tags-html&#8221; prefix=”html” %>
    <%@ taglib uri=”http://struts.apache.org/tags-logic&#8221; prefix=”logic” %>
    <html> <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
    <title>CDI Project</title>
    </head>
    <body>
    <h1>This the header</h1>
    </body>
    </html>

Viewing 1 post (of 1 total)
Reply To: insert attibutes and definition not working

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