New entrence in JSF

Hi all i am new in JSF and i have some problem by using it.
I have a problem in my project that after sign out from any account when user click the browser back button then he must go to the Login page.
i can do it by using jsp/servlet by using response.sendRedirect("url");
and in jsf by using page navigation.
" But i want to use page navigation in prerender() function of page and want to navigate user to login page. "
By using button action method i can do it but i want to do page navigation in prerender() method.
please its urgent help me
thanks alot please soon

A Filter is perfectly suitable for that. Look around at this forum or Google for "LoginFilter", it will give suitable examples.

Similar Messages

  • New-Buddy to JSF: Need Help and Info

    Hi,
    Today, I just started with the JSF book... and am finding it a little too hot and complex to handle.
    Specially, may be, because of experience with ASP.Net (also being a contributor to Mono project). Here I have some direct questions:
    1. Cannot I get away with yet another configuration file: The faces-config file?
    2. It is mandatory to have the scope of the bean defined in the config file?
    3. For any custom tag, do all the attributes and blah blah needs to be in the TLD file? Cannot it be loaded dynamically? I mean.. everytime I add a new class, I must update the TLD file. Don't you think that sucks?
    Cheers,
    Gaurav Vaish
    http://mastergaurav.org
    --------------------------

    just a note there is nothing wronge with it i just dont want any info she had on it.

  • Problem with forwarding to new page in jsf

    Hi
    I am facing a problem. I have a checkbox in my jsp page and 3 submit button. The two button works w r t check box and its woking fine. I am getting problem with the 3rd button. I want to fwd to next page once the button is clicked.
    For the check box i am using the method
    public String handleCheckbox2ValueChange(ValueChangeEvent valueChangedEvent)
    Can anyone help me in this regard. I need to fwd to the next page.
    Regards
    Rupesh

    This sounds like a simple JSF navigation that has nothing to do with the checkbox. Read the documentation and tutorials on navigation.

  • A new approach to JSF error handling?

    Hi.
    I would like to run an idea by the community to check that I am not being crazy in doing this stuff. I would appreciate any comments, criticism or ideas.
    I was thinking about JSF's error processing mechanism, specifically about how label text gets associated with an input field. So, I am talking about this kind of stuff:
    <h:outputLabel for="firstName" value='#{msgs["applicant.search.firstName"]}: ' />
    <h:inputText id="firstName" value='#{applicantDetailsBackingBean.firstName}' required=�true�/>If the value is not entered into the input field, we will get an error message saying:
    �First Name�: is required.
    So HtmlMessageRenderer has replaced the field id in the FacesMessage with the label text by using the association set up with the 'for' attribute on the label. All of this message "decoration" work happens in the RENDER phase in a centralized location. I see a couple of weaknesses in this approach
    1) It is too late for resolving label text data if the label is inside a data table
    2) JSF establishes associations between label text and the input fields by using the label components to point to their input fields. Although this seems more natural, it limits label text sources to just the label components present on the current page (or whatever is nested under them), which makes it impossible to associate input field messages with label text that does not exist on the page in its entirety.
    Let's look at a couple examples, both of which I ran into in my application:
    1) Consider a situation in which we have a dataTable where every row consists of a student name and an input field for entering their assignment mark. The validation on the input field will be restricted to valid letter grades only. If the user enters an invalid grade, we want them to see an error message of the form: +�The mark entered for <student name> is invalid�.+ Since <student name> is dependent on the row in which the error occurred, this error message is not possible to generate with bare JSF functionality.
    2) Another situation that gets us in trouble is when the label text we want in our error message is not on the page (or not in it's entirety). For example, your page could be split up into multiple parts with those parts having input fields with the same name. We would want the error message to include the page part as well as the field name. This is not easily achieved with the bare JSF functionality.
    So to generalize, any situation where a label component with a static value throughout the lifecycle is not available will cause difficulty.
    Please correct me if I am wrong on any of these points.
    Since in my app I had a lot of complicated pages to deal with, I solved my difficulties by writing a very simple framework that I called Message Decorator Framework (MDF). It enabled me to easily construct much more detailed error messages than what the standard JSF approach seems to allows for. MDF provides a mechanism to specify the label text to be applied to a validation or a conversion message by either a literal, an el expression or via an id of another ValueHolder and all of these work in data tables.
    The idea is a s such, and this is what i would like your opinion on:
    MDF provides more flexible message decoration by adapting the opposite approach to the one used by the JSF:
    1) Message decoration is decentralized. MDF wraps converters and validators on individual input fields and performs message text replacement right on the spot in the PROCESS_VALIDATIONS phase, when all of the pertinent data for resolving the label text is still available.(i.e the components in data tables would still have the correct values for the current row being validated)
    2) The label text to be used is specified by the input field, not the label. This allows the developer to reference any text value, instead of tying them to a specific label component.
    Pictures are better than words, so here is an architectural diagram:
    http://www.imagehosting.com/out.php/i1259440_ArchitectureDiagram.png
    The framework consists of two main classes, ConverterMessageDecorator and ValidatorMessageDecorator. I will just talk about the converter part, b/c the validator part is very similar but wraps a list of validators instead of one converter.
    So ConverterMessageDecorator is a JSF converter. Its purpose is to wrap the converter that is going to do the actual conversion work and decorate the FacesMessage inside ConverterException if one was thrown.
    The converter to wrap can be either determined automatically based on the type of the value reference of the input field or specified explicitly. This converter decorates the message by replacing all instances of the input field�s id with the resolved label text. The power of this approach is that not only do you get a much more flexible way to specify what the label text is (either fieldLabel or fieldLabelComponent attributes), but now data tables are no longer a problem.
    Here are some usage examples:
    <h:inputText value='#{section33SetupBackingBean.contribution.sampleGatePct}'>
       <md:decorateConverterMessage fieldLabel= '#{msgs["section.34.setup.contribution.initial.sampling.gate.max.size"]}' />
    </h:inputText>
    �etc�
    <h:inputText value='#{section33SetupBackingBean.payment.sampleGatePct}'>
       <md:decorateConverterMessage fieldLabel= '#{msgs["section.34.setup.payment.initial.sampling.gate.max.size"]}' />
    </h:inputText>The two input fields have exactly the same labels on the screen (they are in two different parts of the page), so if we used their respective labels, the error messages would look the same for these two input fields.
    More complicated example:
    <h:dataTable value="#{paymentCalcBackingBean.currentPaymentPercentages}" var="currentPercentage" >
    <h:column>
      <ops:refDataDescription id="provinceLabelTextId" refDataType="provinceStateType"
                code="${currentPercentage.programProvince.provinceStateTypeCode}" />
    </h:column>
    <h:column>
      <h:inputText value="${currentPercentage.federalPercentage}">
    <md:decorateConverterMessage fieldLabelComponent="provinceLabelTextId"  valueRequired="true" >
       <f:converter converterId="ops.PercentageConverter" />
    </md:decorateConverterMessage>
    <md:decorateValidatorMessage fieldLabelComponent="provinceLabelTextId" >
       <f:validator validatorId="ops.PercentageValidator" />
    </md:decorateValidatorMessage>
    </h:column>
    �etc�
    </h:dataTable>This would produce errors shown in this screenshot: http://www.imagehosting.com/out.php/i1259418_Example3.png
    Here is another example that shows off what you can do by referencing other ValueHolders on the page.
    The code is exactly the same as the snippet shown above, but the inputText component is referencing a text box, so the label text is going to be whatever the user types into the text box:
    http://www.imagehosting.com/out.php/i1259467_Example4.png
    Does this approach seem reasonable to people, or am I reinventing the wheel? Please let me know.
    Val

    Try restarting the DTR application and see if the problem persists.

  • Issue when opening new windows using JSF CommandLink

    Hi,
    I'm opening this thread to follow up on a topic posted on the old Sun Developer Forum: http://forums.sun.com/thread.jspa?threadID=5435239 . That post was never answered and I am having the same problem.
    To summarize (and I'll quote from the original post):
    "I am having an issue where when I open a page in a new window from a link in my primary window any button or link clicked on the primary window after that opens a new window."
    "Any other actions on the primary page should keep navigation within the primary window. This issue does not start occurring until after the desired new window is opened the first time."
    Anyone has run into this problem and found a solution?
    Marc

    This is the command link code that, once this gets called, anything else on the page will open this window again:
    <h:commandLink immediate="true" styleClass="commandLink" target="_blank" style="text-decoration:none"
                id="pdfLink action="#{Bean.method}">
         <hx:graphicImageEx id="imageEx2" styleClass="graphicImageEx" value="../images/pdfButton.gif">
         </hx:graphicImageEx>
    </h:commandLink>

  • How open new browser in JSF after executing backing bean method

    hi All,
    Can you please tell me how to open a new browser after executing action method in bean.
    I have writen one java script function, i am passing the string url which i got from the backing bean action method.
    First of all i want to execute action method then only javascript function.
    waiting for your quick reply.
    thanks & regards
    bhushanam.

    hi,
    That command link in data table. The requirement is like this:
    I have datatable, the columns are
    1) <h:selectBooleanCheckbox ....
    2) <h:commandLink ....
    requirement 1:
    if user select the boolean check box and click the command link
    then I want to execute the backing bean action method , it returns string url and show in new browser window( popup window with toolbar ).
    requirement 2:
    if user not select the boolean check box and click the command link then I want to excute the backing bean action method, it returns string url and show in the same browser ( through navigation rule we can show that page.)
    Please look the below command link code.......
    <h:commandLink id="belegnr" onmousedown="return showPopupWindowForInvoiceForGraphicImage( '#{row.importKz}', '#{row.blnChecked}', '#{InvoiceMecBoxBean.printInvoiceFilePath}');" styleClass="input" style="color:blue" value="#{row.belegnr}" action="#{InvoiceMecBoxBean.editLinkAction}"/>
    Can u please give me the idea istead of command link can we use outputlink to fullfil the requirement?. Or any suggestion please......
    Here in my case commandlink value is differenet and after action the return value is different to show in new window. that is problem here.
    thanks & regards
    bhushanam.

  • Opening a new window with JSF

    Hi all,
    I am trying to open a popup dialog. What I would really like to do is submit the form first, and then open the popup. If I just use JavaScript to open the popup, then the backing bean does not yet have the submitted values. Is there a way to force the popup to wait for the other page to finish its’ submission?
    My solution is kind of hacky, refreshing the page, and having onload make the popup.
    Grae

    caalip2 wrote:
    Hi all,
    I am trying to open a popup dialog. What I would really like to do is submit the form first, and then open the popup. If I just use JavaScript to open the popup, then the backing bean does not yet have the submitted values. Is there a way to force the popup to wait for the other page to finish its&#146; submission?
    My solution is kind of hacky, refreshing the page, and having onload make the popup.
    GraeWell forget about JSF in this respect, opening popups is completely a client thing and JSF runs on the server only.
    Is there a way to force the popup to wait for the other page to finish its’ submission?Yes, wait for the onload of the next view, which you are already doing. Alternatively you can put a <script></script> part at the very bottom of the view.

  • Problem with using newer jsf implementation

    Is it possible to use jsf-libraries from wls 10.3.1 on 10.3.0?
    Or how to use newer version of jsf implementation than JSF RI 1.2_03 on wls 10.3?
    I have also use RichFaces 3.3.1 and when I have tried to use Mojarra 1.2_12 richfaces components haven't worked correctly.
    Thanks in advance,
    Luke

    I looked there and
    "If your try to ship your webapplication with a separate JSF implementation, you are free to do this. Keep in mind, that the dependency injection mechanisms does not work with managed beans, if you do not use any of the WLS provided JSF containers.
    Declaring something like this:
    @EJB
    private MySession session;
    will lead to a java.lang.NullPointerException because of the missing depencency injection mechanisms. Would love to know any details about this. Maybe I'll find out more in the future.."
    The problem is that I use annotations like @EJB, so ...
    I'm still waiting for solution how to implement WeblogicInjectionProvider.
    Regards,
    Luke

  • Using container managed form-based security in JSF

    h1. Using container managed, form-based security in a JSF web app.
    A Practical Solution
    h2. {color:#993300}*But first, some background on the problem*{color}
    The Form components available in JSF will not let you specify the target action, everything is a post-back. When using container security, however, you have to specifically submit to the magic action j_security_check to trigger authentication. This means that the only way to do this in a JSF page is to use an HTML form tag enclosed in verbatim tags. This has the side effect that the post is not handled by JSF at all meaning you can't take advantage of normal JSF functionality such as validators, plus you have a horrible chimera of a page containing both markup and components. This screws up things like skinning. ([credit to Duncan Mills in this 2 years old article|http://groundside.com/blog/DuncanMills.php?title=j2ee_security_a_jsf_based_login_form&more=1&c=1&tb=1&pb=1]).
    In this solution, I will use a pure JSF page as the login page that the end user interacts with. This page will simply gather the input for the username and password and pass that on to a plain old jsp proxy to do the actual submit. This will avoid the whole problem of having to use verbatim tags or a mixture of JSF and JSP in the user view.
    h2. {color:#993300}*Step 1: Configure the Security Realm in the Web App Container*{color}
    What is a container? A container is basically a security framework that is implemented directly by whatever app server you are running, in my case Glassfish v2ur2 that comes with Netbeans 6.1. Your container can have multiple security realms. Each realm manages a definition of the security "*principles*" that are defined to interact with your application. A security principle is basically just a user of the system that is defined by three fields:
    - Username
    - Group
    - Password
    The security realm can be set up to authenticate using a simple file, or through JDBC, or LDAP, and more. In my case, I am using a "file" based realm. The users are statically defined directly through the app server interface. Here's how to do it (on Glassfish):
    1. Start up your app server and log into the admin interface (http://localhost:4848)
    2. Drill down into Configuration > Security > Realms.
    3. Here you will see the default realms defined on the server. Drill down into the file realm.
    4. There is no need to change any of the default settings. Click the Manage Users button.
    5. Create a new user by entering username/password.
    Note: If you enter a group name then you will be able to define permissions based on group in your app, which is much more usefull in a real app.
    I entered a group named "Users" since my app will only have one set of permissions and all users should be authenticated and treated the same.
    That way I will be able to set permissions to resources for the "Users" group that will apply to all users that have this group assigned.
    TIP: After you get everything working, you can hook it all up to JDBC instead of "file" so that you can manage your users in a database.
    h2. {color:#993300}*Step 2: Create the project*{color}
    Since I'm a newbie to JSF, I am using Netbeans 6.1 so that I can play around with all of the fancy Visual Web JavaServer Faces components and the visual designer.
    1. Start by creating a new Visual Web JSF project.
    2. Next, create a new subfolder under your web root called "secure". This is the folder that we will define a Security Constraint for in a later step, so that any user trying to access any page in this folder will be redirected to a login page to sign in, if they haven't already.
    h2. {color:#993300}*Step 3: Create the JSF and JSP files*{color}
    In my very simple project I have 3 pages set up. Create the following files using the default templates in Netbeans 6.1:
    1. login.jsp (A Visual Web JSF file)
    2. loginproxy.jspx (A plain JSPX file)
    3. secure/securepage.jsp (A Visual Web JSF file... Note that it is in the sub-folder named secure)
    Code follows for each of the files:
    h3. {color:#ff6600}*First we need to add a navigation rule to faces-config.xml:*{color}
        <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
            <navigation-case>
    <from-outcome>loginproxy</from-outcome>
    <to-view-id>/loginproxy.jspx</to-view-id>
            </navigation-case>
        </navigation-rule>
    NOTE: This navigation rule simply forwards the request to loginproxy.jspx whenever the user clicks the submit button. The button1_action() method below returns the "loginproxy" case to make this happen.
    h3. {color:#ff6600}*login.jsp -- A very simple Visual Web JSF file with two input fields and a button:*{color}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
        <jsp:directive.page
    contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"/>
        <f:view>
            <webuijsf:page
    id="page1">
    <webuijsf:html id="html1">
    <webuijsf:head id="head1">
    <webuijsf:link id="link1"
    url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
    <webuijsf:form id="form1">
    <webuijsf:textField binding="#{login.username}"
    id="username" style="position: absolute; left: 216px; top:
    96px"/>
    <webuijsf:passwordField binding="#{login.password}" id="password"
    style="left: 216px; top: 144px; position: absolute"/>
    <webuijsf:button actionExpression="#{login.button1_action}"
    id="button1" style="position: absolute; left: 216px; top:
    216px" text="GO"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>h3. *login.java -- implent the
    button1_action() method in the login.java backing bean*
        public String button1_action() {
            setValue("#{requestScope.username}",
    (String)username.getValue());
    setValue("#{requestScope.password}", (String)password.getValue());
            return "loginproxy";
        }h3. {color:#ff6600}*loginproxy.jspx -- a login proxy that the user never sees. The onload="document.forms[0].submit()" automatically submits the form as soon as it is rendered in the browser.*{color}
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    version="2.0">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-W3CDTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html"
    pageEncoding="UTF-8"/>
    <html>
    <head> <meta
    http-equiv="Content-Type" content="text/html;
    charset=UTF-8"/>
    <title>Logging in...</title>
    </head>
    <body
    onload="document.forms[0].submit()">
    <form
    action="j_security_check" method="POST">
    <input type="hidden" name="j_username"
    value="${requestScope.username}" />
    <input type="hidden" name="j_password"
    value="${requestScope.password}" />
    </form>
    </body>
    </html>
    </jsp:root>
    {code}
    h3. {color:#ff6600}*secure/securepage.jsp -- A simple JSF{color}
    target page, placed in the secure folder to test access*
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page
    contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page
    id="page1">
    <webuijsf:html id="html1">
    <webuijsf:head id="head1">
    <webuijsf:link id="link1"
    url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
    <webuijsf:form id="form1">
    <webuijsf:staticText id="staticText1" style="position:
    absolute; left: 168px; top: 144px" text="A Secure Page"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    {code}
    h2. {color:#993300}*_Step 4: Configure Declarative Security_*{color}
    This type of security is called +declarative+ because it is not configured programatically. It is configured by declaring all of the relevant parameters in the configuration files: *web.xml* and *sun-web.xml*. Once you have it configured, the container (application server and java framework) already have the implementation to make everything work for you.
    *web.xml will be used to define:*
    - Type of security - We will be using "form based". The loginpage.jsp we created will be set as both the login and error page.
    - Security Roles - The security role defined here will be mapped (in sun-web.xml) to users or groups.
    - Security Constraints - A security constraint defines the resource(s) that is being secured, and which Roles are able to authenticate to them.
    *sun-web.xml will be used to define:*
    - This is where you map a Role to the Users or Groups that are allowed to use it.
    +I know this is confusing the first time, but basically it works like this:+
    *Security Constraint for a URL* -> mapped to -> *Role* -> mapped to -> *Users & Groups*
    h3. {color:#ff6600}*web.xml -- here's the relevant section:*{color}
    {code}
    <security-constraint>
    <display-name>SecurityConstraint</display-name>
    <web-resource-collection>
    <web-resource-name>SecurePages</web-resource-name>
    <description/>
    <url-pattern>/faces/secure/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    <http-method>HEAD</http-method>
    <http-method>PUT</http-method>
    <http-method>OPTIONS</http-method>
    <http-method>TRACE</http-method>
    <http-method>DELETE</http-method>
    </web-resource-collection>
    <auth-constraint>
    <description/>
    <role-name>User</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name/>
    <form-login-config>
    <form-login-page>/faces/login.jsp</form-login-page>
    <form-error-page>/faces/login.jsp</form-error-page>
    </form-login-config>
    </login-config>
    <security-role>
    <description/>
    <role-name>User</role-name>
    </security-role>
    {code}
    h3. {color:#ff6600}*sun-web.xml -- here's the relevant section:*{color}
    {code}
    <security-role-mapping>
    <role-name>User</role-name>
    <group-name>Users</group-name>
    </security-role-mapping>
    {code}
    h3. {color:#ff6600}*Almost done!!!*{color}
    h2. {color:#993300}*_Step 5: A couple of minor "Gotcha's"_ *{color}
    h3. {color:#ff6600}*_Gotcha #1_*{color}
    You need to configure the "welcome page" in web.xml to point to faces/secure/securepage.jsp ... Note that there is *_no_* leading / ... If you put a / in there it will barf all over itself .
    h3. {color:#ff6600}*_Gotcha #2_*{color}
    Note that we set the <form-login-page> in web.xml to /faces/login.jsp ... Note the leading / ... This time, you NEED the leading slash, or the server will gag.
    *DONE!!!*
    h2. {color:#993300}*_Here's how it works:_*{color}
    1. The user requests the a page from your context (http://localhost/MyLogin/)
    2. The servlet forwards the request to the welcome page: faces/secure/securepage.jsp
    3. faces/secure/securepage.jsp has a security constraint defined, so the servlet checks to see if the user is authenticated for the session.
    4. Of course the user is not authenticated since this is the first request, so the servlet forwards the request to the login page we configured in web.xml (/faces/login.jsp).
    5. The user enters username and password and clicks a button to submit.
    6. The button's action method stores away the username and password in the request scope.
    7. The button returns "loginproxy" navigation case which tells the navigation handler to forward the request to loginproxy.jspx
    8. loginproxy.jspx renders a blank page to the user which has hidden username and password fields.
    9. The hidden username and password fields grab the username and password variables from the request scope.
    10. The loginproxy page is automatically submitted with the magic action "j_security_check"
    11. j_security_check notifies the container that authentication needs to be intercepted and handled.
    12. The container authenticates the user credentials.
    13. If the credentials fail, the container forwards the request to the login.jsp page.
    14. If the credentials pass, the container forwards the request to *+the last protected resource that was attempted.+*
    +Note the last point! I don't know how, but no matter how many times you fail authentication, the container remembers the last page that triggered authentication and once you finally succeed the container forwards your request there!!!!+
    +The user is now at the secure welcome page.+
    If you have read this far, I thank you for your time, and I seriously question your ability to ration your time pragmatically.
    Kerry Randolph

    If you want login security on your web app, this is one way to do it. (the easiest way i have seen).
    This method allows you to create a custom login form and error page using JSF.
    The container handles the actual authentication and protection of the resources based on what you declare in web.xml and sun-web.xml.
    This example uses a statically defined user/password, stored in a file, but you can also configure JDBC realm in Glassfish, so that that users can register for access and your program can store the username/passwrod in a database.
    I'm new to programming, so none of this may be a good practice, or may not be secure at all.
    I really don't know what I'm doing, but I'm learning, and this has been the easiest way that I have found to add authentication to a web app, without having to write the login modules yourself.
    Another benefit, and I think this is key ***You don't have to include any extra code in the pages that you want to protect*** The container manages this for you, based on the constraints you declare in web.xml.
    So basically you set it up to protect certain folders, then when any user tries to access pages in that folder, they are required to authenticate.
    --Kerry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • What is the best way to Process non-JSF request??

    I am engaged in new project using JSF.
    We came across the serious problem that there is no-way
    to let JSF execute action method of managed bean at the
    first request.
    That is because, JSF gets method binding information only
    from pre-displayed UIComponent, it seems impossible to
    let JSF know about the method binding info when they receive
    the request from external system, or from non-JSF pages i n the
    same system.
    I get to two ways to solve this problem.
    1. develop a custom-servlet
    The tasks of the custom servlet is,
    - receive a request from external system or non-JSF pages.
    - get managed bean and execute it's action method.
    - get next page info
    - dispatch to next page through FacesServlet
    2. use bridge-JSF page as a intermediation
    This is kind of last resort.
    As I described above, JSF can get method binding info, only
    from components of pre-displayed pages.
    So, I use bridge -JSF page to let it work as a intermediation.
    It displays nothing, just click the commandbutton automatica
    lly(by JavaScript).
    Of-cource, I prefer 1 to 2.
    Codes below are custom servlet sample , I made.
    Pls let me know if it's ok or not.
    thanks
    public class FESFacesServlet extends HttpServlet{
        public void doPost(HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
    /* init process */
            LifecycleFactory lFactory = (LifecycleFactory)
                                            FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
            Lifecycle lifecycle = lFactory
                                    .getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
            FacesContextFactory fcFactory = (FacesContextFactory)
                                                FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
            FacesContext facesContext = fcFactory.getFacesContext(getServletContext(), request, response,lifecycle);
            Application application = facesContext.getApplication();
    /* set from-view-id */
            ViewHandler viewHandler = application.getViewHandler();
            String viewId = request.getParameter("fromviewid");
            UIViewRoot view = viewHandler.createView(facesContext, viewId);
            facesContext.setViewRoot(view);
    /* find managed bean and execute it's action method */
            ManagedBeanBase managedBean = (ManagedBeanBase)application.getVariableResolver().
                                                    resolveVariable(facesContext, request.getParameter("command"));
            String outCome = managedBean.start();
    /* look for next page info */
            NavigationHandler navigationHandler = application.getNavigationHandler();
            navigationHandler.handleNavigation(facesContext, null, outCome);
    /* dispatch to next page throw FacesServlet */    
            facesContext.getExternalContext().dispatch("/faces" + facesContext.getViewRoot().getViewId());
            facesContext.release();
        public void doGet(HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
            this.doPost(request,response);
    -

    the common approach is kind of like your number 2)
    but you dont need a commandButton
    just have your first page redirect to your start page
    e.g.
    index.html
    <html>
    <head>
    <!�redirect to startPage -->
    <meta http-equiv="Refresh" content= "0; URL=index.faces"/>
    <title>Start Web Application</title>
    </head>
    <body>
    <p>Please wait for the web application to start.</p>
    </body>
    </html>

  • I cann't run my web applicaiton after upgrading to JSF 1.2

    Hi all;
    I did {color:#ff0000}ONLY {color}the following to upgarde to jsf 1.2
    replacing jsf-api.jar with the new one
    replacing jsf-impl.jar with the new one
    install Tomcat 6
    when I run the Tomcat 6.x server ( I use MyEclipse 7), no error message appears.The home pages is aslo displayed in IE wiht no problems. But, once I click on login button I get the follwoing error:
    java.lang.NoClassDefFoundError
    org.apache.{color:#ff0000}myfaces{color}.renderkit.html.util.ExtensionsPhaseListener.writeCodeBeforeBodyEnd(ExtensionsPhaseListener.java:126)
    org.apache{color:#ff0000}.myface{color}s.renderkit.html.util.ExtensionsPhaseListener.getCodeBeforeBodyEnd(ExtensionsPhaseListener.java:101)
    org.apache.{color:#ff0000}myface{color}s.renderkit.html.util.ExtensionsPhaseListener.getJavaScriptCodeAndStoreInRequest(ExtensionsPhaseListener.java:91)
    org.apache.{color:#ff0000}myface{color}s.renderkit.html.util.ExtensionsPhaseListener.afterPhase(ExtensionsPhaseListener.java:67)
    com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    I realy wonder from where I got "myfaces" is it only for apache tomcat ?! cuz I use Sun JSF implementation.
    is/are there other missing things I have to do?
    do I have to add more jar files, what about JSTL jar !
    Thx in advance to all of you (espcially BalusC)

    Hi BalusC;
    The stacktrace posted above is form IE. When I refered to Tomcat's log I found the fully qulified class name, and I post it again here:
    java.lang.NoClassDefFoundError: org/apache/commons/el/Logger
         at org.apache.myfaces.shared_tomahawk.util.ClassUtils.<clinit>(ClassUtils.java:41)
         at org.apache.myfaces.shared_tomahawk.config.MyfacesConfig.<clinit>(MyfacesConfig.java:91)
         at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.writeCodeBeforeBodyEnd(ExtensionsPhaseListener.java:126)
         at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.getCodeBeforeBodyEnd(ExtensionsPhaseListener.java:101)
         at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.getJavaScriptCodeAndStoreInRequest(ExtensionsPhaseListener.java:91)
         at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.afterPhase(ExtensionsPhaseListener.java:67)
         at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
         at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
         at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    There is something important I also noticed. When I opened the folder where tomcat resides; there was NOT the commons folder !!! isn't that strange. I reinstall Tomcat but still cann't find the commons folder, other folders like lib,webapps,conf,logs are there !! is it ok with tomcat 6 ? did I downlaod a wrong one ?? ( I downloaded it from tomcat.apache.org/download-60.cgi)
    As an attempt, I downloaded the latest jar that includes the class org.apache.commons.el.Logger , but nothing changed !
    thx again BalusC for your willing to help others.
    Edited by: Hope_Seeker on Feb 19, 2009 5:17 AM
    Edited by: Hope_Seeker on Feb 19, 2009 5:23 AM

  • Problem in JSF configuration

    I am implementing an example with JSF 1.2 and Spring 2.5. The example uses Spring managed bean. when i try to access the web page this error appears on 'javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20'
    I am a new to both JSF and Spring. Not able to know exactly what is the problem
    Complete log trace:
    ApplicationDispatcher[Stock] PWC1231: Servlet.service() for servlet Faces Servlet threw exception
    javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:842)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(App

    here are the configuration files
    WEB.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
    <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <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>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    </web-app>
    ApplicationContext.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    <bean id="stockBean"
    class="net.surya.spring.StockValueFetcher" >
    </bean>
    <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->
    </beans>
    Faces-config.XML
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config version="1.2"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <application>
    <variable-resolver>
    org.springframework.web.jsf.DelegatingVariableResolver
    </variable-resolver>
    </application>
    <managed-bean>
    <managed-bean-name>stockBean</managed-bean-name>
    <managed-bean-class>
    net.surya.spring.StockValueFetcher
    </managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <description>Navigation from the hello page.</description>
    <from-view-id>/stockInput.jsp</from-view-id>
    <navigation-case>
    <from-outcome>stockOutputSuccess</from-outcome>
    <to-view-id>/stockOutputSuccess.jsp</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>stockOutputFailure</from-outcome>
    <to-view-id>/stockOutputFailure.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>

  • Jsf data table component + print null cell

    I am using the jsf data table component and binding the column values to a backing bean.
    <h:dataTable binding="#{backing_showDifferences.dataTable2}"
    id="dataTable2">
    <h:column binding="#{backing_showDifferences.userColumn1}"/>
    <h:column binding="#{backing_showDifferences.userColumn2}"/>
    <h:column binding="#{backing_showDifferences.userColumn3}"/>
    </h:dataTable>
    - some code from my showDifferences.java
    HtmlOutputText column1Text = new HtmlOutputText();
    vb =
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{users.uclass}");
    column1Text.setValueBinding("value", vb);
    usercolumn1.getChildren().add(column1Text);
    HtmlOutputText column2Text = new HtmlOutputText();
    vb =
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{users.ue1}");
    column2Text.setValueBinding("value", vb);
    usercolumn2.getChildren().add(column2Text);
    HtmlOutputText column3Text = new HtmlOutputText();
    vb =
    FacesContext.getCurrentInstance().getApplication().createValueBinding("#{users.ue2}");
    column3Text.setValueBinding("value", vb);
    usercolumn3.getChildren().add(column3Text);
    ResultSetDataModel dataModel = new ResultSetDataModel();
    dataModel.setWrappedData(rs);
    dataTable2.setValue(dataModel);
    The raw HTML:
    <table id="form1:dataTable2" class="iuptable" border="1">
    <thead>
    <tr>
    <th scope="col">Heading 1</th>
    <th scope="col">Heading 2</th>
    <th scope="col">Heading3</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>some data in this column</td>
    <td>X</td>
    <td></td>
    </tr>
    <tr>
    <td>Some more data in this row</td>
    <td>X</td>
    <td></td>
    </tr>
    </tbody>
    </table>
    My problem is this...in the raw HTML the <td></td> tag is not formatted nicely on my table output. I have lines around my entire table and each cell within it. When the <td></td> prints there are no lines. I am new to the JSF table data component, but if I were writing some JSP or servlet code I would check that if value was null I would append an &nbsp to the <td> tag (ex. <td>&nbsp</td>) and the table would be formatted properly. The backing bean that I am binding to is pulling the data from a database table...so my sql looks like this:
    SELECT uclass, ue1, ue2 from table1; my problem is when ue1 or ue2 is a null value.
    Any ideas would be greatly appreciated!

    Hi,
    the h:dataTable belongs to the JSF Reference Implementation from Sun, not to Oracle ADF Faces. The rendering is within this component set and I suggest to report your issue on one of the SUN forums (http://forum.java.sun.com/forum.jspa?forumID=427) as we have no handle to e.g. fix an issue if it exists in the component set.
    Frank

  • Using Business Components in JSF pages

    I have several questions about using BCs in JavaServer Faces pages. I'm new to the JSF-BC development world.
    Here's what I'm trying to accomplish: a salesperson gets a call from a customer requesting a quote. The salesperson selects the URL for my RFQ form and begins filling it out. If there is an existing customer record in the company's database, the salesperson wants to be able to load customer info into the form from the database, rather than typing it all in. Reasonable enough, and probably simply enough.
    But it's kickin' my butt. I've created the domain objects (including one for the customer database, call it "CU") and the model objects (a View Object that filters out all fields but those needed on the form, an Application Module with a View Object Instance). Initially I am routing from the main form window to a dialog window where I am hosting the customer selection components, intending to return to the main window with the selection. On the dialog window I've dropped the VO and configured it to be an ADF Navigation List (which gets implemented as an af:selectOneChoice component). So far so good. The navigation to and from is working fine. The selectOneChoice list is being populated with the first range of returned records. Here's where I'm stuck.
    First of all I can't figure out how to kick the iterator into sending additional records after it's first range. You can scroll down to the end of the list in the selectOneChoice component but nothing happens after that. I know I can set the iterator's range to 0 to get all of the records dumped in at once, but that takes way too long. Any ideas?
    Secondly, when a selection is made, how do I access the selected data? I have set up a ValueChangeListener method in my dialog's backing bean that gets the NewValue() from the event object, but that value turns out to be the index into the collection of selectItems. How do I get the value of the data that shows in the list? Is that the label of the selectItem? If so, how do I access it? What I really want is to get the entire row of data represented by the returned index, but I'm lost as to how to do that. Any help would be much appreciated.
    At some point I want to let the salesperson type in a partial customer name and then retrieve only records matching the query's where clause. I see where I can create a bind variable on the view object, but am not sure how to pass the partial name value from the main form to the dialog. Currently I use an EL expression in the Action attribute of an af:selectInputText component to navigate to the dialog and I don't think I can pass parameters with that. I guess I would have to switch to using a method binding to a backing bean, eh? But even if I can get the partial name value to the dialog, how do I bind that value to the bind variable of the VO? (the VO that is already bound to the af:selectOneChoice component in the dialog.)
    And I am totally open to alternative suggestions for how to accomplish the original intention of all of this. Thanks for any guidance.
    Johnny Lee

    Thanks, Shay. That has gotten me a few steps further along. I modified my VO by creating a bind variable and modified the SQL to use this variable in it's where clause. I generated Java for my AppMod (which I hadn't done before, preferring to keep things simple) and created a method to supply a value to my VO's new bind variable. I need a little more hand-holding, though, to wire an input text field & button (or af:selectInputText?) to both the AppMod's new method AND the data component that will display the query results.
    "...drag the exposed method as a button onto a JSF page." That's easy enough, but I haven't yet figured out from the examples how to associate the value of an input component with the parameter of the AppMod's new method. It's getting late, I'm starting to see cross-eyed so I will sleep on this and take another look in the morning. Thanks for your help.
    Johnny Lee

  • JSF doesn't set values for optionally rendered fields

    When I enter a value into an optionally rendered inputText, the resulting object property is never updated, but when I remove the "rendered=" code then the objects set property works every time.
    I am using the version of JSF that downloads with the latest version of Facelets, jsf-1.1_02-b08, since the newer version isn't compatible with the version of JSP that Tomcat 5.5.x runs. I'm not sure I have the option to run any newer versions of JSF/Facelets with Tomcat 5.5.x, much trial and error previously failed to get anything newer working.
    Is this a bug with an older version of JSF, and if so how can I get a new version to deploy with the version of JSP that Tomcat 5.5.x supports?

    There is a select box tied to the backing object that I change from "no" to "yes", and it triggers a submit, and when the page reloads there is an inputText with something like rendered="#{obj.listboxvalue == 'yes'}", the tex box renders when I select the "yes" option in the list box but the values are never set in the backing object. Pretty simple stuff, but it just doesn't work.

Maybe you are looking for