You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by roman danilin <ro...@mail.ru> on 2008/02/20 17:16:42 UTC

Tiles 2 without Struts

Hi all.

Step 1: Update your web.xml from WAR archive:

	<context-param>
		<description>Tiles configuration file</description>
		<param-name>
			org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
		</param-name>
		<param-value>/WEB-INF/classes/tiles.xml</param-value>
	</context-param>

	<servlet>
		<servlet-name>tiles</servlet-name>
		<servlet-class>
			org.apache.tiles.web.startup.TilesServlet
		</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>tiles_dispatch</servlet-name>
		<servlet-class>
			org.apache.tiles.web.util.TilesDispatchServlet
		</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>tiles_dispatch</servlet-name>
		<url-pattern>*.tiles</url-pattern>
	</servlet-mapping>

Step 2: Place tiles.xml in WEB-INF/classes directory in your WAR
application, tiles.xml may look as:

<?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="test" template="index.jsp">
	</definition>		
</tiles-definitions>

Step 3: Place your "index.jsp" in root of WAR archive.

Step 4: Copy Tiles libraries to WEB-INF/lib (tiles-*.jar and common-*.jar)

Step 5: Run your WAR archive in web container (like Tomcat) and navigate url
http://localhost:8080/my_webapp/test.tiles

Step 6: Create your custom tiles definitions :)
-- 
View this message in context: http://www.nabble.com/Tiles-2-without-Struts-tp15591200p15591200.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: Tiles 2 without Struts

Posted by Antonio Petrelli <an...@gmail.com>.
2008/2/21, roman danilin <ro...@mail.ru>:
>
>
> This is simple tutorial for that, who want use Tiles Framework without
> Struts.



Don't post it here, post it into the wiki :-)
http://cwiki.apache.org/TILES/

Antonio

Re: Tiles 2 without Struts

Posted by roman danilin <ro...@mail.ru>.
This is simple tutorial for that, who want use Tiles Framework without
Struts.


Antonio Petrelli-3 wrote:
> 
> Sorry, what's this?
> 
> 2008/2/20, roman danilin <ro...@mail.ru>:
>>
>>
>> Hi all.
>>
>> Step 1: Update your web.xml from WAR archive:
>>
>>         <context-param>
>>                 <description>Tiles configuration file</description>
>>                 <param-name>
>>
>> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
>>                 </param-name>
>>                 <param-value>/WEB-INF/classes/tiles.xml</param-value>
>>         </context-param>
>>
>>         <servlet>
>>                 <servlet-name>tiles</servlet-name>
>>                 <servlet-class>
>>                         org.apache.tiles.web.startup.TilesServlet
>>                 </servlet-class>
>>                 <load-on-startup>2</load-on-startup>
>>         </servlet>
>>
>>         <servlet>
>>                 <servlet-name>tiles_dispatch</servlet-name>
>>                 <servlet-class>
>>                         org.apache.tiles.web.util.TilesDispatchServlet
>>                 </servlet-class>
>>         </servlet>
>>
>>         <servlet-mapping>
>>                 <servlet-name>tiles_dispatch</servlet-name>
>>                 <url-pattern>*.tiles</url-pattern>
>>         </servlet-mapping>
>>
>> Step 2: Place tiles.xml in WEB-INF/classes directory in your WAR
>> application, tiles.xml may look as:
>>
>> <?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="test" template="index.jsp">
>>         </definition>
>> </tiles-definitions>
>>
>> Step 3: Place your "index.jsp" in root of WAR archive.
>>
>> Step 4: Copy Tiles libraries to WEB-INF/lib (tiles-*.jar and
>> common-*.jar)
>>
>> Step 5: Run your WAR archive in web container (like Tomcat) and navigate
>> url
>> http://localhost:8080/my_webapp/test.tiles
>>
>> Step 6: Create your custom tiles definitions :)
>> --
>> View this message in context:
>> http://www.nabble.com/Tiles-2-without-Struts-tp15591200p15591200.html
>> Sent from the tiles users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Tiles-2-without-Struts-tp15591200p15605723.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: Tiles 2 without Struts

Posted by Antonio Petrelli <an...@gmail.com>.
Sorry, what's this?

2008/2/20, roman danilin <ro...@mail.ru>:
>
>
> Hi all.
>
> Step 1: Update your web.xml from WAR archive:
>
>         <context-param>
>                 <description>Tiles configuration file</description>
>                 <param-name>
>
> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
>                 </param-name>
>                 <param-value>/WEB-INF/classes/tiles.xml</param-value>
>         </context-param>
>
>         <servlet>
>                 <servlet-name>tiles</servlet-name>
>                 <servlet-class>
>                         org.apache.tiles.web.startup.TilesServlet
>                 </servlet-class>
>                 <load-on-startup>2</load-on-startup>
>         </servlet>
>
>         <servlet>
>                 <servlet-name>tiles_dispatch</servlet-name>
>                 <servlet-class>
>                         org.apache.tiles.web.util.TilesDispatchServlet
>                 </servlet-class>
>         </servlet>
>
>         <servlet-mapping>
>                 <servlet-name>tiles_dispatch</servlet-name>
>                 <url-pattern>*.tiles</url-pattern>
>         </servlet-mapping>
>
> Step 2: Place tiles.xml in WEB-INF/classes directory in your WAR
> application, tiles.xml may look as:
>
> <?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="test" template="index.jsp">
>         </definition>
> </tiles-definitions>
>
> Step 3: Place your "index.jsp" in root of WAR archive.
>
> Step 4: Copy Tiles libraries to WEB-INF/lib (tiles-*.jar and common-*.jar)
>
> Step 5: Run your WAR archive in web container (like Tomcat) and navigate
> url
> http://localhost:8080/my_webapp/test.tiles
>
> Step 6: Create your custom tiles definitions :)
> --
> View this message in context:
> http://www.nabble.com/Tiles-2-without-Struts-tp15591200p15591200.html
> Sent from the tiles users mailing list archive at Nabble.com.
>
>