Manage this page

0. Feedback

1. Display

Books

JSF from Manning, 2005

ALl books on jsf

Java Links

jsf 1.0 apis

1. An introduction to the java logging api from O'Reilly

2. java forums from sun

142 api

142 api Cheat sheat

jstl 1.1 docs

Forums

at sun

ibm jsf forum

Articles

jstl 101

jstl 102

Tutorial

A 5 minute tutorial to JSF

Supporting docs

  1. Help on CSS
  2. JSF tutorials
  3. java script help
  4. Sample jsf tags
  5. last item

jsf home page

Refer to chapter 17 and 18

With jdk 1.4 or websphere 5.x what is the latest jsf spec I can run?

Can I create jsf with sun studio creator and run the resulting apps under websphere?

Collect some jsf articles in reference to websphere. What release of jsf supports? What are their recommendations?

servlets 2.3 and jsp 1.2

Seem like a good introductory article

Use this page for referencing jsf related tags

If a page is a collection of UI objects, is there a page class that I can write where the ui components are member variables. This will allow me to programmatically set the components.

Looks like the managed bean object is similar to a page object. It can define all the actions on that page. Nevertheless questions remain.

Can I have member properties that are directly tied to UI components so that I can change their appearnce? Or am I limited to mainly data bound to that UI component.

JSF tag reference

The proficiency in JSF may be directly related to knowing its tags and what is possible with those tags. The good news is there seem to be only a limited set of tags.

try downloading 1.1 of jsf

article at jsf site docs

Seem promising.

You can go to the download page specified above and download the 1.1 jsf. It is about 11m. Comes with

docs
javadocs
lib
metadata
renderkitdocs
samples
tlddocs

The samples include

cardemo
components
guessnumber
nonjsp

Is there a concept of an unload for a page object? That would allow me to prime my ui components programmatically.

As the page gets loaded through faces, when does the model object gets created? I am especially interested in things like can I gather data before entering the painting phase as typically done by controller servlets. Or the norm, like asp.net, is you do this in action events of that page, including the onload. In that sense is onload playing the following rules

1. validate fields
2. validate security
3. Gather page data

Looks like it is just invoking a regular jsp page. As the jsp is expanded if the tag is a jsf tag the relative acitions are accordingly performed.

It will be interesting to follow what happens when a jsf button is pressed! probably it is tied to an action. the action probably will return a hint where to go next. Or may be validate will get kicked off returing a hint where to go next. Or may be the navigation rules will play a part.

Read the article

myfaces from apache
Smile - not sure what this is yet

It is possible the jsf jar files could have gone to a system class path. But the Manning book seem to suggest that these will go into web-inf/lib directory along with the application jars and also the jstl jars

As per the Manning book, at the moment the RI implementaion does not support shared libraries. So they have to be in the web-inf/lib directory.

jsf-api.jar
jsf-impl.jar
jstl.jar - jstl api
standard.jar - jstl implementation

You may hav to load them from somewhere else.

1. What are context paramters in web.xml?

2. What are the required context paramters for faces application

What are the following

state saving method
validate xml in the faces config xml file
verify objects

Koders.com

Not sure how good it is though. I coudln't find the FacesServle.java from here

worthwhile reading release notes for any known issues

Read this thread

Problem code

try {
ApplicationFactory applicationFactory = (ApplicationFactory)
FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
144 application = applicationFactory.getApplication();
} catch (FacesException e) {
Throwable rootCause = e.getCause();
if (rootCause == null) {
throw e;
} else {
throw new ServletException(e.getMessage(), rootCause);
}
}
(listener)
    (listener-class)com.sun.faces.config.ConfigureListener(/listener-class)
(/listener)

Note. I have used braces for angular brackets for my convenience here. But you get the idea.

Apparently there is some description in the release notes about what this does.

For jsf 1.1 use jstl 1.0

What are page templates in JSF?

What are jsp fragments?

access the page

This is a quick templatized look up of html and equivalent jsf controls. quite useful

public class SWAppSession 
{
   static HttpSession getSession()
   {
      HttpSession session = 
         (HttpSession)FacesContext
            .getCurrentInstance()
               .getExternalContext()
                  .getSession(false);
      if (session == null)
      {
         throw new RuntimeException(
             "Sorry. Got a null session from facescontext");
      }
      return session;
   }
}

Apparently jsf uses a configurable converter to translate between your object and a string to populate this "value" attribute. Specifically it doesn't use the java serialization to save that object and bring it back but only expected to serialize the keys.

1. JSF seem to recommend using session scope when ever there is a postback

2. script collector can indicate a postback

In your page you can include this at the top of the body

hx:scriptCollector id="scriptCollector1" 
preRender="#{pc_MyAgencies.onPageLoadBegin}" 
decode="#{pc_MyAgencies.onPagePost}"

In your java code behind

YourPageBehind.onPagePost()
{
     bPostBackDetected = true;

}

YourPageBehind.onPageLoad()
{
	if ( bPostBackDetected == true)
	{
		//postback detected
		//No need to load data
		return;
	}
	//case: Initial load
	loadData();
}

You have to reset the postback otherwise the session scope says it is a postback all the time

updating a backing bean from value changed

more on post back using phase listeners

I have a table with multiple rows of model objects in a list. One of the controls in the row is a selectone list box with its own list of selectItem objects

On submit and back, any text controls I have in the table and also in the form are retaining their state and updating the model values

But the selctone list box is not updating the models?

If I follow the phase events I see the update model phase passing through. Not sure why the data in the ui is not submitted to the model

If I locate the ui control and ask its selected value I see the changed value. But this is not communicated to the the model.

How is this index set? If I click on a control that is outside the table I am getting a -1. What is the idea of a current row for a table?

This takes an id of the control. But if the control is repeated, How is it finding the control on the selected row?

post back info

Another web log entry that uses renderresponse for figuring out

Things you resort to when all else fails

From a jsf book autor

Rich hightower series at ibm

Conceptually JSF got to be easier to learn than struts. But the details of JSF seem to drown you pretty quickly. See if this series is of some help!

The most difficult parts are

1. understanding and effectively using each ui component. One can blame the component designers for it and not necessarily the jsf itself.

2. Managing the state is goofy. Only ui state is stored forcing session scope lot of the times.

3. Navigating the table rows seem to be convoluted.

These are my initiali thoughts. I am hoping I will change my mind in the next couple of weeks.

A forum topic

seems difficult to do at the row level. Suggestion is to do it at the component level

How can I put multiple controls in a single table cell?

on jsf forum

See if it touches on some central points in jsf

See the scope and utility of this tag

Can I put jsp tags inside jsf tags? Especially I want to use the plain old jsp expressions. will that work? Should I put these inside verbatim?

How to work with httpservletrequest in jsf environment

How to hide divs: Some jsf work arounds

http://www.exadel.com/tutorial/jsf/HowToWriteYourOwnJSFComponents.pdf

I haven't checked it out. So I can't say how good it is.

I can't find a clear answer on this. Would one use output text?

JSF when encounters a run time exception just prints the message and not the stack trace. Is there any way to do this?

Perhaps more importantnly, is there any way to tell it to redirect to another page? See if you can check out the source code and see how are exceptions handled in JSF.

Looks like if a JSF component throws an exception during a pre render phase, jsf seem to paint the exception and ignore any JSP painting that may happen before or after. This is a good thing. At least one will not see part of the page painted and then an exception.

Another good thing while dealing with exception. A send redirect will work during pre render as well. I have just tested it.

It will be interesting to see if one can use a forward, instead for this purpose that way the current object tree will be in scope.

From the pre render phase forward works only if the target page is a non jsf page. I get a servlet exception if it is a jsf page.

Some key words to do research and see why this is happening

responseComplete()
jsf dispatch()
skip page

If I have some jsp above and below jsf on a page, the prerender gets called when I go the page for the first time. So the exception forward works fine.

If I go to the page again, the jsp above the jsf seem to be executed first. The implication is that the background page should have no exceptions or if it does needs to have its own rerouting mechanism.

Examples in forums seem to suggest to call the renderresponse after a jsf dispatch. What does it really do?

What is the difference ..

See how configurable the faces servlet is. See if one can write listeners to drop objects on the pipeline. See if one can intercept actions and deal with exceptions globally..

See if any of the following will be addressed a) monolithic faces servlet b) exceptions c) tiles or back ground pages d) integration with sitemesh or similar technologies

Go to the JSF site and see what the direction is and when the next release drop is

http://www.sun.com/software/communitysource/jsf/download.xml