• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

struts2 action from tiles definition fired multiple times

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am testing to fire a struts2 action from tiles definition (tiles-defs.xml). The action was fired, but it goes to infinite loop and can't stop. I notice it by adding a breakpoint in execute() method of ToHeaderAction.java, in debug mode. I think there is something wrong in web.xml but I don't know what is. Does anyboby help me to figure it out? thanks in advance.

I use Struts 2.1, tiles 2, tomcat 6, following jar files in the lib folder
struts-core-1.3.10.jar
struts2-core.2.1.6.jar
struts-tiles-plugin-2.0.11.1.jar
tiles-api-2.0.6.jar
tiles-core-2.0.6.jar
tiles-jsp-2.0.6.jar


below is the code.

web.xml

-----------
Struts xml

-------------

tiles-defs.xml

---------
index.jsp

------------

standard-layout.jsp

-------
siteHeaderTile.jsp

--------------
ToHeaderAction.java

---------------
MainPageAction.java

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m not obversing your code carefully

<?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="homepage.tiles" template="/layout/standard-layout.jsp">
<put-attribute name="header" value="/toHeader.action" />
<put-attribute name="body" value="/tiles/mainpage/main-body.jsp" />
</definition>

</tiles-definitions>

<put-attribute name="header" value="/toHeader.action" />
i think this line is wrong
you cant call action on tiles
edit:
and delete the one of them
struts-core-1.3.10.jar
struts2-core.2.1.6.jar
 
Chan Yan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vertion 1 of Tiles used to be support to fire action (.do in struts 1) in tiles-defs.xml. For some reason, it doesn't works same way in tiles 2.
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!