Jaarthy,
It looks like your <s:url> tag is trying to point to a tile, vs. an
action that returns the tile result.
Here's an example:
<!- Struts tag -->
<s:url id="projectList" action="list" namespace="/project" />
<s:a href="%{projectList}"><s:text name="project.list"/></s:a>
<!-- Action -->
<package name="project" extends="base-project" namespace="/project">
<action name="list" method="list" class="..MyAction">
<result name="success"
type="tiles">list-project.panel</result>
</action>
</package>
<!-- Tiles -->
<definition name="root" template="/fragments/root.jsp">
<put-attribute name="js" value="/js/default.js" />
<put-attribute name="other-divs" value="/fragments/blank.jsp" />
</definition>
<definition name="list-project.panel" extends="root">
<put-attribute name="title" value="Project List"/>
<put-attribute name="body"
value="/component/search-results.jsp"/>
</definition>
HTH,
MG
-----Original Message-----
From: Jaarthy [mailto:[email protected]]
Sent: Tuesday, February 10, 2009 3:40 PM
To: [email protected]
Subject: Re: Struts2.1.6 & Tiles 2.1.
Here is my
web.xml
----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app id="starter" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts 2 </display-name>
<description>Struts 2</description>
<context-param>
<description>This context parameter specifies
the name and location
of the Spring root application context
file.</description>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</context-param>
<context-param>
<description>This context parameter specifies
the name and location
of the Tiles Definitions file.</description>
<param-name>org.apache.tiles.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/classes/tiles-defs.xml</param-value>
</context-param>
<context-param>
<param-name>
org.apache.tiles.evaluator.AttributeEvaluator
</param-name>
<param-value>
org.apache.tiles.evaluator.el.ELAttributeEvaluator
</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndEx
ecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-cla
ss>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.as.sample.webapp.action</param-value>
</init-param>
</filter>
<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>
</web-app>
struts.xml
----------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="sampleApp" extends="tiles-default" namespace="/" >
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" default="true" />
</result-types>
<action name="login">
<result>login</result>
</action>
</package>
</struts>
tiles-defs.xml
--------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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="login" extends=".layout">
<put name="title" value="Sample - login"/>
<put name="content" value="/WEB-INF/jsp/login.jsp"/>
</definition>
</tiles-definitions>
In my home page,when i click on the login link <s:url value=
"title="login">Login I get an error page,In the logs I see a warning
message WARN:"Unable to find the definition 'login'.
Where am I going wrong?
Aarthy
Lukasz Lenart wrote:
>
> 2009/2/10 Jaarthy <[email protected]>:
>> I am trying to integrate Struts2.1.6 with tiles2.1.1. When I click on
>> the login link,I am getting "Unable to find the definition"warning
>> Message in my logs.Any help on this issue will be appreciated.
>
> Sorry, I loose my magic ball, you will have to provide more details.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Struts2.1.6---Tiles-2.1.1-tp21928113p21943239.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]