You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shasha <sa...@yahoo.com> on 2010/01/22 00:36:52 UTC

Struts2 :Tiles request page without action class

Hi All,

I am trying to show welcome page using tiles so i am calling to call an
action where the action doesn't exists (since this a feature in struts2) it
thrown an error 

org.apache.tiles.definition.NoSuchDefinitionException: SUCCESS

can any let me know what must be the error.

web.xml 

<listener>  
         
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>   
</listener> 

tiles.xml 

<definition name="baseLayout" template="pages/layout/baseLayout.jsp">
      <put-attribute name="title"  value="Template"/>
      <put-attribute name="header" value="/pages/common/header.jsp"/>
      <put-attribute name="menu"   value="/pages/common/menu.jsp"/>
      <put-attribute name="body"   value="string"/>
      <put-attribute name="footer"   value="/pages/common/footer.jsp"/>
  </definition>
  
  <definition name="SUCCESS" extends="baseLayout">
      <put-attribute name="title"  value="Template"/>
      <put-attribute name="body"   value="/pages/login.jsp"/>
  </definition>

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


-- 
View this message in context: http://old.nabble.com/Struts2-%3ATiles-request-page-without-action-class-tp27266243p27266243.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2 :Tiles request page without action class

Posted by Antonio Petrelli <an...@gmail.com>.
2010/1/22 Shasha <sa...@yahoo.com>:
>  How do you configure the StrutsTilesListener?
> web.xml
>
> <listener>
>
> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
> </listener>

No context parameter? This means that it tries to load
/WEB-INF/tiles.xml by default.

> Where are Tiles definitions stored?
> there are stored in tiles.xml and the xml is avilable at the classpath.

It is not loaded, since, as mentioned above, the default file loaded
is /WEB-INF/tiles.xml

Antonio

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


Re: Struts2 :Tiles request page without action class

Posted by Shasha <sa...@yahoo.com>.
Thank you both
After incorporating both your comments it's working fine.
:clap:


DustFrog wrote:
> 
> What about this line:
> 
> <definition name="baseLayout" template="pages/layout/baseLayout.jsp">
> 
> Noticing that there is not a "/" in front of pages, but in your other
> references, there is.  Is this a typo or is this the way that you actually
> have it in your project?  Could this be causing your problem?
> 

-- 
View this message in context: http://old.nabble.com/Struts2-%3ATiles-request-page-without-action-class-tp27266243p27281685.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2 :Tiles request page without action class

Posted by DustFrog <ke...@goowy.com>.
What about this line:

<definition name="baseLayout" template="pages/layout/baseLayout.jsp">

Noticing that there is not a "/" in front of pages, but in your other
references, there is.  Is this a typo or is this the way that you actually
have it in your project?  Could this be causing your problem?
-- 
View this message in context: http://old.nabble.com/Struts2-%3ATiles-request-page-without-action-class-tp27266243p27272636.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2 :Tiles request page without action class

Posted by Shasha <sa...@yahoo.com>.
Do you see an exception at the start of your app?
no

 How do you configure the StrutsTilesListener?
web.xml

<listener>  
         
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>  
</listener> 

Where are Tiles definitions stored?
there are stored in tiles.xml and the xml is avilable at the classpath.


Antonio Petrelli-3 wrote:
> 
> 2010/1/22 Shasha <sa...@yahoo.com>:
>> I am trying to show welcome page using tiles so i am calling to call an
>> action where the action doesn't exists (since this a feature in struts2)
>> it
>> thrown an error
>>
>> org.apache.tiles.definition.NoSuchDefinitionException: SUCCESS
> 
> Usually this happens when your app failed to load definitions.
> Do you see an exception at the start of your app?
> Where are Tiles definitions stored? How do you configure the
> StrutsTilesListener?
> 
> Antonio
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Struts2-%3ATiles-request-page-without-action-class-tp27266243p27272187.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts2 :Tiles request page without action class

Posted by Antonio Petrelli <an...@gmail.com>.
2010/1/22 Shasha <sa...@yahoo.com>:
> I am trying to show welcome page using tiles so i am calling to call an
> action where the action doesn't exists (since this a feature in struts2) it
> thrown an error
>
> org.apache.tiles.definition.NoSuchDefinitionException: SUCCESS

Usually this happens when your app failed to load definitions.
Do you see an exception at the start of your app?
Where are Tiles definitions stored? How do you configure the
StrutsTilesListener?

Antonio

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