Visual web JavaServer Faces..?

i'm developing a visual web Javaserver Faces web application and i'm new to it. i designed a login page. i navigated the page to home page but i want to validate the username and password before the proceeds. do i have to use a loginbean? if so how do i do it?

My Dataout variable contains a long string of personal information. Information such as Name, Family name, Father’s name, Date of birth, National code, Nationality.
I want to make a personal information table with above mentioned information, whereas Name, Family name, Father’s name, Date of birth, National code, Nationality will be my column values. The number of its row depends on the times that the loop is repeated.
I can make a JTable by defining an array[6] as above, but this table doesn’t appear in Visual Web javaServer faces framework. I want to be able to do what JTable does in the Table component in visual designer. Can anybody help me?
Thanks in advance

Similar Messages

  • Weblogic 10 Probs Start Web App only if using 'Visual Web JavaServer Faces'

    There is no Errormessage in Netbeans IDE when I chose 'build' or 'undeploy and deploy'.
    If I use a simple Webapplication that does not use 'Visual Web JavaServer Faces'
    the war-file that netbeans ide creates and deploys in beas autodeploy directory can be executed in the linked page: http://localhost:7001/WebApplication9/
    But if I chose the option 'Visual Web JavaServer Faces' in the web application project the whole compile and deployment process completes fine, the war-file is distributed in the autodeploy dir, but it can be deployed automatically nor manually.
    In the Bea Weblogic Administration Console I get
    Messages
    An error occurred during activation of changes, please see the log for details.
    Failed to load webapp: 'WebApplication14.war'
    javax.faces.webapp.FacesServlet
    C:\BeaWebLogic\MyDeploy\WebApplication14.war.
    Please make sure that the annotations are valid. The error is javax.faces.webapp.FacesServlet>
    whole Errorlog
    Thanks in advance.
    [LoginFilter]: LoginFilter constructed ...
    <18.04.2008 12.53 Uhr CEST> <Notice> <Log Management> <BEA-170027> <The server i
    nitialized the domain log broadcaster successfully. Log messages will now be bro
    adcasted to the domain log.>
    <18.04.2008 12.53 Uhr CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state
    changed to ADMIN>
    <18.04.2008 12.53 Uhr CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state
    changed to RESUMING>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Security> <BEA-090171> <Loading the identi
    ty certificate and private key stored under the alias DemoIdentity from the jks
    keystore file C:\BEAWEB~1\WLSERV~1.0\server\lib\DemoIdentity.jks.>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Security> <BEA-090169> <Loading trusted ce
    rtificates from the jks keystore file C:\BEAWEB~1\WLSERV~1.0\server\lib\DemoTrus
    t.jks.>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Security> <BEA-090169> <Loading trusted ce
    rtificates from the jks keystore file C:\BEAWEB~1\JROCKI~1\jre\lib\security\cace
    rts.>
    <18.04.2008 12.53 Uhr CEST> <Warning> <Server> <BEA-002611> <Hostname "localhost
    ", maps to multiple IP addresses: 164.24.95.242, 127.0.0.1>
    <18.04.2008 12.53 Uhr CEST> <Warning> <Server> <BEA-002611> <Hostname "W9G01486.
    bonn02.telekom.de", maps to multiple IP addresses: 164.24.95.242, 127.0.0.1>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Server> <BEA-002613> <Channel "Default" is
    now listening on 164.24.95.242:7001 for protocols iiop, t3, ldap, snmp, http.>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Server> <BEA-002613> <Channel "Default[1]"
    is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecu
    re" is now listening on 164.24.95.242:7002 for protocols iiops, t3s, ldaps, http
    s.>
    <18.04.2008 12.53 Uhr CEST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecu
    re[1]" is now listening on 127.0.0.1:7002 for protocols iiops, t3s, ldaps, https
    .>
    <18.04.2008 12.53 Uhr CEST> <Notice> <WebLogicServer> <BEA-000331> <Started WebL
    ogic Admin Server "examplesServer" for domain "wl_server" running in Development
    Mode>
    <18.04.2008 12.53 Uhr CEST> <Notice> <WebLogicServer> <BEA-000365> <Server state
    changed to RUNNING>
    <18.04.2008 12.53 Uhr CEST> <Notice> <WebLogicServer> <BEA-000360> <Server start
    ed in RUNNING mode>
    <18.04.2008 13.13 Uhr CEST> <Warning> <netuix> <BEA-423420> <Redirect is execute
    d in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true
    &_pageLabel=WebAppApplicationOverviewPage&WebAppApplicationOverviewPortlethandle
    =com.bea.console.handles.AppDeploymentHandle%28%22com.bea%3AName%3DWebApplicatio
    n14%2CType%3DAppDeployment%22%29.>
    <18.04.2008 13.13 Uhr CEST> <Error> <HTTP> <BEA-101371>
    <There was a failure when processing annotations for application
    C:\BeaWebLogic\MyDeploy\WebApplication14.war.
    Please make sure that the annotations are valid. The error is javax.faces.webapp.FacesServlet>
    <18.04.2008 13.13 Uhr CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in
    the execution of deployment request with ID '1208517199484' for task '0'. Error
    is: 'weblogic.application.ModuleException: Failed to load webapp: 'WebApplicati
    on14.war''
    weblogic.application.ModuleException: Failed to load webapp: 'WebApplication14.w
    ar'
    at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:311)
    at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedM
    oduleDriver.java:176)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
    leListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(Depl
    oymentCallbackFlow.java:360)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
    river.java:26)
    Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:286)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:259)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
    areClassLoader.java:54)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    Truncated. see log file for complete stacktrace
    >
    <18.04.2008 13.13 Uhr CEST> <Warning> <Deployer> <BEA-149004> <Failures were det
    ected while initiating distribute task for application 'WebApplication14'.>
    <18.04.2008 13.13 Uhr CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for m
    essage 149004
    weblogic.application.ModuleException: Failed to load webapp: 'WebApplication14.w
    ar'
    at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:311)
    at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedM
    oduleDriver.java:176)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
    leListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(Depl
    oymentCallbackFlow.java:360)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
    river.java:26)
    Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:286)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:259)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
    areClassLoader.java:54)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    Truncated. see log file for complete stacktrace
    >
    <18.04.2008 13.13 Uhr CEST> <Error> <Console> <BEA-240003> <Console encountered
    the following error weblogic.application.ModuleException: Failed to load webapp:
    'WebApplication14.war'
    at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:311)
    at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedM
    oduleDriver.java:176)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(Modu
    leListenerInvoker.java:93)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(Depl
    oymentCallbackFlow.java:360)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
    river.java:26)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(Dep
    loymentCallbackFlow.java:56)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(Dep
    loymentCallbackFlow.java:46)
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.ja
    va:615)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
    river.java:26)
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.j
    ava:191)
    at weblogic.application.internal.DeploymentStateChecker.prepare(Deployme
    ntStateChecker.java:147)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(App
    ContainerInvoker.java:61)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.cr
    eateAndPrepareContainer(ActivateOperation.java:189)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.do
    Prepare(ActivateOperation.java:87)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.pr
    epare(AbstractOperation.java:217)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploym
    entPrepare(DeploymentManager.java:719)
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploy
    mentList(DeploymentManager.java:1186)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare
    (DeploymentManager.java:248)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.pre
    pare(DeploymentServiceDispatcher.java:157)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallb
    ackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallb
    ackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallb
    ackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
    gWorkManagerImpl.java:464)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    Caused by: java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:286)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:259)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
    areClassLoader.java:54)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
    Loader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
    areClassLoader.java:35)
    at weblogic.servlet.internal.WebAnnotationProcessorImpl.processServlets(
    WebAnnotationProcessorImpl.java:214)
    at weblogic.servlet.internal.WebAnnotationProcessorImpl.processJ2eeAnnot
    ations(WebAnnotationProcessorImpl.java:197)
    at weblogic.servlet.internal.WebAnnotationProcessorImpl.processAnnotatio
    ns(WebAnnotationProcessorImpl.java:93)
    at weblogic.servlet.internal.WebAppServletContext.processAnnotations(Web
    AppServletContext.java:1270)
    at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletCo
    ntext.java:408)
    at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletCo
    ntext.java:452)
    at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:402)
    at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.ja
    va:582)
    at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:298)
    >

    Hi,
    make sure you created the parameter for the bind variable in the ViewObject. It is not enough to only add the bind parameter. It has to be created as well
    Frank

  • Need help for Visual Web application onkeydown event

    hi,
    I have create a visual web application. I have include a text field and a button in my webpage. When user press a key in the text field, i would like to change the button to enable. I try to use the keydown event to call the function in java package. However, it display error once I put the function name in my onkeydown event in jsp page. The code is shown as below.
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" 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 binding="#{RegisterProgress.page1}" id="page1">
    <webuijsf:html binding="#{RegisterProgress.html1}" id="html1">
    <webuijsf:head binding="#{RegisterProgress.head1}" id="head1">
    <webuijsf:link binding="#{RegisterProgress.link1}" id="link1" url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body binding="#{RegisterProgress.body1}" focus="form1:txtPassword1" id="body1" style="-rave-layout: grid">
    <webuijsf:form binding="#{RegisterProgress.form1}" id="form1">
    <webuijsf:button actionExpression="#{RegisterProgress.button1_action}" binding="#{RegisterProgress.button1}" id="button1"
    style="left: 71px; top: 96px; position: absolute; width: 72px" text="Next"/>
    <webuijsf:textField binding="#{RegisterProgress.txtPassword1}" id="txtPassword1" label="Password :" onKeyDown="="#{RegisterProgress.keydown}" style="left: 24px; top: 48px; position: absolute"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    Is there anybody may teach me the way to invoke the keydown event?

    Sorry,
    onKeyDown="="#{RegisterProgress.keydown}"
    should be onKeyDown=#{RegisterProgress.keydown}"
    But, that onkeyDown still can't work.
    Below is my java package:
    package usm_biologin;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.webui.jsf.component.Body;
    import com.sun.webui.jsf.component.Button;
    import com.sun.webui.jsf.component.Form;
    import com.sun.webui.jsf.component.Head;
    import com.sun.webui.jsf.component.Html;
    import com.sun.webui.jsf.component.Label;
    import com.sun.webui.jsf.component.Link;
    import com.sun.webui.jsf.component.Page;
    import com.sun.webui.jsf.component.StaticText;
    import com.sun.webui.jsf.component.TextArea;
    import com.sun.webui.jsf.component.TextField;
    import javax.faces.FacesException;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    public RegisterProgress() {
    public void init() {
    super.init();
    txtUsername1.setText(getRequestBean1().getUsername());
    txtPassword1.setText("");
    try {
    _init();
    } catch (Exception e) {
    log("RegisterProgress Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    public void preprocess() {
    public void prerender() {
    public void destroy() {
    protected RequestBean1 getRequestBean1() {
    return (RequestBean1)getBean("RequestBean1");
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1)getBean("ApplicationBean1");
    protected SessionBean1 getSessionBean1() {
    return (SessionBean1)getBean("SessionBean1");
    public String button1_action() {
    return null;
    public void keydown() {
    Any help will be appreciated.

  • Stored procedure, EJB, JPA, and JavaServer Faces

    Hi!
    I am currently working on a Web application using EJB, JPA, and JavaServer Faces. A part of the
    business logic is already stored in the database as stored procedures, so we need to call those
    procedures (instead of named queries) through a EJB and represent the data on the web tier.
    Where can I find an extensive tutorial using this technology? There is no such tutorial in the Oracle Learning Library.
    Maybe somebody can provide a link and/or example.
    Thanks in advance for your help!

    Hi,
    http://download.oracle.com/docs/cd/B10464_05/web.904/b10313/queries.htm#1135305
    For more help, see the TopLink / JPA forum
    TopLink/JPA
    Frank

  • Javaserver faces rendering ui in jdev ide

    Hello, does anyone has experienced with the JavaServer Faces release 1.1_01 FCS, that the cardemo or other jsf application doesn't render the ui components in jdev 9.0.5.2 ide, having of course "execute tags in jsp visual editor" checked ?
    I hope ORACLE will provide very soon some enhancement in the jdev IDE to help building jsp app with jsf tags.
    Thank's for anyhelp or advice

    You can get an early access preview of the ADF Faces support here:
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/index.html

  • Table display in Visual Web JSF (Project woodstock)

    Hi...
    I am trying to display a table(Quota) from a database in Visual Web JSF(project woodstock) and it works fine, as in I am able to run the project and a browser opens up dislaying the page with the date from the table. However when I try to display another table (Booking) from the same database, I am having problems. The page renders with no content(BLANK) in the browser. I am not sure why this is happening as I am using the same technique used to display content from the Quota table.
    This is my jsp code to display the Quota table ( this is the table that loads fine)
    <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">
                            <h:panelGrid id="gridPanel1" style="left: 216px; top: 216px; position: absolute">
                                <webuijsf:staticText id="staticText1" style="font-size: large" text="FACILITY"/>
                                <webuijsf:table augmentTitle="false" id="table1" title="Table" width="0">
                                    <webuijsf:tableRowGroup id="tableRowGroup1" rows="5" sourceData="#{SessionBean1.quotaArray}" sourceVar="currentRow">
                                        <webuijsf:tableColumn headerText="allocatedhours" id="tableColumn1" sort="allocatedhours">
                                            <webuijsf:staticText id="staticText2" text="#{currentRow.value['allocatedhours']}"/>
                                        </webuijsf:tableColumn>
                                        <webuijsf:tableColumn headerText="yearofStudy" id="tableColumn2" sort="yearofStudy">
                                            <webuijsf:staticText id="staticText3" text="#{currentRow.value['yearofStudy']}"/>
                                        </webuijsf:tableColumn>
                                    </webuijsf:tableRowGroup>
                                </webuijsf:table>
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>Below is the jsp code to view the Booking table ( I am just getting a blank web page when I run the project with this code).
    <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">
                            <h:panelGrid id="gridPanel1" style="left: 216px; top: 216px; position: absolute">
                                <webuijsf:staticText id="staticText1" style="font-size: large" text="FACILITY"/>
                                <webuijsf:table augmentTitle="false" id="table1" title="Table" width="0">
                                    <webuijsf:tableRowGroup id="tableRowGroup1" rows="5" sourceData="#{SessionBean1.bookingArray}" sourceVar="currentRow">
                                        <webuijsf:tableColumn headerText="bookingdate" id="tableColumn1" sort="bookingdate">
                                            <webuijsf:staticText id="staticText2" text="#{currentRow.value['bookingdate']}"/>
                                        </webuijsf:tableColumn>
                                        <webuijsf:tableColumn headerText="bookingendtime" id="tableColumn2" sort="bookingendtime">
                                            <webuijsf:staticText id="staticText3" text="#{currentRow.value['bookingendtime']}"/>
                                        </webuijsf:tableColumn>
                                    </webuijsf:tableRowGroup>
                                </webuijsf:table>
                            </h:panelGrid>
                        </webuijsf:form>
                    </webuijsf:body>
                </webuijsf:html>
            </webuijsf:page>
        </f:view>
    </jsp:root>

    Hi..guys..
    The following is the code from my 'SessionBean1'.java file.
    package com.TestApp.managedbean;
    import com.TestApp.dao.QuotaFacadeLocal;
    import com.TestApp.entity.Quota;
    import com.TestApp.dao.BookingFacadeLocal;
    import com.TestApp.entity.Booking;
    import java.util.List;
    import javax.ejb.EJB;
    import com.sun.rave.web.ui.appbase.AbstractSessionBean;
    import javax.faces.FacesException;
    * <p>Session scope data bean for your application.  Create properties
    *  here to represent cached data that should be made available across
    *  multiple HTTP requests for an individual user.</p>
    * <p>An instance of this class will be created for you automatically,
    * the first time your application evaluates a value binding expression
    * or method binding expression that references a managed bean using
    * this class.</p>
    public class SessionBean1 extends AbstractSessionBean {
        // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
         * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
         * This method is automatically generated, so any user-specified code inserted
         * here is subject to being replaced.</p>
        private void _init() throws Exception {
        // </editor-fold>
         * <p>Construct a new session data bean instance.</p>
        public SessionBean1() {
        @EJB
         private BookingFacadeLocal bookingDAO;
         private Booking[] bookingArray;
         @EJB
         private QuotaFacadeLocal quotaDAO;
         private Quota[] quotaArray;    
         * <p>This method is called when this bean is initially added to
         * session scope.  Typically, this occurs as a result of evaluating
         * a value binding or method binding expression, which utilizes the
         * managed bean facility to instantiate this bean and store it into
         * session scope.</p>
         * <p>You may customize this method to initialize and cache data values
         * or resources that are required for the lifetime of a particular
         * user session.</p>
        @Override
        public void init() {
            // Perform initializations inherited from our superclass
            super.init();
            // Perform application initialization that must complete
            // *before* managed components are initialized
            // TODO - add your own initialiation code here
            // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
            // Initialize automatically managed components
            // *Note* - this logic should NOT be modified
            try {
                _init();
            } catch (Exception e) {
                log("SessionBean1 Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Perform application initialization that must complete
            // *after* managed components are initialized
            // TODO - add your own initialization code here
         * <p>This method is called when the session containing it is about to be
         * passivated.  Typically, this occurs in a distributed servlet container
         * when the session is about to be transferred to a different
         * container instance, after which the <code>activate()</code> method
         * will be called to indicate that the transfer is complete.</p>
         * <p>You may customize this method to release references to session data
         * or resources that can not be serialized with the session itself.</p>
        @Override
        public void passivate() {
         * <p>This method is called when the session containing it was
         * reactivated.</p>
         * <p>You may customize this method to reacquire references to session
         * data or resources that could not be serialized with the
         * session itself.</p>
        @Override
        public void activate() {
         * <p>This method is called when this bean is removed from
         * session scope.  Typically, this occurs as a result of
         * the session timing out or being terminated by the application.</p>
         * <p>You may customize this method to clean up resources allocated
         * during the execution of the <code>init()</code> method, or
         * at any later time during the lifetime of the application.</p>
        @Override
        public void destroy() {
         * <p>Return a reference to the scoped data bean.</p>
         * @return reference to the scoped data bean
        protected ApplicationBean1 getApplicationBean1() {
            return (ApplicationBean1) getBean("ApplicationBean1");
        public Booking[] getBookingArray() {
             List<Booking> bookingList = bookingDAO.findAll();
             if (bookingList != null) {
                 bookingArray = bookingList.toArray(new Booking[0]);
             } else {
                 bookingArray = null;
             return bookingArray;
        public Quota[] getQuotaArray() {
             List<Quota> quotaList = quotaDAO.findAll();
             if (quotaList != null) {
                 quotaArray = quotaList.toArray(new Quota[0]);
             } else {
                 quotaArray = null;
             return quotaArray;
    }

  • Download javaServer faces business objects enterprise

    Post Author: gzofera
    CA Forum: JAVA
    hello, where do I download the javaServer face enterprise business objects?
    I am preparing an environment to start customizing web intelligence, and I lost well as to libraries, tools, etc.. which FDI sweat, ECLIPSE? NETBEANS? OTHER? WHERE THE PLUGINS FOR MEETING SET THE SDK? is there any tool that characterizes the Gazette to customize the WEBI? thanks

    Post Author: amr_foci
    CA Forum: JAVA
    i didnt know that there is something like that from Business Objects,  thats work in JSF layer
    but you can check you ESD if you've an account
    https://businessobjects.subscribenet.com/control/bobj/login
    good luck

  • JavaServer Faces or Struts - New insights anyone?

    Hello Everyone:
    JSP or Struts???!! I'm really lost.
    I've read almost every posting on the subject (on this and other forums), yet, I couldn't come with a solid conclusion (may be only inclinations).
    I've started developing my very first real-world web application which is to be up and running by December 2003. I've started reading on both Struts and JavaServer Faces so as to adopt either in that application.
    What complicates things is that I'm a new comer to the web-application world in general (let alone Struts and JSF).
    I'm inclined to use JSF (as it seems that it would be gaining more support and popularity in the near future), yet, It's still in the EA form, while Struts is matured and already popular.
    I'm in need of a Mentor's advice to direct me to the suitable technology as I regard this first project to be both an investment into my career and a robust/reliable front end to my capabilities.
    Appreciate your responses and suggestions. I also appreciate all your previous posts (especially Craig's ones), and apologize if this is an old topic.
    Kindest regards

    You must have read my posts then.
    I think JSF should be ALLWAYS compared to
    http://borland.com/products/downloads/download_csharpbuilder.html which is free (Borland C#) or
    http://www.asp.net/webmatrix/guidedtour/getstarted/tooloverview.aspx
    at all times, and people should pick the one that is cheaper in production or faster to develop on.
    It would be great to read someplace feature/cost comparison to
    http://borland.com/products/downloads/download_csharpbuilder.html
    I think if people are using EJB and/or Blueprints, they should use JSF (but wait till version 2.0?)
    If they are using Windows Servers, they should use Borland C#
    If you like JSF design and would like open source, this is most like JSF, IMO (note that it could support standards like XUL or X-Forms or WS/SOA):
    http://jakarta.apache.org/ecs
    My choice is this via SOA:
    http://examples.macromedia.com/petmarket/store.html
    Struts does have 6 books out and at least 4 places that offer training on it, and a production track record, it is an open standard, everyone (WW2, Spring, etc.) allways starts w/ "We are like Struts,... only better".
    .V

  • Selecting the JavaServer Faces in the Frameworks list diables FINISH button

    I create a new Web Application in Netbeans 5.5.1 by clicking the new project item from the FILE pull down list. I complete steps 1 and 2 and continue to step 3, FRAMEWORKS. A list of possible frameworks are listed with unchecked checkboxes. I highlight the JavaServer Faces and put a check in the checkbox. As soon as the checkbox is checked, the FINISH button becomes disabled. If I uncheck the JavaServer Faces, the FINISH button is enabled.
    What do I do to allow JavaServer Faces when creating a new web application project?
    It is not only the JavaServer Faces checkbox that disables the FINIISH button, ALL of the frameworks listed disable the FINISH button when I check them.

    Resolution: In Netbeans 5, click on the TOOLS menu pull down list. In that list, select Module Manager. A node listing of modules is displayed. Scroll down to the WEB node and click on the plus (+) to list the web modules. Uncheck the GWT4NB in the Active column. In my case it was version 1.3.4. Also uncheck the Struts Support in the active column, my version was1.3.30.1

  • EJB3 Session Bean from webproject (Netbeans 5.5.1 with Visual Web)

    I've been using J2EE 2 Sessoin Beans for some time but looking into moving into the new JavaEE EBJ3. I'm attempting to create a new enterprise project in netbeans and instead of using the web project that it creates I've created a visual web project and attached it to the enterprise project. Everything works great other than the fact that I cannot looking any Session Beans in my context. The logic that is calling the session bean lookup in the Bean of the webpage using JSF. Upon an action being called I'm attempting to lookup the session bean but I get name NameNotFound everyway I try. Below is the sample code. I'm trying injection but it doesn't appear to work from with the JSF Model Bean.
    * Page1.java
    * Created on September 1, 2007, 1:00 AM
    * Copyright smileyq
    package demo;
    import com.demo.aps.ejb.session.AuthenticationManagerLocal;
    import com.demo.aps.ejb.session.HelloWorldLocal;
    import com.demo.aps.model.AuthCredentials;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.rave.web.ui.component.Body;
    import com.sun.rave.web.ui.component.Button;
    import com.sun.rave.web.ui.component.Form;
    import com.sun.rave.web.ui.component.Head;
    import com.sun.rave.web.ui.component.Html;
    import com.sun.rave.web.ui.component.Link;
    import com.sun.rave.web.ui.component.Page;
    import com.sun.rave.web.ui.component.PasswordField;
    import com.sun.rave.web.ui.component.StaticText;
    import com.sun.rave.web.ui.component.TextField;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.ejb.EJB;
    import javax.faces.FacesException;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    * <p>Page bean that corresponds to a similarly named JSP page.  This
    * class contains component definitions (and initialization code) for
    * all components that you have defined on this page, as well as
    * lifecycle methods and event handlers where you may add behavior
    * to respond to incoming events.</p>
    public class Page1 extends AbstractPageBean
        // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
        private int __placeholder;
        @EJB private HelloWorldLocal hwLocalRef;
         * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
         * This method is automatically generated, so any user-specified code inserted
         * here is subject to being replaced.</p>
        private void _init () throws Exception
        private Page page1 = new Page ();
        public Page getPage1 ()
            return page1;
        public void setPage1 (Page p)
            this.page1 = p;
        private Html html1 = new Html ();
        public Html getHtml1 ()
            return html1;
        public void setHtml1 (Html h)
            this.html1 = h;
        private Head head1 = new Head ();
        public Head getHead1 ()
            return head1;
        public void setHead1 (Head h)
            this.head1 = h;
        private Link link1 = new Link ();
        public Link getLink1 ()
            return link1;
        public void setLink1 (Link l)
            this.link1 = l;
        private Body body1 = new Body ();
        public Body getBody1 ()
            return body1;
        public void setBody1 (Body b)
            this.body1 = b;
        private Form form1 = new Form ();
        public Form getForm1 ()
            return form1;
        public void setForm1 (Form f)
            this.form1 = f;
        private StaticText staticText1 = new StaticText ();
        public StaticText getStaticText1 ()
            return staticText1;
        public void setStaticText1 (StaticText st)
            this.staticText1 = st;
        private TextField usernameTxt = new TextField ();
        public TextField getUsernameTxt ()
            return usernameTxt;
        public void setUsernameTxt (TextField tf)
            this.usernameTxt = tf;
        private PasswordField passwordTxt = new PasswordField ();
        public PasswordField getPasswordTxt ()
            return passwordTxt;
        public void setPasswordTxt (PasswordField pf)
            this.passwordTxt = pf;
        private Button loginBtn = new Button ();
        public Button getLoginBtn ()
            return loginBtn;
        public void setLoginBtn (Button b)
            this.loginBtn = b;
        // </editor-fold>
         * <p>Construct a new Page bean instance.</p>
        public Page1 ()
         * <p>Callback method that is called whenever a page is navigated to,
         * either directly via a URL, or indirectly via page navigation.
         * Customize this method to acquire resources that will be needed
         * for event handlers and lifecycle methods, whether or not this
         * page is performing post back processing.</p>
         * <p>Note that, if the current request is a postback, the property
         * values of the components do <strong>not</strong> represent any
         * values submitted with this request.  Instead, they represent the
         * property values that were saved for this view when it was rendered.</p>
        public void init ()
            // Perform initializations inherited from our superclass
            super.init ();
            // Perform application initialization that must complete
            // *before* managed components are initialized
            // TODO - add your own initialiation code here
            // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
            // Initialize automatically managed components
            // *Note* - this logic should NOT be modified
            try
                _init ();
            catch (Exception e)
                log ("Page1 Initialization Failure", e);
                throw e instanceof FacesException ? (FacesException) e: new FacesException (e);
            // </editor-fold>
            // Perform application initialization that must complete
            // *after* managed components are initialized
            // TODO - add your own initialization code here
         * <p>Callback method that is called after the component tree has been
         * restored, but before any event processing takes place.  This method
         * will <strong>only</strong> be called on a postback request that
         * is processing a form submit.  Customize this method to allocate
         * resources that will be required in your event handlers.</p>
        public void preprocess ()
         * <p>Callback method that is called just before rendering takes place.
         * This method will <strong>only</strong> be called for the page that
         * will actually be rendered (and not, for example, on a page that
         * handled a postback and then navigated to a different page).  Customize
         * this method to allocate resources that will be required for rendering
         * this page.</p>
        public void prerender ()
         * <p>Callback method that is called after rendering is completed for
         * this request, if <code>init()</code> was called (regardless of whether
         * or not this was the page that was actually rendered).  Customize this
         * method to release resources acquired in the <code>init()</code>,
         * <code>preprocess()</code>, or <code>prerender()</code> methods (or
         * acquired during execution of an event handler).</p>
        public void destroy ()
         * <p>Return a reference to the scoped data bean.</p>
        protected SessionBean1 getSessionBean1 ()
            return (SessionBean1)getBean("SessionBean1");
         * <p>Return a reference to the scoped data bean.</p>
        protected RequestBean1 getRequestBean1 ()
            return (RequestBean1)getBean("RequestBean1");
         * <p>Return a reference to the scoped data bean.</p>
        protected ApplicationBean1 getApplicationBean1 ()
            return (ApplicationBean1)getBean("ApplicationBean1");
        public String loginBtn_action ()
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            AuthCredentials credentials = new AuthCredentials();
            credentials.setUsername (usernameTxt.getText ().toString ());
            credentials.setPassword (passwordTxt.getText().toString ());
            hwLocalRef.printHello ();
            return null;
    }

    Hi,
    I've had the very same problem with RAD.
    Try to set the Transaction attribute to SUPPORTS. With SUPPORTS the EJB method will use the same transaction as the caller.
    package hu.bme.ett.raktar.facade;
    import hu.bme.ett.raktar.ejbs.Raktar;
    import hu.bme.ett.raktar.ejbs.controller.RaktarManager;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    @Stateless
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public class RaktarListazas implements RaktarListazasLocal {
         RaktarManager rm = new RaktarManager();
         * Default constructor.
        public RaktarListazas() {
            // TODO Auto-generated constructor stub
        public Raktar getRaktar(long raktId) {
             return rm.findRaktarByRaktId(raktId);
        public void createRaktar(long raktId) {
             Raktar r = new Raktar();
             r.setRaktId(raktId);
             r.setRaktAzonosito("Y1RAK-01" + raktId);
             r.setMegnevezes("Elso raktaram");
             try {
                   rm.createRaktar(r);
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Cheers,
    Viktor

  • JavaServer Faces Unit Test Framework

    Based on my knowledge, there isn't any handy JSF Unit test tools. To facilitate UI developers and QAs to do test, I have created a prototype project to evaluate a solution.
    For a Simple JSF enabled JSP file:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
       <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" />
         <f:view>
              <h:form>
                <h:outputText value="Please input:"/>
                   <h:inputText id="input1"/>
                <br/>
                <h:outputText value="Please input a integer:"/>
                   <h:inputText style="width:50px;" converter="javax.faces.Integer"/>
                <h:commandButton value="Submit"/>     
           </h:form>
       </f:view>
    </jsp:root>writing a HttpUnit to this page is obviously difficult:
    1) Hard to pin-point the html element rendered by input1, because up-level NamingContainer h:form is missing id.
    2) More difficult to find the second InputText, because missing two ids.
    3) How to assert if the converter really works or not, we can't assert any object in PageBean by HttpUnit.
    4) Much more difficult to find those html element if there are several level NamingContainer, such as the component nested within "for-loop".
    I perfer not to write HttpUnit and seperate JUnit to PageBean, so if the follow JSP can be used in both test and production environment, work will be much easier:
    * test1.jsp
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:test="http://www.yourcompany.com/jsf/test"  xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
       <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" />
         <f:view>
            <test:parameter name="abc" value="def"/><!-- setting request parameter -->
              <h:form>
                <h:outputText value="Please input:"/>
                   <h:inputText>
                   <test:set value="hello"
    /> <!-- emulate inputing "hello" to the text box -->
                   <test:assert phase="afterUpdateModelValues" description="InputText1" var="input1" value="#{input1=='hello'}"/><!-- you can try other JSF phases as well, here var "input1" is parent jsf component -->
                      <test:assert description="InputText1" var="input1" value="#{input1=='hello'}"/>
    <!-- use default phase "afterRenderResponse", here var "input1" is HtmlElement fetched from rendered page by HttpUnit -->
                </h:inputText>
                <br/>
                <h:inputText style="width:50px;" converter="javax.faces.Integer">
                   <test:set actions="all" value="123"/>
                   <test:assert phase="afterUpdateModelValues" description="Input2 Class Name" var="input2CN" value="#{input2CN.class.name == 'java.lang.Integer'}"/>
                   <test:assert description="InputText2 value in afterRenderResponse phase" var="input2" value="#{input2=='123'}"/>
                   <test:assert description="InputText2 Style" var="input2Style" valueAttribute="style" value="#{input2Style=='width:20px;height:25px;'}"/>
                </h:inputText>
                <br/>
                <h:commandButton value="Submit">
                   <test:action description="Test Sumbit"/><!-- support multi actions -->
                </h:commandButton>     
           </h:form>
       </f:view>
    </jsp:root> For production jsp you can use normal url, http://server:port/yourapp/faces/test1.jsp, those test:xxx components won't do anything.
    For testing a single page, http://server:port/yourapp/faces/TestAction?view=/test1.jsp
    For testing more pages, http://server:port/yourapp/faces/TestAction?suite=/suite1.xml and write file:
    * suite1.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <TestSuite>
       <page>/test1.jsp</page>
       <page>/test2.jsp</page>
    </TestSuite> After running this test suite in sun jsf1.0 runtime, the result comes:
    <?xml version="1.0" encoding="UTF-8" ?>
    <Test suite="/suite1.xml">
      <Page id="/test1.jsp">
        <Action id="_id13" time="0 hour(s) 0 minute(s) 0 second(s) 31 millisecond(s)" description="Test Sumbit">
          <Assert id="_id5" description="InputText1">
             <afterUpdateModelValues pass="true" />
          </Assert>
          <Assert id="_id9" description="Input2 Class Name">
             <afterUpdateModelValues pass="true" />
          </Assert>
          <Assert id="_id6" description="InputText1">
             <afterRenderResponse pass="true" />
          </Assert>
          <Assert id="_id10" description="InputText2 value in afterRenderResponse phase">
             <afterRenderResponse pass="true" />
          </Assert>
          <Assert id="_id11" description="InputText2 Style">
             <afterRenderResponse pass="false" />
          </Assert>
        </Action>
      </Page>
      <Page id="/test2.jsp">
      </Page>
    </Test> So far, if you think this idea is good for you, you can get the src code at the end of this post.
    Furthermore, you can make improvement to this as well, such as implement concurrent and repeatable test.
    Anyway, don't expect this two days prototype is quite robust, and coding is not my day to day work either.
    If you have any questions or idea, please drop me a line: [email protected], [email protected]
    *  jsftest.tld
    <?xml version="1.0"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlib-version>1.0</tlib-version>
         <jsp-version>1.2</jsp-version>
         <short-name>test</short-name>
         <uri>http://www.yourcompany.com/jsf/test</uri>
         <display-name>JSF Test Tag Library</display-name>
         <description></description>
         <tag>
              <name>action</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.ActionTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Action</display-name>
              <description>JSF test submit action</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>description</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>     
         <tag>
              <name>assert</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.AssertTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Assert</display-name>
              <description>JSF test assertion</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>actions</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>default value is "all", means all actions, use "," as delimeter</description>
              </attribute>
              <attribute>
                   <name>phase</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>effective value can be anyone of: afterRestoreView,
                                   beforeApplyRequestValues, afterApplyRequestValues,
                                   beforeProcessValidations, afterProcessValidations,
                                   beforeUpdateModelValues,  afterUpdateModelValues,
                                   beforeInvokeApplication,  afterInvokeApplication,
                                   beforeRenderResponse,     afterRenderResponse
                                 The default value is afterRenderResponse, this assertion will be applied to HtmlElement rather than JSF Component.
                            </description>
              </attribute>
              <attribute>
                   <name>value</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>must be boolean, means pass test or not</description>
              </attribute>
              <attribute>
                   <name>var</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>variable name, used to define a request attribute which can be used in valueBinding language</description>
              </attribute>
              <attribute>
                   <name>valueAttribute</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>The default is "value".
                                         var will be bound to this attribute.
                                         var will be bound to the rendered HtmlElement if the phase="afterRenderResponse",
                                         otherwise var will be bound to parent component.
                            </description>
              </attribute>
              <attribute>
                   <name>postback</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>The default is "true".
                                         Currently only support true;
                            </description>
              </attribute>
              <attribute>
                   <name>description</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
         <tag>
              <name>parameter</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.ParameterTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Set</display-name>
              <description>JSF test request parameter setter</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>actions</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>default value is "all", means all actions, use "," as delimeter</description>
              </attribute>
              <attribute>
                   <name>name</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>value</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
         <tag>
              <name>set</name>
              <tag-class>com.yourcompany.jsf.ui.test.taglib.SetTag</tag-class>
              <body-content>empty</body-content>
              <display-name>Set</display-name>
              <description>JSF test component value setter</description>
              <attribute>
                   <name>binding</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>id</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>actions</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
                            <description>default value is "all", means all actions, use "," as delimeter</description>
              </attribute>
              <attribute>
                   <name>value</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
    </taglib>
    *  faces-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Action</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Action</component-class>
      </component>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Assert</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Assert</component-class>
      </component>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Parameter</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Parameter</component-class>
      </component>
      <component>
        <component-type>com.yourcompany.jsf.ui.test.Set</component-type>
        <component-class>com.yourcompany.jsf.ui.test.component.Set</component-class>
      </component>
      <lifecycle>
          <phase-listener>com.yourcompany.jsf.ui.test.listener.TestPhaseListener</phase-listener>
          <phase-listener>com.yourcompany.jsf.ui.test.listener.TestAssertPhaseListener</phase-listener>
      </lifecycle>
    </faces-config>
    *  TestPhaseListener.java
    package com.yourcompany.jsf.ui.test.listener;
    import java.io.InputStream;
    import java.lang.reflect.Method;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.application.ViewHandler;
    import javax.faces.component.UIComponent;
    import javax.faces.component.UIViewRoot;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    import javax.faces.event.PhaseEvent;
    import javax.faces.event.PhaseId;
    import javax.faces.event.PhaseListener;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import com.meterware.httpunit.HTMLElement;
    import com.meterware.httpunit.PostMethodWebRequest;
    import com.meterware.httpunit.WebConversation;
    import com.meterware.httpunit.WebRequest;
    import com.meterware.httpunit.WebResponse;
    import com.sun.faces.renderkit.html_basic.HtmlResponseWriter;
    import com.yourcompany.jsf.ui.component.UIIterate;
    import com.yourcompany.jsf.ui.test.component.Action;
    import com.yourcompany.jsf.ui.test.component.Assert;
    import com.yourcompany.jsf.ui.test.component.Parameter;
    import com.yourcompany.jsf.ui.test.component.Set;
    import com.yourcompany.jsf.ui.test.report.Constants;
    import com.yourcompany.jsf.ui.test.report.TestAction;
    import com.yourcompany.jsf.ui.test.report.TestAssert;
    import com.yourcompany.jsf.ui.test.report.TestPage;
    import com.yourcompany.jsf.ui.test.report.TestReport;
    import com.yourcompany.jsf.ui.util.ComponentUtil;
    public class TestPhaseListener implements PhaseListener {
         public TestPhaseListener() {
              super();
              // TODO Auto-generated constructor stub
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
         public void afterPhase(PhaseEvent event) {
              if(-1 != event.getFacesContext().getViewRoot().getViewId().indexOf("TestAction")){
                   FacesContext context =      event.getFacesContext();
                   ViewHandler vh = context.getApplication().getViewHandler();
                   HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
                   TestReport report = new TestReport();
                   request.getSession().setAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID, report);
                   String suitefile = request.getParameter("suite");
                   List pages = new ArrayList(5);
                   if(suitefile==null){
                        pages.add(request.getParameter("view"));
                   }else{
                        report.setSuiteId(suitefile);
                        try{
                             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                          factory.setValidating(false);
                          factory.setNamespaceAware(false);
                          DocumentBuilder builder = factory.newDocumentBuilder();
                          InputStream ins = context.getExternalContext().getResourceAsStream(suitefile);
                          Document doc = builder.parse(ins);
                          NodeList pageNodes = doc.getElementsByTagName("page");
                          for(int i=0; i<pageNodes.getLength(); i++){
                               pages.add(((Text)pageNodes.item(i).getFirstChild()).getData());
                        }catch(Exception e){
                             report.setException(e);
                   for(Iterator p=pages.iterator(); p.hasNext(); ){
                        String viewId = (String)p.next();
                        UIViewRoot view = vh.restoreView(context, viewId);
                        if(view==null){
                             try{
                                WebConversation wc = new WebConversation();
                                wc.putCookie("JSESSIONID", request.getSession().getId());
                                String url = getUrl(request, viewId);
                                WebResponse wr = wc.getResponse(url);
                             }catch(Exception e){
                                  report.setException(e);
                             view = vh.restoreView(context, viewId);
                        try{
                             Method doActionMethod = TestPhaseListener.class.getDeclaredMethod("doAction", new Class[]{Action.class, FacesContext.class, HttpServletRequest.class, UIViewRoot.class, String.class});
                             ComponentUtil.iterateComponent(view, Action.class, this, doActionMethod, new Object[]{context, request, view, viewId});
                        }catch(Exception e){
                             report.setException(e);
                   //render report
                   renderReport(context, report);
                   request.getSession().removeAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                   context.responseComplete();
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
         public void beforePhase(PhaseEvent event) {
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#getPhaseId()
         public PhaseId getPhaseId() {
               return PhaseId.RESTORE_VIEW;
         private String getUrl(HttpServletRequest request, String viewId){
              return request.getScheme()+"://" + request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/faces"+viewId;
         protected void doAction(Action action, FacesContext context, HttpServletRequest request, UIViewRoot view, String viewId){
              try{
                      WebConversation wc = new WebConversation();
                      wc.putCookie("JSESSIONID", request.getSession().getId());
                      String url = getUrl(request, viewId);
                      WebRequest wrq = new PostMethodWebRequest(url);
                      wrq.setParameter(Constants.TEST_VIEW_PARAMETER, viewId);
                      wrq.setParameter(Constants.TEST_ACTION_PARAMETER, action.getId());
                      //set parameters
                      try{
                           Method doParameterMethod = TestPhaseListener.class.getDeclaredMethod("doParameter", new Class[]{Parameter.class, String.class, WebRequest.class});
                           ComponentUtil.iterateComponent(view, Parameter.class, this, doParameterMethod, new Object[]{action.getId(), wrq});
                      }catch(Exception e){
                           e.printStackTrace();
                      //set attributes
                      //set values
                      try{
                           Method doSetMethod = TestPhaseListener.class.getDeclaredMethod("doSet", new Class[]{Set.class, FacesContext.class, String.class, WebRequest.class});
                           ComponentUtil.iterateComponent(view, Set.class, this, doSetMethod, new Object[]{context, action.getId(), wrq});
                      }catch(Exception e){
                           e.printStackTrace();
                      //do test actions
                      String formId = null;
                      if(formId!=null)wrq.removeParameter(formId);
                      formId = ComponentUtil.getForm(action).getClientId(context);
                      wrq.setParameter(formId, action.getParent().getClientId(context));
                      long start = System.currentTimeMillis();
                      WebResponse wrp = wc.getResponse(wrq);
                      //System.out.println(wrp.getText());
                      //do assertions
                      try{
                           Method doAssertMethod = TestPhaseListener.class.getDeclaredMethod("doAssert", new Class[]{Assert.class, FacesContext.class, HttpServletRequest.class, String.class, String.class, String.class, WebResponse.class});
                           ComponentUtil.iterateComponent(view, Assert.class, this, doAssertMethod, new Object[]{context, request, viewId, action.getId(), action.getDescription(), wrp});
                      }catch(Exception e){
                           e.printStackTrace();
                      TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                     report.getPage(viewId).getAction(action.getId()).setTime(System.currentTimeMillis()-start);
                   }catch(Exception e){
                        e.printStackTrace();
         protected void doParameter(Parameter parameter, String actionId, WebRequest wrq){
               if("all".equals(parameter.getActions()) || Arrays.asList(parameter.getActions().split(",")).contains(actionId))wrq.setParameter(parameter.getName(), parameter.getValue());
         protected void doSet(Set set, FacesContext context, String actionId, WebRequest wrq){
               if("all".equals(set.getActions()) || Arrays.asList(set.getActions().split(",")).contains(actionId))wrq.setParameter(set.getParent().getClientId(context), set.getValue());
         protected void doAssert(Assert ast, FacesContext context, HttpServletRequest request, String viewId, String actionId, String actionDescription, WebResponse wrp){
              if(("all".equals(ast.getActions()) || Arrays.asList(ast.getActions().split(",")).contains(actionId)) && "afterRenderResponse".equals(ast.getPhase())){
                    TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                    try{
                         HTMLElement targetElement = wrp.getElementWithID(ast.getParent().getClientId(context));
                         if(targetElement==null)targetElement = wrp.getElementsWithName(ast.getParent().getClientId(context))[0];
                         if(targetElement==null)request.setAttribute(ast.getVar(), null);
                         else request.setAttribute(ast.getVar(), targetElement.getAttribute(ast.getValueAttribute()));
                         //report assert
                         report.report(viewId, actionId, actionDescription, ast.getId(), ast.getDescription(), ast.getPhase(), (Boolean)ast.getValue(), null);
                    }catch(Exception e){
                         report.report(viewId, actionId, actionDescription, ast.getId(), ast.getDescription(), ast.getPhase(), Boolean.FALSE, e);
         protected void renderReport(FacesContext context, TestReport report){
              try{
                   HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse();
                   response.setContentType("text/xml; charset=UTF-8");
                   response.setHeader("Cache-Control", "no-cache");
                   ResponseWriter writer = new HtmlResponseWriter(response.getWriter(), null, null);
                   context.setResponseWriter(writer);
                   writer.startDocument();
                   writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n");
                   writer.startElement("Test", null);
                   if(report.getSuiteId()!=null)writer.writeAttribute("suite", report.getSuiteId(), null);
                   for(Iterator p=report.listPages().iterator(); p.hasNext(); ){
                        TestPage page = (TestPage)p.next();
                        writer.startElement("Page", null);
                        writer.writeAttribute("id", page.getViewId(), null);
                        for(Iterator i=page.listActions().iterator(); i.hasNext(); ){
                             TestAction action = (TestAction)i.next();
                             writer.startElement("Action", null);
                             writer.writeAttribute("id", action.getId(), null);
                             writer.writeAttribute("time", getElapsedTime(action.getTime()), null);
                             if(action.getDescription()!=null)writer.writeAttribute("description", action.getDescription(), null);
                             for(Iterator j=action.getAsserts().values().iterator(); j.hasNext(); ){
                                  TestAssert ast = (TestAssert)j.next();
                                  writer.startElement("Assert", null);
                                  writer.writeAttribute("id", ast.getId(), null);
                                  if(ast.getDescription()!=null)writer.writeAttribute("description", ast.getDescription(), null);
                                  for(Iterator k=ast.getStatus().keySet().iterator(); k.hasNext(); ){
                                       String phase = (String)k.next();
                                       writer.startElement(phase, null);
                                       writer.writeAttribute("pass", ast.getStatus().get(phase).toString(), null);
                                       writer.endElement(phase);
                                  if(ast.getException()!=null){
                                       writer.startElement("Exception", null);
                                       StackTraceElement[] stack = ast.getException().getStackTrace();
                                       for(int m=0; m<stack.length; m++){
                                            writer.write(stack[m].toString());
                                            writer.write("\r\n");
                                       writer.endElement("Exception");
                                  writer.endElement("Assert");
                             if(action.getException()!=null){
                                  writer.startElement("Exception", null);
                                  StackTraceElement[] stack = action.getException().getStackTrace();
                                  for(int m=0; m<stack.length; m++){
                                       writer.write(stack[m].toString());
                                       writer.write("\r\n");
                                  writer.endElement("Exception");
                             writer.endElement("Action");
                        if(page.getException()!=null){
                             writer.startElement("Exception", null);
                             StackTraceElement[] stack = page.getException().getStackTrace();
                             for(int m=0; m<stack.length; m++){
                                  writer.write(stack[m].toString());
                                  writer.write("\r\n");
                             writer.endElement("Exception");
                        writer.endElement("Page");
                   if(report.getException()!=null){
                        writer.startElement("Exception", null);
                        StackTraceElement[] stack = report.getException().getStackTrace();
                        for(int m=0; m<stack.length; m++){
                             writer.write(stack[m].toString());
                             writer.write("\r\n");
                        writer.endElement("Exception");
                   writer.endElement("Test");
                   writer.endDocument();
                   response.getWriter().flush();
                   response.getWriter().close();
              }catch(Exception e){
                   e.printStackTrace();
          public static String getElapsedTime(long millis) {
                   long hours, minutes, seconds, ms;
                   hours = millis / 3600000;
                   millis = millis - (hours * 3600000);
                   minutes = millis / 60000;
                   millis = millis - (minutes * 60000);
                   seconds = millis / 1000;
                   ms = millis - (seconds * 1000);
                   return hours
                        + " hour(s) "
                        + minutes
                        + " minute(s) "
                        + seconds
                        + " second(s) "
                        + ms
                        + " millisecond(s)";
    *  TestAssertPhaseListener.java
    package com.yourcompany.jsf.ui.test.listener;
    import java.lang.reflect.Method;
    import java.util.Arrays;
    import javax.faces.component.UIViewRoot;
    import javax.faces.context.FacesContext;
    import javax.faces.event.PhaseEvent;
    import javax.faces.event.PhaseId;
    import javax.faces.event.PhaseListener;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.commons.beanutils.PropertyUtils;
    import com.yourcompany.jsf.ui.test.component.Assert;
    import com.yourcompany.jsf.ui.test.report.Constants;
    import com.yourcompany.jsf.ui.test.report.TestReport;
    import com.yourcompany.jsf.ui.util.ComponentUtil;
    public class TestAssertPhaseListener implements PhaseListener {
         public TestAssertPhaseListener() {
              super();
              // TODO Auto-generated constructor stub
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
         public void afterPhase(PhaseEvent event) {
              if(PhaseId.RENDER_RESPONSE.equals(event.getPhaseId()))return;
              iterateAssert(event, false);
         /* (non-Javadoc)
          * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
         public void beforePhase(PhaseEvent event) {
              if(PhaseId.RESTORE_VIEW.equals(event.getPhaseId()))return;
              iterateAssert(event, true);
         public PhaseId getPhaseId() {
               return PhaseId.ANY_PHASE;
         protected void iterateAssert(PhaseEvent event, boolean before){
              FacesContext context = event.getFacesContext();
              HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
              String viewId = request.getParameter(Constants.TEST_VIEW_PARAMETER);
              String actionId = request.getParameter(Constants.TEST_ACTION_PARAMETER);
              if(actionId!=null){
                   TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                   UIViewRoot view = context.getViewRoot();
                   if(view==null)return;
                   try{
                        Method doAssertMethod = TestAssertPhaseListener.class.getDeclaredMethod("doAssert", new Class[]{Assert.class, FacesContext.class, HttpServletRequest.class, String.class, String.class, String.class});
                        ComponentUtil.iterateComponent(view, Assert.class, this, doAssertMethod, new Object[]{context, request, viewId, actionId, this.getAssertPhase(event.getPhaseId(), before)});
                   }catch(Exception e){
                        report.getPage(viewId).getAction(actionId).setException(e);
         protected void doAssert(Assert ast, FacesContext context, HttpServletRequest request, String viewId, String actionId, String assertPhase){
               if(("all".equals(ast.getActions()) || Arrays.asList(ast.getActions().split(",")).contains(actionId)) && assertPhase.equals(ast.getPhase())){
                    TestReport report = (TestReport)request.getSession().getAttribute(Constants.TEST_REPORT_SESSION_ATTRIBUTE_ID);
                    try{
                         request.setAttribute(ast.getVar(), PropertyUtils.getProperty(ast.getParent(), ast.getValueAttribute()));
                         //report assert
                         report.report(viewId, actionId, null, ast.getId(), ast.getDescription(), ast.getPhase(), (Boolean)ast.getValue(), null);
                    }catch(Exception e){
                         report.report(viewId, actionId, null, ast.getId(), ast.getDescription(), ast.getPhase(), Boolean.FALSE, e);
         protected String getAssertPhase(PhaseId phaseId, boolean before){
              String perfix = before ? "before" : "after";
              if(PhaseId.RESTORE_VIEW.equals(phaseId))return perfix+"RestoreView";
              if(PhaseId.APPLY_REQUEST_VALUES.equals(phaseId))return perfix+"ApplyRequestValues";
              if(PhaseId.PROCESS_VALIDATIONS.equals(phaseId))return perfix+"ProcessValidations";
              if(PhaseId.UPDATE_MODEL_VALUES.equals(phaseId))return perfix+"UpdateModelValues";
              if(PhaseId.INVOKE_APPLICATION.equals(phaseId))return perfix+"InvokeApplication";
              if(before && PhaseId.RENDER_RESPONSE.equals(phaseId))return "beforeRenderResponse";
              return "";
    *  UIIterate.java
    // This class brings "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

    To Neoreborn:
    If I understand right, Shale only provides some mock core JSF objects and extends JUnit so that you can do junit test to your java classes.
    What I concern is to test Pages(JSP) rather than java classes. I want to assert component attribute values within all lifecycle including rendered HTML script. Currently, there isn't any good tools to do this kind of JSP Unit test, am I right?

  • Visual web ICEfaces

    Hello.....
    what's plugins required for NetBeans 6.8 or 6.9 to install visual web java server faces or to install visual web ICEfaces
    thanx.

    I hope u have installed NetBenas with J2EE support.. So u must be hvaing JSf support there.
    Along with that if u want to use ICEFaces .. go to Tools->Plugins -> Avilable Plugins -> Select IceFaces

  • Netbeans visual web app design tab won't load?

    Is there anybody that has the following problem when trying to start a new visual web application in Netbeans 6? If so, could you help me fix the problem?
    Every time I try a new visual web application in Netbeans, the design tab won't load and I get an error message. I can use the Java tab and the JSP tab with no problems. It's just that the design tab says "please wait loading" but it nothing ever shows up. I can basically do everything else, except for dragging things from the palette to the design tab. The error message is:
    java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
         at org.apache.jasper.runtime.JspApplicationContextImpl.getExpressionFactory(JspApplicationContextImpl.java:80)
         at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:1595)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:419)
         at org.netbeans.modules.visualweb.jsfsupport.container.RaveConfigureListener.contextInitialized(RaveConfigureListener.java:93)
         at org.netbeans.modules.visualweb.jsfsupport.container.FacesContainer.initialize(FacesContainer.java:182)
         at org.netbeans.modules.visualweb.jsfsupport.container.FacesContainer.<init>(FacesContainer.java:130)
         at org.netbeans.modules.visualweb.insync.models.FacesModelSet.getFacesContainer(FacesModelSet.java:497)
         at org.netbeans.modules.visualweb.insync.models.FacesModelSet.<init>(FacesModelSet.java:403)
    Caused: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at org.netbeans.modules.visualweb.insync.ModelSet.createInstance(ModelSet.java:257)
    Caused: java.lang.RuntimeException
         at org.netbeans.modules.visualweb.insync.ModelSet.createInstance(ModelSet.java:261)
         at org.netbeans.modules.visualweb.insync.ModelSet.getInstance(ModelSet.java:242)
         at org.netbeans.modules.visualweb.insync.ModelSet$1.run(ModelSet.java:209)
    [catch] at java.lang.Thread.run(Thread.java:619)

    Hello,
    Adobe has provided these things:
    Creative Cloud Help/Troubleshoot download and install issues
    https://helpx.adobe.com/creative-cloud/kb/troubleshoot-cc-installation-download.html
    and: Creative Cloud Help/App doesn’t open; progress wheel spins continually
    http://helpx.adobe.com/creative-cloud/kb/creative-cloud-app-doesnt-open.html
    If necessary and for further questions click through http://helpx.adobe.com/contact.html and if "open" please use chat, I had the best experiences. I quote from Adobe's employee Preran: The chat button is activated as soon as there is an agent available to help.
    Please have a look there, good luck!
    Hans-Günter

  • Create a Site Definition file with Visual Web part in Visual Studio

    I tried to create a site definition file in Visual Studio 2013 and SharePoint 2013 by following the MSDN tutorial:
    Walkthrough: Create a Basic Site Definition Project. Near the end, I added a virtual web part control to the site definition and registered MyWebPartControls in the site definition's default ASPX page as written in the MSDN tutorial:
    Unfortunately, IntelliSense doesn't show any MyWebPartControls: tags, and VisualWebPart1 is highlighted with a warning “Element 'SMWebPart3' is not a known element. This can
    occur if there is a compilation error in the Web site, or the web.config file is missing.”
    Since it’s a warning, I went ahead to build and deploy the solution. However, when I used the site definition template to create a subsite, it returned a parser error:
    Unknown server tag 'MyWebPartControls:TestSiteDef1.VisualWebPart1'
    I spent half day researching and debugging, and finally solved the problem. The issue is on the registration line:
    <%@ Register Tagprefix="MyWebPartControls" Namespace="TestSiteDef.VisualWebPart1" Assembly="$SharePoint.Project.AssemblyFullName$" %>
    The $SharePoint.Project.AssemblyFullName$ is a replaceable parameter to provide values for SharePoint solution items whose actual values are not known at design time. Unfortunately, it does not find the right assembly name during the deployment. It should
    be replaced by the Assembly’s Strong Name. Here is how I fixed the problem step by step:
    In Solution Explorer, open the package node and double click Package.package
    Click Manifest tab in the Package.package.
    Copy the full assembly name in the package’s manifest. It may be similar like this:
              Assembly="TestSiteDef,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    Back to the site definition’s default.aspx page, replace the
                     Assembly="$SharePoint.Project.AssemblyFullName"
    in the registration line with the copied text:
    Assembly="TestSiteDef,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    Change the Namespace from
    Namespace="TestSiteDef.VisualWebPart1"
    to
    Namespace="TestSiteDef".
    The line to register the web part in a site definition file will look like this:
    <%@
    Register
    Tagprefix="MyWebPartControls"
    Namespace="TestSiteDef "
    Assembly="TestSiteDef, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
    %>
    Clean, build and deploy the solution. It works like charm. (Note: the warning message on visual web part may still exist, but you can ignore it).

    Assuming your .ascx.vb file is inheriting from the web part class, you can add the custom properties in the same manor (language syntax aside).
    Be sure to use the attributes to correctly identify and scope the properties. (see:
    http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Attributes_for_Web_Part_properties)
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com

  • How to use the feature of ajax in visual web jsf

    Hello,everyone!
    I want to use the feature of ajax in visual web jsf,but the program encountered a error. I want refresh the dropdownlist once the javascript captured the refresh message,they both behaved asynchronously. However, the textField1 rendered with a blank box,while the dropDown1 had no change. The code as follows:
    <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 binding="#{Page1.page1}" id="page1">
    <webuijsf:html binding="#{Page1.html1}" id="html1">
    <webuijsf:head binding="#{Page1.head1}" id="head1">
    <webuijsf:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
    <webuijsf:script>
    var processEvents = {                                                
    update: function(props) {
    var combo=document.getElementById("form1:dropDown1");
    combo.refresh();
    // Subscribe to refresh event.
    function refreshme(){
    var dom=document.getElementById("form1:textField1");
    dom.refresh();
    dojo.subscribe(webui.suntheme.widget.textField.event.refresh.endTopic, processEvents, "update");
    </webuijsf:script>
    </webuijsf:head>
    <webuijsf:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
    <webuijsf:form binding="#{Page1.form1}" id="form1">
    <webuijsf:textField binding="#{Page1.textField1}" id="textField1" onBlur="refreshme();"
    style="position: absolute; left: 168px; top: 144px" valueChangeListenerExpression="#{Page1.textField1_processValueChange}"/>
    <webuijsf:textField binding="#{Page1.textField2}" id="textField2" style="left: 168px; top: 96px; position: absolute"/>
    <webuijsf:dropDown binding="#{Page1.dropDown1}" id="dropDown1" items="#{Page1.dropDown1DefaultOptions.options}" style="position: absolute; left: 192px; top: 216px"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    /**********************************java******************************************/
    the function textField1_processValueChange didn't been invoked
    public void textField1_processValueChange(ValueChangeEvent event) {
    DropDown dd=getDropDown1();
    Option op1=new Option();
    String addText=(String)getTextField1().getText();
    op1.setLabel(addText);
    op1.setTooltip("tooptip");
    op1.setValue(addText);
    ArrayList <Option> l=null;
    Iterator <Option> i = dd.getListItems();
    while(i.hasNext()){
    l.add(i.next());
    l.add(op1);
    dd.setItems(l);
    thanks In advance all of your replies.

    Hi there,
    Take a look at this, will help you
    http://developers.sun.com/jscreator/learning/tutorials/2/textcompletion.html
    Thanks
    K

Maybe you are looking for