Setting managed bean names dynamically

I am trying to retrieve a sessionscoped managed bean ,set different values on it then save it on the same session using
FacesContext fc = FacesContext.getCurrentInstance();
ValueBinding vb = FacesContext.getCurrentInstance.getApplication.createValueBinding("#{sessionScope.user}");
user currentuser = (user) vb.getValue(fc);
I successfully retrieve the object,
currentuser.setuser("james");
but when i change fields on it then I cant save i get an IllegalStateException.
vb.setValue(fc,currentuser);help please.

okay ladies, here is the answer. the call to facescontext /getvalue/setvalue/ must be on the same thread ie not on separate methods.i.e fetch object on variable declaration, set object on constructor.

Similar Messages

  • Dynamic managed bean names

    Hi!!
    in my application i make code that must be present in every JSP pages. For that, i put it into a separated JSP page who is included in the other JSP (using <jsp:include> tag).
    My problem is that each JSP who include the repetitive JSP, uses a different managed bean name.
    For example, the page who is included is:
    <f:subview id="navigation">
          <h:inputText value="#{name-of-bean.navigation}" styleClass="inputNav" readonly="true" />
    </f:subview>When this code is included into the pages, each page must use a different "name-of-bean".
    I try with:
    <jsp:include page="navigation.jsp">
         <jsp:param name="beanName" value="AlfaBean" />
    </jsp:include>and in the child JSP:
    <h:inputText value="#{requestScope[param.beanName].navigation}"
    styleClass="inputNav" readonly="true" />but dont work.
    I try with:
    <h:inputText value="#{resources[param.beanName].navigation}"
    styleClass="inputNav" readonly="true" />but dont work.
    Some body can help me??
    PD: Sorry my bad english!!

    JSF creates a managed bean at the time when firstly it evaluates the
    corresponding value binding expression, such as "#{AlfaBean.someProp}".
    Your JSP files include no expression including the name of the bean.
    Although it may be a very tricky code, here is a sample used for you problem:<h:outputText value="" rendered="#{AlfaBean.someProp != null}"/>
    <jsp:include page="navigation.jsp">
         <jsp:param name="beanName" value="AlfaBean" />
    </jsp:include>

  • Urgent - can't set managed bean value using a form, getting null

    I have a form with a bean -- unbelievably, I can't get the values entered into the form by the user to get stored into the bean. Everything is null... I've looked at a zillion examples, posts and compared etc...yet still can't see what is missing.
    Here's part of a trace :
    [cc]Dec-31 01:25:02 ApplicationImpl - Created bean resourceBean successfully
    [cc]Dec-31 01:25:02 ApplicationImpl - Storing resourceBean in scope request
    [cc]Dec-31 01:25:02 VariableResolverImpl - resolveVariable: Resolved variable:id=null name=null
    [cc]Dec-31 01:25:02 ValueBindingImpl - getValue Result:id=null name=null
    [cc]Dec-31 01:25:02 ValueBindingImpl - -->Returning id=null name=null
    If you have any ideas, please let me know--it seems just as I solve one JSF issue, I run into another on unexpectedly simple things.
    Here's the ResourceBean.java, the bean-config.xml and my jsp.
    package com.intalio.qa.tcm.view.beans;
    import java.util.Map;
    import javax.faces.context.FacesContext;
    import javax.faces.model.SelectItem;
    import org.apache.log4j.Logger;
    import com.intalio.qa.exceptions.DuplicateIdException;
    import com.intalio.qa.tcm.model.Resource;
    import com.intalio.qa.tcm.view.builders.ResourceBuilder;
    import com.intalio.qa.tcm.view.util.FacesUtils;
    * Resource backing bean.
    public class ResourceBean extends RootBean {
         * Class logger
         public static final Logger LOG =
              Logger.getLogger(ResourceBean.class);
    * The Resource id
         private String id = null;
         * The Resource name
         private String name = null;
    * Description
    private String description= null;
         * the resource type id associated with the Resource
         private String resourceTypeId= null;
         private static SelectItem[] resourceTypeIds = new SelectItem[] {
              new SelectItem("External Software"),
              new SelectItem("Hardware"),
              new SelectItem("Intalio Product Software"),
              new SelectItem("Machine - Dual CPU"),
              new SelectItem("Machine - CPU Single"),
              new SelectItem("Memory - UNIX"),
              new SelectItem("Memory - Windows") };
    * @return Returns the resourceTypeIds.
    public SelectItem[] getResourceTypeIds() {
    return resourceTypeIds;
    * @param resourceTypeIds The resourceTypeIds to set.
    public void setResourceTypeIds(SelectItem[] typeIds) {
    resourceTypeIds = typeIds;
         * Default constructor.
         public ResourceBean() {
    super();
    init();
         * Initializes ResourceBean.
         * @see RootBean#init()
         protected void init() {
         /*True, but I'd strongly recommend instead using:
    FacesContext fContext = FacesContext.getCurrentInstance();
    Map requestParams = fContext.getExternalContext().getRequestParameterMap();
    String companyId = (String) requestParams.get("companyID");
    The getRequest(), getSession(), and getContext() methods of ExternalContext should only be used as a last resort.*/
         * Backing bean action to update Resource.
         * @return the navigation result
         public String updateAction() {
              LOG.info("updateAction is invoked");
              try {
                   Resource Resource = ResourceBuilder.createResource(this);
                   LOG.info("ResourceId = " + Resource.getId());
              //     viewServicesManager.getResourceService().updateResource(Resource);
              } catch (Exception e) {
                   String msg = "Could not update Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error.");
                   return ActionResult.FAILURE;
              LOG.info("Resource with id of " + id + " was updated successfully.");
              return ActionResult.SUCCESS;
         * Backing bean action to create a new Resource.
         * @return the navigation result
         public String addAction() {
              try {
                   Resource resource = ResourceBuilder.createResource(this);
    LOG.info("resource created: " + resource.getName() + " with typeId = " + resource.getResourceTypeId());
                   viewServicesManager.getResourceService().saveResource(resource);
              } catch (DuplicateIdException de) {
                   String msg = "This id already exists";
                   LOG.info(msg);
                   FacesUtils.addErrorMessage(msg);
                   return ActionResult.RETRY;
              } catch (Exception e) {
                   String msg = "Could not save Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error");
                   return ActionResult.FAILURE;
              String msg = "Resource with id of " + id + " was created successfully.";
              LOG.info(msg);
              return ActionResult.SUCCESS;
         * Backing bean action to delete Resource.
         * @return the navigation result
         public String deleteAction() {
              LOG.info("deleteAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
         //          viewServicesManager.getResourceService().deleteResource(Resource);
                   //remove the ResourceList inside the cache
    //               FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not delete Resource. ";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(null, msg + "Internal Error.");
                   return ActionResult.FAILURE;
              String msg = "Resource with id of " + id + " was deleted successfully.";
              LOG.info(msg);
              FacesUtils.addInfoMessage(msg);
              return ActionResult.SUCCESS;
         public String getId() {
              return id;
         * Invoked by the JSF managed bean facility.
         * <p>
         * The id is from the request parameter.
         * If the id is not null, by using the id as the key,
         * the Resource bean is initialized.
         * @param newQueryId the query id from request parameter
         public void setId(String newId) {
              LOG.info("setId " + newId);
              id = newId;
         public String getName() {
              return name;
         public void setName(String newName) {
              name = newName;
         public String getDescription() {
              return description;
         public void setDescription(String newDescription) {
              description = newDescription;
         public String getResourceTypeId() {
              return resourceTypeId;
         public void setResourceTypeId(String newResourceTypeId) {
              resourceTypeId = newResourceTypeId;
         public String toString() {
              return "id=" + id + " name=" + name;
         <!-- view -->
         <managed-bean>
              <description>
                   Managed bean
              </description>
              <managed-bean-name>applicationBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ApplicationBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
              </managed-bean>
         <managed-bean>
              <description>
                   View service manager impl for business services
              </description>
              <managed-bean-name>viewServicesManagerBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ViewServicesManagerBean</managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <description>
                   Backing bean that contains product information.
              </description>
              <managed-bean-name>resourceBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ResourceBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
         </managed-bean>
    </faces-config>
    <f:view>
         <h:form id="createResourceForm" target="dataFrame">
              <h:outputText value="#{applicationBean.dummyVariable}" rendered="true" />
              <div align="center">
              <head>
              <link href="../../css/stylesheet.css" rel="stylesheet" type="text/css">
              <FONT color="#191970" size="4" face="Arial">Resources View</FONT>
              </head>
              <table style="margin-top: 2%" width="35%" cellpadding="10">
                   <div align="left">
                   <FONT color="#191970" size="3" face="Arial">Update Resources </FONT>
                   </div>
                   <tr>
                        <td align="center" valign="top" align="center" style="" bgcolor="white" />
                        <table>
                             <tbody>
                                  <tr>
                                       <td align="left" styleClass="header" width="100" />
                                       <td align="left" width="450" />
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Id" /></td>
                                       <td align="left" width="450"><h:inputText value="#{resourceBean.id}" id="id"/> <h:message for="id" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Name" /></td>
                                       <td align="left" width="450"><h:inputText value="#{resourceBean.name}" id="name" /> <h:message for="name" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <!--td align="right" width="100" valign="bottom"><h:outputText value="Type" /></td>
                                       <td align="left" width="550"><h:selectOneMenu>
                                            <f:selectItems value="#{resourceBean.resourceTypeIds}" />
                                       </h:selectOneMenu> <h:outputText value="#{resourceBean.resourceTypeId}" id="dresourceTypeId" /> <h:message for="resourceTypeId" styleClass="errorMessage" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText value="Description" /></td>
                                       <td align="left" width="450"><h:inputText value="#{resourceBean.description}" id="description" size="96" /> <h:message for="description" styleClass="errorMessage" /></td>
                                  </tr>
                             </tbody>
                        </table>
         </h:form>
         </td>
         <!-- END DATA FORM -->
         <!-- BEGIN COMMANDS -->
         <td width="30%" align="left" valign="top"><h:form id="buttonCommandsForm">
              <h:panelGroup id="buttons">
                   <h:panelGrid columns="1" cellspacing="1" cellpadding="2" border="0" bgcolor="white">
                        <h:commandButton value="Add" style="height:21px; width:51px;font-size:8pt; font-color: black;" action="#{resourceBean.addAction}">
                        </h:commandButton>
                        <h:commandButton id="deleteCB" value="Delete" style="height:21px; width:51px;font-size:8pt" action="#{resourceBean.deleteAction}">
                        </h:commandButton>
                        <h:commandButton id="spaceFillerButton" style="height:21px; width:51px;font-size:8pt;background-color: #ffffff;color: #ffffff;border: 0px;">
                        </h:commandButton>
                        <h:commandButton id="saveCB" value="Save" style="height:21px; width:51px;font-size:8pt" action="#{resourceBean.saveAction}">
                        </h:commandButton>
                        <h:commandButton id="updateCB" value="Update" style="height:21px; width:51px;font-size:8pt" action="#{resourceBean.updateAction}">
                        </h:commandButton>
                   </h:panelGrid>
              </h:panelGroup>
         </h:form> <!-- end buttons --></td>
         </tr>
         </table>
         <HR align="center" size="2" width="60%" />
         <!-- data table -->
         </div>
    </f:view>
    THANKS.
    -L

    I solved this.
    Since I was testing the action code only, I didn't define a navigation entry corresponding to the action string returned for this button:
    <h:commandButton value="Add" style="height:21px; width:51px;font-size:8pt; font-color: black;" action="#{resourceBean.addAction}">
    </h:commandButton>After I added a nav definition, it worked. I don't know why at this point. I suspect a key step in the lifecycle was pre-empted...someone else can probably explain why. If I get a chance to research it after I'm done with my project, I'll update this post.
    Thanks.
    -L

  • Can't set managed bean property:

    Hi,
    I am trying to experiment with JSF and I am extending an example I downloaded from the web. When I added a new secret field and extened the bean. I get the following error. I trying to resolve this problem from two days , cant figure out why I get this exception. I tried changed the property name I still get the same error. It is something to do with the bean, I am not sure why its not able to set the property, I know that the get and set methods exist in the class file. Any help would be greatly appreciated . I have pasted the bean file, faces-config.xml, and the inputname.jsp file below. Thanks a lot.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'word'.
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    javax.servlet.ServletException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'word'.
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:531)
         at org.apache.jsp.inputname_jsp._jspService(inputname_jsp.java:94)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:536)
    My JSP file is
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:loadBundle basename="demo.bundle.Messages" var="Message"/>
    <HTML>
    <HEAD> <title>Input Name Page</title> </HEAD>
    <body bgcolor="white">
         <f:view>
              <h1><h:outputText value="#{Message.inputname_header}"/></h1>
              <h:messages style="color: red"/>
         <h:form id="helloForm" >
              <h:outputText value="#{Message.prompt}"/>
              <h:inputText id="userName" value="#{GetNameBean.userName}" required="true">
                   <f:validateLength minimum="2" maximum="10"/>
              </h:inputText>
              <h:inputSecret id="word" value="#{GetNameBean.word}" required="true">
                   <f:validateLength minimum="2" maximum="10"/>
              </h:inputSecret>
              <h:commandButton id="submit" action="sayhello" value="Say Hello" />
         </h:form>
    </f:view>
    </HTML>
    My faces-config.xml is as follow
    <?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>
    <navigation-rule>
    <from-view-id>/inputname.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/greeting.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <description>
    Input Value Holder
    </description>
    <managed-bean-name>GetNameBean</managed-bean-name>
    <managed-bean-class>demo.GetNameBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>userName</property-name>
    <property-class>java.lang.String</property-class>
    <value></value>
         </managed-property>
         <managed-property>
    <property-name>word</property-name>
         <property-class>java.lang.String</property-class>
         <value></value>
         </managed-property>
    </managed-bean>
    </faces-config>
    My bean file is as follows GetNameBean.java
    package demo;
    * @author Sergey Smirnov. Exadel, Inc.
    public class GetNameBean {
    private String userName;
    private String word;
    * @return User Name
    public String getUserName() {
    return userName;
    * @param User Name
    public void setUserName(String name) {
    this.userName = name;
    * @return Password
    public String getWord() {
    return word;
    * @param Password
    public void setWord(String word) {
    this.word = word;

    Hello,
    Thanks for the reply. I used Camelcase, but its giving me the same error. I am also posting my bean files and jsp files for your reference.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'UserName'.
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    javax.faces.FacesException: org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'UserName'.
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:327)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
    LOGIN.JSP file
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <f:view>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <f:verbatim escape="false">
    <head>
    <title>My JSP 'login.jsp' starting page</title>
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <!--
         <link rel="stylesheet" type="text/css" href="styles.css">
         -->
    </head>
    </f:verbatim>
    <body>
    <h:form rendered="true" id="loginform">
    <f:verbatim escape="false"><br><br> </f:verbatim>
    <h:outputLabel for="userName" rendered="true"></h:outputLabel>
    <h:inputText id="userName" required="true" rendered="true" value="#{UserBean.userName}"></h:inputText>
    <f:verbatim escape="false"><br> </f:verbatim>
    <h:outputLabel for="password" rendered="true"></h:outputLabel>
    <h:inputSecret id="password" redisplay="false" required="true" rendered="true" value="#{UserBean.password}"></h:inputSecret>
    <h:commandButton id="submit" action="#{UserBean.loginUser}" rendered="true" value=" Submit"></h:commandButton><br><br></h:form>
    </body>
    </html>
    </f:view>
    UserBean file
    package com.jsfdemo.bean;
    import javax.faces.application.FacesMessage;
    import javax.faces.context.FacesContext;
    * @author ExterroAdmin
    public final class UserBean extends Object
         private String password;
         private String userName;
         public UserBean()
              super();
         public String getPassword()
              return password;
         public void setPassword(String password)
              this.password = password;
         public String getUserName()
              return userName;
         public void setUserName(String userName)
              this.userName = userName;
         public String loginUser() {
    if("myeclipse".equals(getUserName()) && "myeclipse".equals(getPassword()))
    return "success";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage facesMessage = new FacesMessage(
    "You have entered an invalid user name and/or password");
    facesContext.addMessage("loginForm", facesMessage);
    return "failure";
    If you need any more information, please let me know

  • Problems setting managed bean property of type Integer

    I got a problem when I use valueBinding #{param.productId} in faces-config.xml for my managed bean:
    My property 'productId' in bean Product is of type Integer, and my bean is in request scope. When I try to invoke some action on page, wich should navigate me to another view - JSF is trying to set productId for current view, and of course it is empty (""), and for the reasons given above I'm getting an error:
    javax.faces.FacesException: Can't set managed bean property: 'applicationId'.
    at com.sun.faces.config.ManagedBeanFactory.setPropertiesIntoBean(ManagedBeanFactory.java:576)
    at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:233)
    at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:256)
    ... 60 more
    Caused by: java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:489)
    at java.lang.Integer.<init>(Integer.java:609)
    at com.sun.faces.config.ManagedBeanFactory.getConvertedValueConsideringPrimitives(ManagedBeanFactory.java:855)
    at com.sun.faces.config.ManagedBeanFactory.setPropertiesIntoBean(ManagedBeanFactory.java:555)
    Should I use requestScope instead of param to have my parameter null, and not "" ?
    If so, how should I pass requestScope parameter using commandLink?

    Hi! I have a problem with setting params too. Probably my one is different.
    I have a jsp page which show a datatable, where I can see a row for each Product. If I click on its name I would navigate to another page that shows product informations, as several ecommerce sites do.
    But I can't understand what and how I must set to inform the details page on which product have to show.
    I read in this forum that it's possible to set a parameter in productBean, and then the constructor of product bean loads others fields knowing its id.
    The snippet of my faces-config.xml is:
      <managed-bean>
        <managed-bean-name>product</managed-bean-name>
        <managed-bean-class>test.backing.ProductBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
          <property-name>idToLoad</property-name>
          <property-class>java.lang.Integer</property-class>
          <value>#{param.id}</value>
        </managed-property>
      </managed-bean>It is possible? is a correct solution? and if it is, how can I do that?
    Thanks very much if someone can resolve my problem.
    Claudio.

  • Managed Bean "Name" Access  with in the Managed Bean

    Hi,
    I have faces-config.xml in which I have registered a managed bean
    and I have a base class for all the managed bean.
    The JSP's invoke the action/method defined in the base bean and I want to remove the managed bean from session upon a particular event.
    To remove the managed bean from session, as far as I know - we need to know the managed-bean-name in the faces config.
    I wanted to know if there is any way to get the name of the managed bean in the faces-config.xml at run time?.
    Thanks,

    Thanks for your recommendations. The issue that I get stuck on is how to call this method that retrives employee data. When I had the code in the constructor, it executed when I accessed the view.jsp page. Then I populated the fields from the Employee class fields. But once I create non-constructor method, how do I invoke it from my JSF page.

  • Get Managed bean name while running tests.

    hi,
    while running web application,i can able get managed name.
    but how to get managed bean name while running unit tests.
    thanks
    siva

    public String getManagedBeanName() {
        String managedBeanName = null;
        HttpServletRequest request =
            (HttpServletRequest) FacesContext
                .getCurrentInstance()
                    .getExternalContext()
                        .getRequest();
        // lookup bean in request scope
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements()) {
            String requestAttribute = (String) requestAttributeNames.nextElement();
            Object object = request.getAttribute(requestAttribute);
            if (object instanceof MyBean) {
                managedBeanName = requestAttribute;
                break;
        if (managedBeanName == null) {
            // lookup bean in session scope
            Enumeration sessionAttributeNames = request.getSession().getAttributeNames();
            while (sessionAttributeNames.hasMoreElements()) {
                String sessionAttribute = (String) sessionAttributeNames.nextElement();
                Object object = request.getSession().getAttribute(sessionAttribute);
                if (object instanceof MyBean) {
                    managedBeanName = sessionAttribute;
                    break;
        return managedBeanName;
    }Sorry, don't know other ways.

  • Data Palette not showing Managed Beans for Dynamic Web Project, JSF 2.1

    Hello.
    I have a problem in OEPE (oepe-juno-distro-win32.zip), where the Data tab in Palette shows no Managed Beans,
    even if I created them in the ManagedBeans in faces-config.xml using the Faces Config Editor.
    I have created a Dynamic Web Project with these Facets:
    Dynamic Web Module 3.0
    Java 1.7 (JDK 1.7_21)
    Java Annotation Processing Support 5.0
    JavaScript 1.0
    JavaServer Faces 2.1
    JSTL 1.2
    Oracle WebLogic Web App Extensions 12.1.1
    I am using Oracle WebLogic Server 12c 12.1.1 zip distribution for hosting the application.
    For example, I have a UserBean Managed Bean of Session scope, that has 3 String fields
    and the respective getters and setters.
    I create a "test.jspx" file, and from the Palette -> Tags tab -> JSF HTML I drag a Form into
    the new file so I can connect it to UserBean and generate a form to enter its details.
    I select the "Generate a form tag and content from data" and in the Choose Bean dialog
    there is none of my Beans.
    What could be the problem?
    Thanks in advance.
    Edited by: 997841 on Apr 30, 2013 6:09 PM
    I forgot to mention the Oracle WebLogic Web App Extensions version 12.1.1 and that also
    for JSF 2.1 the "sub-directory" Faces Configuration below the project in Project Explorer is not
    existent, as in projects created with earlier versions of JSF.

    Yes, they are both listed under the WebLogic System Libraries.
    This is the content of .classpath file when using WebLogic System Library:
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
         <classpathentry kind="src" path="src"/>
         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Oracle WebLogic Server 12c (12.1.1) JRE">
              <attributes>
                   <attribute name="owner.project.facets" value="java"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="src" path=".apt_src">
              <attributes>
                   <attribute name="optional" value="true"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.system">
              <attributes>
                   <attribute name="owner.project.facets" value="jst.web"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
         <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
         <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.shared/jstl/exact/1.2"/>
         <classpathentry kind="output" path="build/classes"/>
    </classpath>
    And this is the content when using User Library with Mojarra:
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
         <classpathentry kind="src" path="src"/>
         <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Oracle WebLogic Server 12c (12.1.1) JRE">
              <attributes>
                   <attribute name="owner.project.facets" value="java"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="src" path=".apt_src">
              <attributes>
                   <attribute name="optional" value="true"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.system">
              <attributes>
                   <attribute name="owner.project.facets" value="jst.web"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
         <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
         <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.shared/jstl/exact/1.2"/>
         <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JSF 2.1 (Mojarra 2.1.6-FCS)">
              <attributes>
                   <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
                   <attribute name="owner.project.facets" value="jst.jsf"/>
              </attributes>
         </classpathentry>
         <classpathentry kind="output" path="build/classes"/>
    </classpath>

  • Setting the role name dynamically

    Hi,
    I have defined 4 roles in the application. In the workflow navigation, i have created a notification. How can i set the role name property of the Notification message dynamically so that as soon as the control comes to that notification, all the users in that role gets the notification message?
    Thank you.

    Hello,
    Define a attribute which holds the value of one of the four defined roles.Then create some activity (with some defined function) which will select the role and assign to the attribute.
    In the notification give the performer value as attribute name.
    This will solve your purpose.
    Kind Regards,
    Kumar.

  • Dynamic Declarative Component managed bean returned null

    Hi,
    In a project from an application a DDC component is defined. This component uses a managed/backing bean with view scope.
    Using this component inside this project is working fine. This component should be used in other view controller projects, and here where the problems are.
    This project(let's call it Common) is deployed as ADF Library jar, and used in the other V-C projects.
    The big problem is that the managed bean defined for the logic of this component is not 'reacheable'.
    (Another problem is that the attribute value is not seen as its EL expression but as string, for this i found a workaround.)
    In project Common the adfc-config.xml file:
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean id="__4">
        <managed-bean-name id="__2">ExtendedShuttle</managed-bean-name>
        <managed-bean-class id="__1">com.xyz.portal.taskflow.common.extendedshuttle.ExtendedShuttle</managed-bean-class>
        <managed-bean-scope id="__3">view</managed-bean-scope>
      </managed-bean>
    </adfc-config>A part from component declaration:
          <af:table var="row" rowBandingInterval="0" id="ta"
                                  rowSelection="multiple" columnStretching="last"
                                  disableColumnReordering="true" fetchSize="-1"
                                  binding="#{viewScope.ExtendedShuttle.allItemsTable}"
                                  value="#{viewScope.ExtendedShuttle.allModel}"
                                  partialTriggers="::dc_cb5 ::dc_cb3"
                                  filterVisible="true"/>The root exception is :
    javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
    This exception is throw on com.sun.faces.application.ApplicationImpl.createComponent when *#{viewScope.ExtendedShuttle.allItemsTable}* is evaluated.
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused by: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:88)
         at com.sun.el.parser.AstValue.setValue(AstValue.java:133)
         at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:255)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:259)
    Can you help figure it out, why is not working or why the managed bean is not visible in other projects but only in the one where the component is defined?
    Thank you for your time,
    Bogdan
    ps: how can i format the source code, on this fourm?

    Hi Frank,
    Thank you for the answer.
    I must say i'm quite new with ADF technology and maybe my questions are silly.
    Here is a Quote from "Oracle Fusion Developer Guide - Building Rich Internet Application with Oracle ADF" by Frank Nimphius and Lynn Munsinger Chapter 15 page 498:
    "You build dynamic declarative components *instead* of tag library based declarative components, if component resuse is required *only within the application* that has the component defined."
    Maybe i misunderstand the meaning of application from this sentence, but i need this component in several ViewController projects from only one application (ADF application).
    Tag lib declarative component I would not like to have, since the (automtically) build process is not my responsability and it will take some time till is pinpointed, but still is a last resort.
    Anyway two things are strange:
    1. Why the component is still available in other projects(and the beans not)?
    2. Why when a binding variable (for example: of type FaceCtrlHierBinding) has the correct type in the declarative project and in the order projects is of type String and its value is the variable name?
    Example:
    <af:declarativeComponent ...
    AllItems="#{bindings.Action}"
    In project where the component is declared its value is an instance of FacesCtrlHierBinding and in the rest of the projects is of type String with value "Action".
    Once again thank you a lot,
    Bogdan

  • How to externalize JNDI name (setting JNDI name dynamically)

    Hi,
    In adapters such as ftp, database, we have to specify the jndi name. This binds the adapter to a particular jndi name. While this is certainly better than binding the adapter directly to the physical resource, I was wondering if it is possible to have even more flexibililty- setting the jndi name dynamically.
    Basically my requirement is to develop a web service that reads a file from a FTP location. I know I can externalize the filename and directory, but I am wondering how to set the ftp location dynamically.
    http://darwin-it.blogspot.com/2008/03/configuration-of-ftp-synchronous-get.html provides the answer if I wish to set the hostname, portname, user id and password.
    But I want to setup the FTP adapter in AS, and then use that JNDI name in my service. Is it possible...I am using SOA 10.1.3.3
    Regards,
    Amit

    I was able to access the files. Thanks.
    The example shows how to use the header properties in file adapter, and it sets the filename and directory elements dynamically....this I already knew.
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:PassFilePropertiesDynamicallyProcessRequest/client:FileName"/>
    <to variable="outHeader" part="outboundHeader"
    query="/ns2:OutboundFileHeaderType/ns2:fileName"/>
    </copy>
    <copy>
    <from variable="inputVariable" part="payload"
    query="/client:PassFilePropertiesDynamicallyProcessRequest/client:Location"/>
    <to variable="outHeader" part="outboundHeader"
    query="/ns2:OutboundFileHeaderType/ns2:directory"/>
    </copy>
    What I want to know is, what is the element to be added in the ftpAdapterOutboundHeader.wsdl that denotes the FTP Location (which is different from the directory).
    I guess your next update which would talk about FTP adapter, would clarify things.
    Thanks for your replies,
    Amit

  • Initialize managed bean from request parameters

    Hi:
    I thought this topic would be on the FAQ, but I couldn't find it. I am looking for a mean to initialize my managed bean from the query string. There must be something like:
    <h:form initializeBean=""true"" requestParameter=""id_author"" beanProperty=""#{author.id_author}"" action=""#{author.getFromDB}"" >
    </form>
    The url would be something like http://localhost:8080/protoJSF/showAuthor.jsf?id_author=5334
    And the getFromDB method would be something like
      Public void getFromDB()
         Statement stmt = cn.createStatement( ?SELECT * from author where id_author=? + getId_author() );
         ResultSet rs = stmt.executeQuery();
      }The only way I've found to perform something like this is to present a blank author form with a ''load data'' button: after pressing the button the user can see author's data and edit the data if she wants to. This two-step data screening is annoying, to say the least.
    There must be a better way.
    I beg for a pointer on how can I achieve the initializing of a managed bean with dynamic data.
    Regards
    Alberto Gaona

    You just have to read carefully the very fun 289 pages
    specification :-)Or, if 289 pages of JavaServer Faces is too much, you can get almost all of the same information from the JavaServer Pages 2.0 specification, or even the JSP Standard Tag Libraries specification :-).
    More seriously, the standard set of "magic" variable names that JavaServer Faces recognizes is the same as that reognized by the EL implementations in JSP and JSTL. Specifically:
    * applicationScope - Map of servlet context attributes
    * cooke - Map of cookies in this request
    * facesContext - The FacesContext instance for this request
    * header - Map of HTTP headers (max one value per header name)
    * headerValues - Map of HTTP headers (String array of values per header name)
    * initParam - Map of context initialization parameters for this webapp
    * param - Map of request parameters (max one value per parameter name)
    * paramMap - Map of request parameters (String array of values per parameter name)
    * requestScope - Map of request attributes for this request
    * sessionScope - Map of session attributes for this request
    * view - The UIViewRoot component at the base of the component tree for this view
    If you use a simple name other than the ones on this list, JavaServer Faces will search through request attributes, session attributes, and servlet context (application) attributes. If not found, it will then try to use the managed bean facility to create and configure an appropriate bean, and give it back to you.
    For extra fun, you can even create your own VariableResolver that can define additional "magic" variable names known to your application, and delegate to the standard VariableResolver for anything else.
    Craig McClanahan

  • Action / actionListener in h:commandButton with managed beans

    I have a problem with a backing bean whose method is not invoked when i click it. I've seen some posts on here about this yet, I still don't understand what I am doing wrong, if anything.
    Some context...I've modeled my application after 'jcatalog' from this article:
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html . It's simpler than the article -- I'm not using Spring/Hibernate and the persistence is the file system. For each business object (Resource), there's a backing bean (ResourceBean).
    In short, I can't get the backing bean to respond to the button event for 'Add' bound to addAction. This is just like the jcatalog 'createProduct' impl -- which doesn't use the (FacesEvent fe ) approach.
    Anyway, I would appreciate anyone's help to get past this.
    -Lorinda
    (Below are the codes...)
    Here's my beans-config.xml:
         <!-- view -->
         <managed-bean>
              <description>
                   Managed bean that is used as an application scope cache
              </description>
              <managed-bean-name>applicationBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ApplicationBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
              </managed-bean>
         <managed-bean>
              <description>
                   View service manager impl for business services
              </description>
              <managed-bean-name>viewServicesManagerBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ViewServicesManagerBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <description>
                   Backing bean that contains product information.
              </description>
              <managed-bean-name>resourceBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ResourceBean
              </managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
    (Note, the applicationBean uses view services manager. The manager is used by the ResourceBean. (It's initialized by the h:output dummy variable reference at the top of my .jsp page)). I can see the initialization in the debug trace.
    Here's the resource bean:
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.FacesException;
    import javax.faces.model.SelectItem;
    import com.intalio.qa.exceptions.DuplicateIdException;
    import com.intalio.qa.exceptions.TCMException;
    import com.intalio.qa.tcm.model.Resource;
    import com.intalio.qa.tcm.view.builders.ResourceBuilder;
    import com.intalio.qa.tcm.view.util.FacesUtils;
    * Resource backing bean.
    public class ResourceBean extends RootBean {
    * The Resource id
         private String id;
         * The Resource name
         private String name;
    * Description
    private String description;
         * the resource type id associated with the Resource
         private String resourceTypeId;
    // the resource type id associated with the Resource
    private List resourceTypeIds;
    * @return Returns the resourceTypeIds.
    public List getResourceTypeIds() {
    return resourceTypeIds;
    * @param resourceTypeIds The resourceTypeIds to set.
    public void setResourceTypeIds(List resourceTypeIds) {
    this.resourceTypeIds = resourceTypeIds;
         * Default constructor.
         public ResourceBean() {
    super();
    init();
         * Initializes ResourceBean.
         * @see RootBean#init()
         protected void init() {
              try {
                   LOG.info("ResourceBean init()");
                   if (id != null) {
                        Resource resource = viewServicesManager.getResourceService().getResourceById(id);
                        ResourceBuilder.populateResourceBean(this, resource);
              } catch (TCMException ce) {
                   String msg = "Could not retrieve Resource with id of " + id;
                   LOG.info(msg, ce);
                   throw new FacesException(msg, ce);
         * Backing bean action to update Resource.
         * @return the navigation result
         public String updateAction() {
              LOG.info("updateAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
              //     LOG.info("ResourceId = " + Resource.getId());
              //     viewServicesManager.getResourceService().updateResource(Resource);
                   //remove the ResourceList inside the cache
                   //FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not update Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error.");
                   return NavigationResults.FAILURE;
              LOG.info("Resource with id of " + id + " was updated successfully.");
              return NavigationResults.SUCCESS;
         * Backing bean action to create a new Resource.
         * @return the navigation result
         public String addAction() {
              LOG.info("addAction is invoked");
              try {
                   Resource resource = ResourceBuilder.createResource(this);
    LOG.info("between");
                   viewServicesManager.getResourceService().saveResource(resource);
              } catch (DuplicateIdException de) {
                   String msg = "This id already exists";
                   LOG.info(msg);
                   FacesUtils.addErrorMessage(msg);
                   return NavigationResults.RETRY;
              } catch (Exception e) {
                   String msg = "Could not save Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error");
                   return NavigationResults.FAILURE;
              String msg = "Resource with id of " + id + " was created successfully.";
              LOG.info(msg);
              return NavigationResults.SUCCESS;
         * Backing bean action to delete Resource.
         * @return the navigation result
         public String deleteAction() {
              LOG.info("deleteAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
         //          viewServicesManager.getResourceService().deleteResource(Resource);
                   //remove the ResourceList inside the cache
    //               FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not delete Resource. ";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(null, msg + "Internal Error.");
                   return NavigationResults.FAILURE;
              String msg = "Resource with id of " + id + " was deleted successfully.";
              LOG.info(msg);
              FacesUtils.addInfoMessage(msg);
              return NavigationResults.SUCCESS;
         public String getId() {
              return id;
         * Invoked by the JSF managed bean facility.
         * <p>
         * The id is from the request parameter.
         * If the id is not null, by using the id as the key,
         * the Resource bean is initialized.
         * @param newQueryId the query id from request parameter
         public void setId(String newId) {
              id = newId;
         public String getName() {
              return name;
         public void setName(String newName) {
              name = newName;
         public String getDescription() {
              return description;
         public void setDescription(String newDescription) {
              description = newDescription;
         public String getResourceTypeId() {
              return resourceTypeId;
         public void setResourceTypeId(String newResourceTypeId) {
              resourceTypeId = newResourceTypeId;
         public String toString() {
              return "id=" + id + " name=" + name;
    Here's the jsp:
    <f:subview id="resourcesCombinedView_subview">
         <h:form id="createResourceForm" target="dataFrame">
              <h:outputText value="#{applicationBean.dummyVariable}" rendered="true" />
              <div align="center">
              <head>
              <link href="../../css/stylesheet.css" rel="stylesheet" type="text/css">
              <FONT color="#191970" size="4" face="Arial">Resources View</FONT>
              </head>
              <table style="margin-top: 2%" width="35%" cellpadding="10">
              <div align="left">
              <FONT color="#191970" size="3" face="Arial">Update Resources </FONT>
              </div>
                   <tr>
                        <td align="center" valign="top" align="center" style="" bgcolor="white" />
                        <table>
                             <tbody>
                                  <tr>
                                       <td align="left" styleClass="header" width="100" />
                                       <td align="left" width="450"/>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Id" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.id}" id="id" required="true" /> <h:message
                                            for="id" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Name" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.name}" id="name" required="true" /> <h:message
                                            for="name" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText
                                            value="Type" /></td>
                                       <td align="left" width="550">
                                       <h:selectOneMenu
                                            value="#{resourceBean.resourceTypeId}" id="resourceTypeId">
                                            <f:selectItem itemValue="" itemLabel="Select Resource Type" />
                                            <f:selectItem itemValue="database" itemLabel="Database" />
                                            <f:selectItem itemValue="external application"
                                                 itemLabel="External Application" />
                                            <f:selectItem itemValue="internal"
                                                 itemLabel="Intalio|n3 Products" />
                                            <f:selectItem itemValue="os" itemLabel="Operating System" />
                                       </h:selectOneMenu> <h:outputText
                                            value="#{resourceBean.resourceTypeId}" /> <h:message
                                            for="resourceTypeId" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText
                                            value="Description" /></td>
                                       <td align="left" width="450"><h:inputText
                                            value="#{resourceBean.description}" id="description" size="96" />
                                       <h:message for="description" styleClass="errorMessage" /></td>
                                  </tr>
                             </tbody>
                        </table>
                        </h:form></td>
                        <!-- END DATA FORM -->
                        <!-- BEGIN COMMANDS -->
                        <td width="30%" align="left" valign="top"><h:form
                             id="buttonCommandsForm">
                             <h:panelGroup id="buttons">
                                  <h:panelGrid columns="1" cellspacing="1" cellpadding="2"
                                       border="0" bgcolor="white">
                                       <h:commandButton value="Add"
                                            style="height:21px; width:51px;font-size:8pt; font-color: black;"
                                            actionListener="#{resourceBean.addAction}">
                                       </h:commandButton>
                                       <h:commandButton id="deleteCB" value="Delete"
                                            style="height:21px; width:51px;font-size:8pt"
                                            action="#{resourceBean.deleteAction}">
                                       </h:commandButton>
                                       <h:commandButton id="spaceFillerButton" tabindex="-1"
                                            style="height:21px; width:51px;font-size:8pt;background-color: #ffffff;color: #ffffff;border: 0px;">
                                       </h:commandButton>
                                       <h:commandButton id="saveCB" value="Save"
                                            style="height:21px; width:51px;font-size:8pt"
                                            actionListener="#{resourceBean.saveAction}">
                                       </h:commandButton>
                                       <h:commandButton id="updateCB" value="Update"
                                            style="height:21px; width:51px;font-size:8pt"
                                            actionListener="#{resourceBean.updateAction}">
                                       </h:commandButton>
                                  </h:panelGrid>
                             </h:panelGroup>
                        </h:form> <!-- end buttons --></td>
                   </tr>
              </table>
              <HR align="center" size="2" width="60%" />
              <!-- data table --></div>
    </f:subview>

    Hey, anyway, have you note your jsp reference to the backing bean begins with a lowercase letter, and your backing bean class name begins with an uppercase letter?? I think that's it... I think, cause I'm too unexperienced in JSF.... Bye!!

  • Managed bean returns null on SetActionListener

    Hi,
    I'm trying to implement a filter for my table (something similar to what's done in the "OracleAS 10g R3: Oracle ADF for Forms/4GL Developers/Volume II" student guide, practice 9-5). The idea is to have a request-scoped managed bean which holds the filter value - the value is set using a SetActionListener, and later bound to a bind variable in a view with a view criteria. I have problem re-creating this in Trinidad (JDev 11 TP3, to be exact).
    I have created a request-scoped bean in adfc-config.xml (called 'ecnStatusBean'), with a managed property (named 'Status'). I am referencing it from my SetActionListener: setting #{'E'} to #{requestScope.ecnStatusBean.Status}. The reference compiles fine in the Expression Builder (it didn't before I created the managed bean), but when running and clicking the CommandLink with the SetActionListener, I get a runtime error:
    oracle.security.jazn.JAZNRuntimeException: Target Unreachable, 'ecnStatusBean' returned null
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:480)
    To make things more interesting, I tried changing the scope to session, and got a different error:
    oracle.adf.controller.ControllerException: ADFC-10001: Cannot instantiate class 'pelephone.cdma_ecn.ecn_manager.model.ecnStatusMB'.
         at oracle.adfinternal.controller.util.Utils.createAndLogFacesException(Utils.java:169)
    Am I doing a rookie's mistake? Is this a Trinidad issue? Something else?
    Thanks in advance for any help,
    Boris

    Are you sure about the reference you use here: #{requestScope.ecnStatusBean.Status}.
    Here is a simple sample of what works for me:
    The first page has this:
          <af:form binding="#{backing_start.form1}" id="form1">
            <af:inputText label="Label 1" binding="#{backing_start.inputText1}"
                          id="inputText1"/>
            <af:commandButton text="commandButton 1"
                              binding="#{backing_start.commandButton1}"
                              id="commandButton1" action="go">
              <af:setActionListener from="#{backing_start.inputText1.value}"
                                    to="#{backing_start.paramToPass}"/>
            </af:commandButton>
          </af:form>It references a bean that has this:
        private RichInputText inputText1;
        public void setInputText1(RichInputText inputText1) {
            this.inputText1 = inputText1;
        public RichInputText getInputText1() {
            return inputText1;
        public String paramToPass;
        public void setParamToPass(String paramToPass) {
            this.paramToPass = paramToPass;
        public String getParamToPass() {
            return paramToPass;
        }And then I can see it in the next page that I navigated to like this:
            <af:outputText value="the current value is #{backing_start.paramToPass}"/>In the adf-config.xml I have this:
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="start">
        <page>/start.jspx</page>
      </view>
      <view id="end">
        <page>/end.jspx</page>
      </view>
      <control-flow-rule>
        <from-activity-id>start</from-activity-id>
        <control-flow-case>
          <from-outcome>go</from-outcome>
          <to-activity-id>end</to-activity-id>
        </control-flow-case>
      </control-flow-rule>
      <managed-bean>
        <managed-bean-name>backing_start</managed-bean-name>
        <managed-bean-class>backing.backing_start</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>
    </adfc-config>

  • ADF Faces: How to get the ADF BindingContainer in a managed bean?

    Hi,
    I not sure how to get the BindingContainer instance from inside of a managed bean method. I have tried the following config, but it does not work in all situations.
      <managed-bean>
        <managed-bean-name>backing_showBooks</managed-bean-name>
        <managed-bean-class>view.backing.ShowBooks</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
          <property-name>bindingContainer</property-name>
          <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
          <value>#{bindings}</value>
        </managed-property>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1showBooks.jsp-->
      </managed-bean>When an ActionListener- method of my ShowBooks bean is called the property bindingContainer is NULL!!
    Is there a save way to get the BindingContainer in my bean??
    Any hints are welcome.
    Thanks,
    Markus

    Maybe I just need another pair of eyes but when I set this up as explained and watch it in the debugger my method public void setBindingContainer(DCBindingContainer bc) gets called but bc is null. Can anyone help?
    Thanks
    Backing Bean-
    private DCBindingContainer bindingContainer;
    public void setBindingContainer(DCBindingContainer bc) {
    this.bindingContainer = bc;
    public DCBindingContainer getBindings() {
    return bindingContainer;
    //I just threw this method on there in case I was missing something & I also
    //tried using a getBindingContainer method above but that didn;t work.
    public void setBindings(DCBindingContainer bindings) {
    this.bindingContainer = bindings;
    adf-faces.conf entry
    <managed-bean>
    <managed-bean-name>backing_VunerabilityDetail</managed-bean-name>
    <managed-bean-class>viewcontroller.backing.VunerabilityDetail</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>bindingContainer</property-name>
    <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
    <value>#{bindings}</value>
    </managed-property>
    <!--oracle-jdev-comment:managed-bean-jsp-link:1VunerabilityDetail.jsp-->
    </managed-bean>

Maybe you are looking for

  • July TechNet Guru Winners Announced

    Below are the results for last month's Guru Competition - TechNet Guru Awards, July 2014 The full version can be found here: http://blogs.technet.com/b/wikininjas/archive/2014/08/19/the-microsoft-technet-guru-awards-july-2014.aspx We can only show th

  • Iweb won't post my snippet- newbie

    Hello all- kind of new to HTML. I have searched the discussions and have tried what I think are the answers, but to no avail. I have made a "how to" video using a program called Camtasia- http://www.techsmith.com/camtasiamac/ I export the video and s

  • Messages won't connect to AIM?

    I've read the other threads I can find about this issue, but none of the advice has worked. Yesterday when I logged into my computer, Messages wouldn't connect to AIM. I was connected to VPN at the time so I didn't worry a lot  about it (it's never h

  • Script is not executed - Standard-TimeOut

    Hello, I have a problem with a script, that is debugged without mistakes, but is not executed anyway. The Script consists of the movie with a keyframe  that creates a new Instance for an Object that again creates a series of new Instances for another

  • When starting Firefox, error on missing profile comes up. Need help to get the profile

    After downloading Firefox version, can not start as error for missing profile comes up