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.
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.
Is there a concept of an unload for a page object? That would allow me to prime my ui components programmatically.
Satya - Sunday, October 30, 2005 11:17:21 AM
What is the life cycle of a page rendering?
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
Satya - Sunday, October 30, 2005 11:27:01 AM
How do I invoke a jsf page ?
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.
myfaces from apache
Smile - not sure what this is yet
Satya - Thursday, November 03, 2005 10:51:17 AM
Where do the jsf jar files go?
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.
Satya - Thursday, November 03, 2005 10:53:31 AM
Required jsf jar files
jsf-api.jar
jsf-impl.jar
jstl.jar - jstl api
standard.jar - jstl implementation
Satya - Thursday, November 03, 2005 10:55:37 AM
Suns RI does not come with jstl jar files
You may hav to load them from somewhere else.
Satya - Thursday, November 10, 2005 5:30:41 PM
What are faces context parameters in the web.xml?
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
This is a quick templatized look up of html and equivalent jsf controls. quite useful
Satya - Tuesday, December 27, 2005 4:50:40 PM
Getting a session object from jsf facescontext
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;
}
}
Satya - Thursday, December 29, 2005 1:52:40 PM
Why is the "value" attribute of a selectitem is an object and not a string?
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.
Satya - Friday, December 30, 2005 9:43:54 AM
JSF recommends session scope for backing beans
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
HtmlDataTable not updating HtmlSelectOneListBox model values
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.
Satya - Friday, December 30, 2005 5:15:10 PM
How does dataTable.getRowIndex() work?
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?
Satya - Friday, December 30, 2005 5:18:21 PM
How does dataTable.findComponent() work?
This takes an id of the control. But if the control is repeated, How is it finding the control on the selected row?
I haven't checked it out. So I can't say how good it is.
Satya - Wednesday, February 01, 2006 1:13:28 PM
How do you write header tags using JSF?
I can't find a clear answer on this. Would one use output text?
Satya - Saturday, March 04, 2006 8:23:08 AM
Is there any way to tell JSF how to print stack trace..
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.
Satya - Saturday, March 04, 2006 8:27:07 AM
When an exception occurs ...
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.
Satya - Saturday, March 04, 2006 8:36:10 AM
A redirect will work during pre render as well..
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.
Satya - Saturday, March 04, 2006 10:11:07 AM
Problems with forward ..
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
Satya - Saturday, March 04, 2006 12:32:49 PM
Odd problem with forward ..
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.
Satya - Saturday, March 04, 2006 2:25:14 PM
What does renderresponse do?
Examples in forums seem to suggest to call the renderresponse after a jsf dispatch. What does it really do?
Satya - Saturday, March 04, 2006 2:25:42 PM
How does JSF dispatch differ from servlet dispatch?
What is the difference ..
Satya - Saturday, March 04, 2006 2:27:10 PM
Study FacesServlet for any filter like capabilities ...
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..
Satya - Saturday, March 04, 2006 2:31:24 PM
See what enhancements are planned for the next release of JSF
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