Skip to main content

JMaki + Facelets...?

16 replies [Last post]
tdjhb
Offline
Joined: 2006-12-06
Points: 0

Hello there. I am currently evaluating different AJAX solutions for my company (along with moving to JSF 1.2 RI). Using Facelets would greatly benefit us and I have been able to configure and use Facelets without issues... but throwing in the AJAX variable has created some problems. I am able to use ajax4jsf framework without any problems but I would like to use JMaki as well. But I cannot since facelets complains about a namespace issue for a:ajax...

Is there a way to get JMaki working smoothly with Facelets?

TIA,

TDJHB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gashh
Offline
Joined: 2008-03-06
Points: 0

i can't start jmaki-facelets.war on my Tomcat 6.0 server!

I need some help with configurations Faclets and jMaki to work together ...
configuration of web.xml, which .jar files I need to import, etc.

I am using NetBeans IDE and Apache-Tomcat-6.0.14

Please!

jkaijans
Offline
Joined: 2006-12-06
Points: 0

Please, details about this would be highly appreciated!

gmurray71
Offline
Joined: 2003-07-31
Points: 0

So we have a early access sample of jMaki and Faclets thanks to some external contributions. Find the sample here:

https://ajax.dev.java.net/servlets/ProjectDocumentList?folderID=6872

Please note that not all the widgets that jMaki wraps are proper XHTML so some widgets are going to have issues. We can only do proper markup of the widgets we create natively.

ntruchsess
Offline
Joined: 2007-01-05
Points: 0

having checked the sample (v.5) I've a few things to add:

-jmaki.taglib.xml is broken (invalid dtd specified, handler-class missing, I guess Greg didn't notice I've put a valid taglib.xml in my contribution) (see issue #123), valid taglib.xml see below.

-namespace used in jmaki.taglib.xml is 'http://java.sun.com/jmaki', better would be 'http://java.sun.com/jmaki-jsf' (as for the jsp-taghandler - or change the namespace of the jsp-taghandler to 'http://java.sun.com/jmaki' to be consistend)

-better move jmaki.taglib.xml to ajax-wrapper-comp.jar's META-INF to be automatically picked up by facelets

-the facelet-handler writes some unnessesary debug-stuff to stdout (guess this was addet and later left in there by Greg because it did'nt write anything due to the facelethandler not being instantiated at all because of the invalid taglib.xml...)

-facelets default content-type is 'text/xhtml' which breaks most dojo-widgets. As a workaround use in your facelet-pages.

--------------------------------

"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">


http://java.sun.com/jmaki-jsf

ajax

AjaxWrapper
AjaxWrapper
com.sun.jmaki.AjaxWrapperHandler


tdjhb
Offline
Joined: 2006-12-06
Points: 0

I would like more details please. I am very keen on getting JMaki working with Facelets...

harpox
Offline
Joined: 2007-01-10
Points: 0

Hi,

I´ve also got a problem with Facelets / JSF and jMaki.

The jMaki tag - e.g. - will not be rendered. When using JSP as a view technology it does work. Are Facelets really supported by jMaki ?

BTW: Dynamic Faces works fine in both - JSP and Facelets - environments.

Thanks for your support !

gmurray71
Offline
Joined: 2003-07-31
Points: 0

We will have to give facelets another look. We changed the design of jMaki to allow for us to integrate. Was the clock widget the only one you used? Could you also provide us more information on your environment?

harpox
Offline
Joined: 2007-01-10
Points: 0

Hi,
I have tried the Dojo widgets "clock", "inlineedit" and "fisheye". Results as described before.

Here are some details of my environment:
- JSF 1.2 (Sun RI)
- jMaki 1.0 beta (v 8)
- Facelets 1.1.12
- Sun AppServer 9.0
- Eclipse 3.2

I have copied the whole content of the "jmaki.war" file's "resources" directory the my web apps "resources" directory.

Then, I have added the "ajax-wrapper-comp.jar" to my web apps "lib" directory.

Next, I have edited a "home.xhtml" file with a 'xmlns:a="http://java.sun.com/jmaki-jsf"' reference. ('xmlns:a="http://java.sun.com/jmaki"' does not work either.)

Finally, the widget's calls are:








value="#{fishEyeBean.selectedIndex}"
valueChangeListener="#{fishEyeBean.valueChanged}"
args="{items:[
{iconSrc:'img/de_DE.gif',caption:'Index 0',index:0},
{iconSrc:'img/es_ES.gif',caption:'Index 1',index:1},
{iconSrc:'img/en_US.gif',caption:'Index 2',index:2},
{iconSrc:'img/ja_JP.gif',caption:'Index 3',index:3}
]}"
/>

All these things work fine within an JSP view. But the Facelet container does not seem to render anything at all, although the objects are present in the rendered HTML page.

@Greg: If you would like to, I may send the whole project - w/o the libs - to you.

Thanks a lot for your support !

gmurray71
Offline
Joined: 2003-07-31
Points: 0

Could you zip up the project and send it? If it's too big please send me a URL that I can get it from. I can be reached at gregory dot murray at sun dot com

ntruchsess
Offline
Joined: 2007-01-05
Points: 0

this only works with an appropriate facelets-taglib file plus facelet-component-handler. I've just written such and send to Greg by email.

harpox
Offline
Joined: 2007-01-10
Points: 0

Mmm, sounds interesting. But shouldn´t jMaki handle the rendering ?
I am anxious to test this solution.

ntruchsess
Offline
Joined: 2007-01-05
Points: 0

for your understanding:

- a facelet-handler is for handling the UIComponent only (population of component tree and setting of attributes)

- the UIComponent and it's associated Renderer remains unchanged.

mcbeelen
Offline
Joined: 2006-05-02
Points: 0

Hello Greg,

I wanted to give jMaki a try for providing some components (widgets) for my application.
I started about by running the jmaki-facelets.war locally in my tomcat-server.

After adding the application to my configuration I started the server, but the application wouldn't start due to an IllegalArgumentException:

Caused by: java.lang.IllegalArgumentException: Duplicate context initialization parameter javax.faces.STATE_SAVING_METHOD
at org.apache.catalina.core.StandardContext.addParameter(StandardContext.java:2244)
... 44 more

In the web.xml on line 24 the state-saving-method is configured to client, but on line 34 it is again specified, but then stating it should be 'server'.

I'll remove one of the locally and test it again, but I would at leastlet you know about this minor inconvenience.

With kind regard,
Marco

gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

I've not tried running jMaki with facelets as I'm just trying to keep everything moving but I have seen that the creator team has been able to use jMaki with the jspx syntax. See how they were able to get the name space set right at:

http://blogs.sun.com/divas/entry/giving_jmaki_a_whirl

tdjhb
Offline
Joined: 2006-12-06
Points: 0

I do not have a problem with using JMaki with the jspx syntax *outside* Facelets but once I incorporate Facelets view handler the namespace error pops up. Is there a Facelets discussion forum where I can post about this as well? I can only find their maillists...

kenpaulsen
Offline
Joined: 2005-03-30
Points: 0

Hi,

As I understand it, Facelets requires extra configuration when you add a taglib for it to recognize that taglib. I do not think this is difficult to do from what I have heard, but I do not know the exact steps. It would be best to ask on the Facelet forums. Facelets has forums, mailing lists, and you may be able to get help on the JSF forum. Here are some links that might help you out:

https://facelets.dev.java.net/servlets/ProjectForumView
https://facelets.dev.java.net/servlets/ProjectMailingListList
http://forum.java.sun.com/forum.jspa?forumID=427

Also, if you are evaluating Facelets, you may also want to consider JSFTemplating. It works very well with jMaki and I'm in the process of adding support for Ed Burn's "Dynamic Faces" Ajax support -- I will be done this weekend. JSFTemplating adds many features that Facelets doesn't have (pageSession, events, component factories, etc) which make JSF development much easier and more maintainable. If you want to check it out, take a look at:

https://jsftemplating.dev.java.net

Good luck!

Ken Paulsen
https://jsftemplating.dev.java.net