Getting started with JSF - Richfaces on Eclipse - java

I used to work with JSF - Richfaces but had no idea of how to start it and I quit before I learned it.
Is there any easy way to start? What do I need to add. Like splitting projects into 4 or so and what server to use, etc.

You can also find many RichFaces resources on my blog: http://mkblog.exadel.com/tag/richfaces-howto/, including this project template: http://mkblog.exadel.com/2010/04/the-easiest-way-to-start-with-richfaces/

Here is hello world and Practical Richfaces
But I suggest you to use Primefaces. I think primefaces is the best among jsf components because of its ajax and ui facilities

although I don't have a tutorial to suggest to you, I would recommend when experimenting with Richfaces components, to look them up in the live demo, where code snippets and examples are shown. For each component you can find additional information in the "Developer Guide" link in the upper left corner.
As far as Eclipse is concerned and since you are using Richfaces, I would definitely use install the JBoss Tools plugin, which has handy features, such as auto-complete, visual editing etc.

Related

Component library with JSF project

I am looking forward to using a component library(perhaps richfaces or primefaces) with JSF for developing the frontend of a social application.
I need to know:
1.) how far is it possible to customize the look of each individual component independently besides choosing a single theme for all components. Is it possible to use CSS with these components.
2.) Can I use multiple component libraries (depending on what components I need) in a single project?
3.) Any suggestions on choosing a component library also welcomed!
EDIT
4.) Are there any visual editors for developing UI with these libraries? I currently use netbeans 6.9 IDE.
I know it's possible with RichFaces
Yes, it's possible. Most probably you have to customize at least one of them to get a consistent layout. For some libraries there exist already such themes, e.g. you find some themes for Primefaces with Richfaces look and feel.
We decided to use RichFaces which provides various well documented
components. Look at the examples of
your library candidates and decide
if they might fit your needs.
Richfaces:
http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.js
Primefaces:
http://www.primefaces.org/showcase/ui/home.jsf
Apache MyFaces Trinidad:
http://myfaces.apache.org/trinidad/index.html
I love Primefaces as they have a probably the largest and some of the most feature rich components available. It takes a litle tweaking but you could use other component libraries with Primefaces as well.
Be prepared though for a lot of issues. There are a lot of bugs however if you are decently good with javascript and CSS and have above a beginners level understanding of JSF then you should have no problems working around them. Just be prepared to implement a couple of smelly hacks to meet some requirements.
Despite these problems I notice it becoming more and more stable with every release so it will only get better from here.
I use primefaces, and customizing each component is pretty easy and fun. They have samples in their user-guide on how to customize each component (css). Primefaces relies heavily on jQuery(I noticed by looking at the source generated), but also uses other javascript libraries like YUI. Sometimes it could be very Javascript intensive on the client, but so far, it does what is says it do very well.
I am not sure about the multiple components, never tried it, and per my own recommendations, I think primefaces rocks.
AS from netbeans 7.0, primefaces is included in Netbeans, so you don't have to worry about configurations anymore.
See that you got some answer already. I had more or less the same questions as you have. In the end I went for Richfaces, because the following points
Better integrated with the core JSF 2.0 libarary and has more or less the same monoculture.
No payload on bandwidth, when not using any Richfaces component, this will happens if you use Primefaces. Because the jquery and CSS will always load, whenever you using a component or not.
The documentations is bit more comprehensive. But the Primefaces forum is more active and you'll get a better feedback
The bandwidth was the key point for me, so I picked Richfaces. But I like the Primefaces library too, since the verity of components is greater.

Master Pages in Java - JDK 1.6

I am building a website in Eclipse Helios using Google App Engine and want to implement ASP.NET Master Page like functionality for common code across different pages. Is there something similar in Java?
Updated:
I am not a Java developor, after looking at the links in the posted answers, I think Facelets and Tiles Framework offer the template functionality. Which one is the preferred one? Both can run on GAE.
I'm not very familiar with asp.net but a short read on master pages suggest to me that what you are looking for is JSF Facelets. Facelets allows you to define a template with default content and points where template clients can insert there code.
Template clients can fill in these insert points but don't have to fill in all of them or they can add new ones. So you can also build templates on other templates.
Here is an article which should you give a better idea of what JSF templating can do.
Instructions for setting up JSF on GAE are here
I'm not sure about GAE but here's an SO question that has suggestions for Java EE applications.
Update
Here's a list of stuff supported in GAE and according to this SO answer, it seems to support certain versions of JSF as well.

Scalable UI framework for Java EE web application

Can anyone suggest a good UI framework that can be used in a Java EE web application?
I will be doing a project that requires to generate a web UI on the fly. Regular JSP page coding makes it hard to do. There is a framework called Vaadin. It looks good to do a dynamic UI implementation. However, I don't know if it stable for production use. If there is any other good suggestion, please let me know.
I'd suggest Wicket. It's been in production use for years, it's very stable, it's very programmer-friendly, and it can easily handle dynamic UIs.
(But I have to agree that the Vaadin demos look hot)
I would say vaadin would be easier over wicket as the default UI elements look really good.
Wicket, you will need to create your own css to make things look good (other than default html UI)
vaadin 6.5.0 was released a couple of days ago and has been there for a long time but recently made open source probably around 2-3 years ago at most if i remember right.
I love both Vaadin and Wicket and my opinion is that they are the best 2 frameworks out there.
However, for this case, I would choose vaadin cause it is easier to get better looking UI elements

Can I add a java portlet to an existing java Web App?

I'm building a webapp that uses jboss-seam with jsf, facelets and rich faces, running on top of jboss AS 5.1.
I would like to add a portlet area where I could add my own portlets, but from what I got (reading forums and documentation) I need to be running a portlet container/portal (something like liferay or gatein). But I don't want to be running a portal. I just want some kind of control where I can embed a portlet (something like an iFrame).
Is this true or I got it wrong?
If I'm wrong, how can I add an area to my webapp where I can add a portlet?
Thanks
Best regards.
If you are looking for a JSR 286 (Portlet 2) or JSR 168 (Portlet 1) compliant portlet, what you have read is correct. You need a portlet container. JBoss used to have JBoss Portal that should fit in your stack if you are focused on the JBoss products. In fact, you can find an entire bridge between JBoss Portal and the stack you are using. If you decide that you need a portal and want to look to other apps, I have successfully run Liferay on JBoss in the past.
At the same time, you can get something that looks and behaves like a portlet by using iframes or a div and JavaScript and back-end coding. With more specifics on what you want your pseudo-portlets to do, the community can more specifically help you figure out if wiring your own smaller framework within your existing code or attempting to have some sort of larger portlet container seems more reasonable. If you want to reproduce all of the Portlet 1 or 2 spec, I'd go with the container. If you want to reproduce a mini-iGoogle, you can probably do someting with JS and HTML.
EDIT: Looking through other questions with the same portlet tag, I found the jQuery UI Sortable - Portlets demo that might provide just the portlet-like features you are looking for without an entire Portal framework. It does, of course, pull in jQuery UI.
Frankly, if you're not going to go "whole hog" with portlets, or the portlet you wish to embed is particularly sophisticated, I don't think there is much value to switching over to a portlet container.
With JSF being a component framework, the difference between a "portlet" and a "JSF component" are really more ideological than actually technical (yes, the development model is different, but not dramatically). You likely be better off create a new, high level, JSF component to act as your portlet than bringing in the whole weight and complexity of a portlet container in to your app for a single service.

Best GUI framework for Java [duplicate]

This question already has answers here:
Closed 14 years ago.
I want to start a new project with Java;
In the past I used to start with Struts + Tiles; but tiles was very complicated; I don't know the latest version of Tiles;
I need your recommendations in details for a good GUI framework;
Thanks.
Duplicate of this question.
There is no "best" framework...
Indeed, "best" really depends on your needs, on your knwoledges (it can cost a lot of time to learn a new framework)...
At first when I read GUI framework I thought you meant Swing or SWT but I see you mention struts so I guess you mean presentation framework.
I agree that Tapestry is very good, but there are several others that are also quite good. Struts2, Stripes etc. Matt Raible has a very nice project going where he did all the initial integration work for several different technologies. It is quite easy to get up and running with struts+spring+hibernate or JSF or Tapestry and so on. He calls it AppFuse.
I use struts2 with spring and hibernate and sitemesh which was an AppFuse project to start with and it has served me well.
Stripes seems to be a great starting point for a Java web app too. I haven't used it as yet but I'm tempted.
I personally like Tapestry. I've only used version 4.1 but development time is way faster than JSP or JSF. It allows you to simply refresh pages to immediately see the changes you made without doing a deployment and uses actual HTML for the templates/pages so you can preview them without deploying any code at all. There is a little bit of a learning curve up front but its well worth it. Version 5.0 is in its final beta with a release candidate due out soon but I haven't tried it yet. It's also got pretty good and easy AJAX built in.

Categories