Myfaces Eclipse Setup

Myfaces application can be configured in eclipse and launched using tomcat/jetty servlet container. Lets assume a general web application directory structure:

<root>
  +---lib
  +---persistence
  |      +---src
  |           +---java
  +---service    
  |      +---src
  |           +---java
  +---web
       +-----src
       |      +---java
       +-----webapp
              +---WEB-INF
              |    +---classes
              |    +---lib
              |    +---web.xml
              |    +---faces-config.xml
              +---<view pages>

The <root>/lib folder contains Myfaces jars. Lets assume <root> folder is c:\workspace\myproject. Its a good idea to download various/all latest commons jars and put in a subdirectory under lib. Install the following:

Following steps are common whether configuring for tomcat or jetty


Configuring in Tomcat

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="${catalina.home}/../../workspace/myproject/web/webapp" path="/myproject">
  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_myproject_log." suffix=".txt"
          timestamp="true"/>

</Context>


Configuring in Jetty