tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pistis Valentino <vale.pis...@gmail.com>
Subject (Struts1 + Struts2.2.3) + Tiles2.0.6
Date Wed, 27 Jul 2011 14:47:39 GMT
Hi all,

I'm newbbie in Struts frameworks.
I integrate Struts1 with Struts2, at the moment only 1 page uses
Struts2 and the rest of the web app still using Struts2.
At this points it's ok...
but...
now I want to use tiles2 for the unique page that uses struts2, so I
read this tutorial:
http://www.vaannila.com/struts-2/struts-2-example/struts-2-tiles-example-1.html
and many others, but I have persistently this error:

======================================
Struts Problem Report

Struts has detected an unhandled exception:

Messages:
javax.servlet.jsp.JspException: Error executing tag: Attribute
'header' not found.
File: org/apache/jasper/servlet/JspServletWrapper.java
Line number: 460
________________________________

Stacktraces

org.apache.jasper.JasperException: javax.servlet.jsp.JspException:
Error executing tag: Attribute 'header' not found.

    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:321)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:659)
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457)
    org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)
    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)
    org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:157)
    org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
    com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
    com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:270)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
    org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    java.lang.Thread.run(Unknown Source)

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

I read so many posts, emails, tutorials, etc... but nothing resolve my
problem....
Where I'm wrong??

This are my files...

tiles.xml:

========================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
	<definition name="aboutPage2" template="/pages/struts2/aboutPage2.jsp">
		<put-attribute name="title" value="Template" />
		<put-attribute name="header" value="/pages/struts2/header.jsp" />
		<put-attribute name="body" value="/pages/struts2/body.jsp" />
		<put-attribute name="footer" value="/pages/struts2/footer.jsp" />
	</definition>
<!-- 	<definition name="welcome" extends="baseLayout"> -->
<!-- 		<put-attribute name="title" value="Welcome" /> -->
<!-- 		<put-attribute name="body" value="/pages/welcome.jsp" /> -->
<!-- 	</definition> -->
<!-- 	<definition name="friends" extends="baseLayout"> -->
<!-- 		<put-attribute name="title" value="Friends" /> -->
<!-- 		<put-attribute name="body" value="/pages/friends.jsp" /> -->
<!-- 	</definition> -->
<!-- 	<definition name="office" extends="baseLayout"> -->
<!-- 		<put-attribute name="title" value="Office" /> -->
<!-- 		<put-attribute name="body" value="/pages/office.jsp" /> -->
<!-- 	</definition> -->
</tiles-definitions>
==========================================

part of web.xml, the rest is for struts1:

=========================================
<!-- Struts2 -->

	<context-param>
		<param-name>
			org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
	<!-- org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
deprecata! -->
		<param-value>/pages/struts2/tiles.xml</param-value>
	</context-param>
	<!-- <listener> -->
	<!-- <listener-class>org.apache.struts2.tiles.StrutsTilesListener
</listener-class> -->
	<!-- </listener> -->

	<listener>
		<listener-class>
			org.apache.tiles.web.startup.TilesListener
		</listener-class>
	</listener>


	<filter>
		<filter-name>struts2</filter-name>
		<filter-class>
			<!-- org.apache.struts2.dispatcher.FilterDispatcher -->
			org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
		</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>*.action</url-pattern>
	</filter-mapping>
	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/struts/*</url-pattern>
	</filter-mapping>
===========================================

struts.xml:

===========================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
	"http://struts.apache.org/dtds/struts-2.1.7.dtd">


<struts>

	
	<constant name="struts.enable.DynamicMethodInvocation" value="false" />
	<constant name="struts.devMode" value="true" />
	<constant name="struts.i18n.reload" value="true"></constant>
	<constant name="struts.devMode" value="true"></constant>
	<constant name="struts.configuration.xml.reload" value="true"></constant>
	<constant name="struts.url.http.port" value="8080"></constant>
	<constant name="struts.serve.static" value="true"></constant>
	<constant name="struts.serve.static.browserCache" value="false"></constant>
	<!-- __________________________________________________________________________________________
-->
	<include file="struts-default.xml"></include>

	
	<constant name="struts.enable.DynamicMethodInvocation" value="false" />
	<!-- <constant name="struts.devMode" value="false" /> -->
	<constant name="struts.convention.result.path" value="/pages" />
	<constant name="struts.convention.action.packages"
value="it.dom.app.struts2" />
	<!-- <constant name="struts.custom.i18n.resources" value="messages" /> -->
	<constant name="struts.convention.classes.reload" value="true" />
	<constant name="struts.convention.action.disableJarScanning"
		value="true"></constant>
	<!-- <constant name="struts.convention.package.locators.basePackage"
value="it.dom.app.struts2"></constant> -->
	<!-- <constant name="struts.convention.default.parent.package"
value="struts2"></constant> -->
	<constant name="struts.convention.exclude.packages"
		value="org.apache.struts.*, org.apache.struts2.*,
org.springframework.web.struts.*, org.springframework.web.struts2.*,
org.hibernate.*"></constant>
	<constant name="struts.convention.package.locators" value="struts2"></constant>


	<package name="app" namespace="/protected" extends="struts-default">
		
		<!-- <action name="about2" class="it.dom.app.struts2.AboutPage2Action"> -->
		<!-- <result name="success">/pages/struts2/aboutPage2.jsp</result> -->
		<!-- <result name="error">/error.jsp</result> -->
		<!-- <result name="input">/error.jsp</result> -->
		<!-- <interceptor-ref name="paramsPrepareParamsStack" /> -->
		<!-- <result type="stream"> -->
		<!-- <param name="contentType">text/html</param> -->
		<!-- <param name="inputName">inputStream</param> -->
		<!-- </result> -->
		<!-- </action> -->

		<!-- Add actions here -->
	</package>

	<!-- Add packages here -->

</struts>
===========================================

aboutPage2.jsp:

===========================================
<%@ taglib
	uri="http://tiles.apache.org/tags-tiles"
	prefix="tiles"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta
	http-equiv="Content-Type"
	content="text/html; charset=UTF-8">
<title><tiles:insertAttribute
		name="title"
		ignore="true" ></tiles:insertAttribute></title>
</head>
<body>
	<table
		border="1"
		cellpadding="2"
		cellspacing="2"
		align="center">
		<tr>
			<td
				height="30"
				colspan="2"><tiles:insertAttribute name="header"
></tiles:insertAttribute></td>
		</tr>
		<tr>
			<td width="350"><tiles:insertAttribute name="body"
></tiles:insertAttribute></td>
		</tr>
		<tr>
			<td
				height="30"
				colspan="2"><tiles:insertAttribute name="footer"
></tiles:insertAttribute></td>
		</tr>
	</table>
</body>
</html>
=============================

The other jsp's are standard html...
The libs are the standard dependencies included for Struts2.2.3 (tiles
libs included) plus the others for struts1...

If possible help me, please...

Tx in advance
Ciao
Vale

Mime
View raw message