The Source for Java Technology Collaboration
Webmaster Alert: Posting to Jive Forums is currently not working. Estimated time for fix is unknown.

Home » java.net Forums » GlassFish » GlassFish

Thread: Myfaces and glassfish

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Dec 7, 2009 6:07 AM by: ahmadkh
Jiri Pejchal
Myfaces and glassfish
Posted: Oct 8, 2008 9:51 AM
  Click to reply to this thread Reply

Hi,

how can I use Myfaces bundled with my web application
instead of Sun jsf implementation that is bundled with Glassfish?

Thanks.

Jiri Pejchal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


chndu6ue

Posts: 1
Re: Myfaces and glassfish
Posted: Oct 9, 2008 12:21 AM   in response to: Jiri Pejchal
  Click to reply to this thread Reply

I have successfully deployed myfaces 1.1 application on glassfish v2 with minimal effort.

Follow the below steps :

1) Edit WEB-INF/web.xml
Remove the DOCTYPE declaration to avoid the WebXml java.sun.com connectionTimeout exception

2) Add WEB-INF/sun-web.xml
-------- Start -------------------
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
-->

<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
<sun-web-app >
<class-loader delegate="false"/>
<property name="useMyFaces" value="true"/>
</sun-web-app>

-------- END -------------------
3) add version to web-app in WEB-INF/web.xml : Error "#{...}" is not allowed in Template Text

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.3">
....
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

....
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
...
</web-app>


4> WEB-INF/lib
Solaris#ls -al
10/05/2008 02:21 PM 444,694 altova-bulk-1.0.0.jar
10/05/2008 02:21 PM 427,108 altova.jar
10/05/2008 02:21 PM 444,689 antlr-2.7.6rc1.jar
10/05/2008 02:21 PM 16,777 asm-attrs.jar
10/05/2008 02:21 PM 26,360 asm.jar
10/05/2008 02:21 PM 282,338 cglib-2.1.3.jar
10/05/2008 02:21 PM 188,671 commons-beanutils.jar
10/05/2008 02:21 PM 29,029 commons-codec-1.2.jar
10/05/2008 02:21 PM 175,426 commons-collections-2.1.1.jar
10/05/2008 02:21 PM 100,776 commons-dbcp-1.1.jar
10/05/2008 02:21 PM 168,446 commons-digester.jar
10/05/2008 02:21 PM 112,341 commons-el-1.0.jar
10/05/2008 02:21 PM 22,379 commons-fileupload.jar
10/05/2008 02:21 PM 222,862 commons-httpclient.jar
10/05/2008 02:21 PM 63,980 commons-lang-1.0.1.jar
10/05/2008 02:21 PM 38,015 commons-logging-1.0.4.jar
10/05/2008 02:21 PM 39,523 commons-pool-1.1.jar
10/05/2008 02:21 PM 84,462 commons-validator.jar
10/05/2008 02:21 PM 345,295 courierupload.jar
10/05/2008 02:21 PM 313,898 dom4j-1.6.1.jar
10/05/2008 02:21 PM 265,116 easybar.jar
10/05/2008 02:21 PM 47,531 ehcache-1.1.jar
10/05/2008 02:21 PM 1,971,632 hibernate3.jar
10/05/2008 02:21 PM 20,807 jstl.jar
10/05/2008 02:21 PM 665,686 lucene-core-2.3.2.jar
10/05/2008 02:21 PM 755,868 myfaces-extensions.jar
10/05/2008 02:21 PM 478,950 myfaces-impl.jar
10/05/2008 02:21 PM 220,488 myfaces-jsf-api.jar
10/05/2008 02:21 PM 351,919 ordership.jar
10/05/2008 02:21 PM 123,220 oscache-2.3.jar
10/05/2008 02:21 PM 355,092 patrecdpaycls.jar
10/05/2008 02:21 PM 350,115 refunded.jar
10/05/2008 02:21 PM 346,936 rollback.jar
10/05/2008 02:21 PM 351,615 satesreturnupload.jar
10/05/2008 02:21 PM 114,245 spring-core-1.2.5.jar
10/05/2008 02:21 PM 542,091 standard.jar
10/05/2008 02:21 PM 544,774 struts.jar
10/05/2008 02:21 PM 150,426 urlrewrite-2.6.0.jar
10/05/2008 02:21 PM 361,173 velocity-1.4.jar
10/05/2008 02:21 PM 517,761 velocity-dep-1.4.jar
10/05/2008 02:21 PM 14,242 velocity-tools-generic-1.1.jar
41 File(s) 12,096,756 bytes
2 Dir(s) 11,019,374,592 bytes free

ahmadkh

Posts: 1
Re: Myfaces and glassfish
Posted: Dec 7, 2009 6:07 AM   in response to: chndu6ue
  Click to reply to this thread Reply

Hi all, thanks for the steps everything works in exact manner as mentioned.

I know it is kinda old to post here, but can anyone confirm what i observe:

I've noticed that tomcat is operating perfectly better than glassfish when it come to Myfaces/Trinidad/Tomahawk

few stress tests on a web page (Using glassfish) will make the page dead, and no more sucessfull PPR --- this is not the case when it comes to tomcat!

with all thanks




 XML java.net RSS