You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stefano Tranquillini <st...@gmail.com> on 2009/04/10 13:06:45 UTC

JBoss struts2 tiles2

Hi,

i'm trying to build a project using ejb struts2 and tiles2.

only sturts2 without tiles2 works fine! but with tiles it's not works

i try only to build a simply application using struts and tiles2,
forgotten about ejb.

i've put these libraries inside jboss (/server/all/lib):

commons-beanutils-1.7.0.jar
commons-chain-1.2.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
commons-lang-2.3.jar
commons-logging-1.0.4.jar
commons-logging-api-1.1.jar
commons-validator-1.3.1.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar
struts2-tiles-plugin-2.1.6.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar
xwork-2.1.2.jar

the web.xml has added this part:

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
        <context-param>
        <param-name>tilesDefinitions</param-name>
        <param-value>/WEB-INF/tiles.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
    </listener>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


struts.xml contains

<struts>
    <package name="struts2" extends="struts-default" namespace="/">

        <result-types>
            <result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult"/>
        </result-types>
        <action name="home">
            <result type="tiles">tiles.home</result>
        </action>
    </package>
</struts>


tiles.xml

<tiles-definitions>
    <definition name="tiles.layout" template="Layout.jsp">
        <put-attribute name="title"       value="Tiles Demo" type="string" />
        <put-attribute name="menu"       value="menuuuu" type="string" />
        <put-attribute name="copy"       value="copy" type="string" />
    </definition>
    <definition name="tiles.home" extends="tiles.layout">
        <put-attribute name="body"        value="/jsp/home.jsp"/>
    </definition>


</tiles-definitions>

the index.jsp is done in this way:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
  <head><title>Tiles Demo</title></head>
  <body>
    <a href="<s:url action="home" namespace="/"/>">start tiles</a>
  </body>
</html>


when i call the index.jsp the server rise an error:

org.apache.jasper.JasperException: File "/struts-tags" not found
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
	org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160)
	org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
	org.apache.jasper.compiler.Parser.parseDirective(Parser.java:491)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1441)
	org.apache.jasper.compiler.Parser.parse(Parser.java:137)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:238)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:171)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

it seems to not load the tld file.


--
Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org