Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Problem while Struts 2 and Tiles 2 integration.

Kev_dev

2007-06-16

Replies:


I received this error as well, and discovered the cause to actually be my
tiles.xml. The Struts2 tiles.xml needs to follow the schema defined in
"http://struts.apache.org/dtds/tiles-config_2_0.dtd", and if your tiles.xml
differs from it, you may receive this exception. In my case, I was porting
over a struts1 tiles.xml, and missed one of the syntax changes. So I had:

<definition name="2colLayout" path="/WEB-INF/templates/2col.jsp">

instead of:

<definition name="2colLayout" template="/WEB-INF/templates/2col.jsp">

for one of my entries. So when the tiles plugin wanted to open my actual
layout page, it did not see the correct entry for it (it did not see the tag
"template="), and threw the I/O exception. Double check your tiles.xml and
ensure that it has the correct syntax for struts2 tiles.

You may not have noticed the syntax error if you were using an IDE (which
should have validated your XML for you), because the
"http://struts.apache.org/dtds/tiles-config_2_0.dtd" doesn't actually exist!
It looks like apache forgot to put in on their site, so you won't know of
your syntax issues until runtime.
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.