Install Tomahawk in a seam-gen generated project
Hi,
installing Tomahawk in a Facelets + Seam + JSF project (generated by seam-gen) is really simple:
Demetrio Filocamo
P.S.: sorry for bad code posting (I putted a space to make tag visibles), I have to find the time to configure an appropriate css style for code showing.
installing Tomahawk in a Facelets + Seam + JSF project (generated by seam-gen) is really simple:
- Add library tomahawk*.jar in lib directory (download from http://myfaces.apache.org/tomahawk/)
- Also add those dependencies:
- commons-fileupload (http://commons.apache.org/fileupload/);
- common-codec (http://commons.apache.org/codec/);
- commons-el (http://commons.apache.org/el/);
- commons-lang (http://commons.apache.org/lang/);
- commons-logging (http://commons.apache.org/logging/);
- jakarta-oro (http://jakarta.apache.org/oro/);
- commons-validator (http://commons.apache.org/validator/).
- Inside directory resources/WEB-INF create a file named tomahawk.taglib.xml and fill in with contents that you find in the example section to this address: http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
or you can download it from here. - in web.xml add:
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
</context-param>
<!-- Tomahawk -->
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping> - In build.xml, in < todir="${war.dir}/WEB-INF/lib"> section , inside the < dir="${lib.dir}"> tag, add:
<name="tomahawk*.jar">
<name="commons-codec*.jar">
<name="commons-el*.jar">
<name="commons-fileupload*.jar">
<name="commons-lang*.jar">
<name="commons-logging*.jar">
<name="commons-validator*.jar">
<name="commons-validator*.js">
<name="jakarta-oro*.jar"> To use the library in xhtml pages:
xmlns:t="http://myfaces.apache.org/tomahawk"
Demetrio Filocamo
P.S.: sorry for bad code posting (I putted a space to make tag visibles), I have to find the time to configure an appropriate css style for code showing.
