You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2005/07/14 01:47:14 UTC

[Myfaces Wiki] Update of "How to add MyFaces support to a Sun JSF RI application" by DonWalters

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by DonWalters:
http://wiki.apache.org/myfaces/How_to_add_MyFaces_support_to_a_Sun_JSF_RI_application

New page:
=== Introduction ===
MyFaces does have its own implementation of the JSF 1.1 implementation.  But if you already have a working JSF web app based on the Sun JSF 1.1 reference implementation, you may not want stay with it.  The following describes the minimal steps necessary to add the MyFaces extensions to a Sun JSF 1.1 web app.

 * Versions these steps should work for:
  * Sun JSF 1.1.01
  * MyFaces 1.0.9

 * Notes:
  * The MyFaces version of Tiles Support will not work with this approach, but other components should work fine.

=== Steps ===

 * Put the Put the myfaces-extensions.jar and the commons-fileupload-1.0.jar in your WEB-INF/lib directory (or in the classpath of your application server.)
 * Add the following lines to your web.xml file:

{{{
<!-- Extensions Filter -->
<filter>
	<filter-name>extensionsFilter</filter-name>
	<filter-class>
		org.apache.myfaces.component.html.util.ExtensionsFilter
	</filter-class>
	<init-param>
		<description>
			Set the size limit for uploaded files. Format: 10 - 10
			bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
		</description>
		<param-name>uploadMaxFileSize</param-name>
		<param-value>100m</param-value>
	</init-param>
	<init-param>
		<description>
			Set the threshold size - files below this limit are
			stored in memory, files above this limit are stored on
			disk.
			Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
		</description>
		<param-name>uploadThresholdSize</param-name>
		<param-value>100k</param-value>
	</init-param>
	<!--
	<init-param>
		<param-name>uploadRepositoryPath</param-name>
		<param-value>/temp</param-value>
		<description>Set the path where the intermediary files will be stored.
		</description>
	</init-param>
	-->
</filter>
<filter-mapping>
	<filter-name>extensionsFilter</filter-name>
	<url-pattern>*.faces</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>extensionsFilter</filter-name>
	<url-pattern>/faces/*</url-pattern>
</filter-mapping>
}}}
Note: you may need to change the url-pattern to match whatever pattern you are using (e.g. *.jsf instead of *.faces).
 * Add the following to your JSP page in order to use one of the MyFaces custom components: 
{{{
<%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%> 
}}}

That's it!  You should now be able to add MyFaces components to your .jsp page.