Beans Binding: JList + Converter = convertForward not called

Hello,
I'm having difficulty getting beans binding of a JList selectedElements to work with a converter.
I have a master detail generated app in Netbeans 6.1 b1. When I select the master table, my detail elements are all updating nicely except for a JList. The source property is a String (CSV) which I would like to run through a converter to turn the CSV into a List that the JList selectedElements can use. Unfortunately the converter's convertForward method is never called. If I select items in my JList, then the converter's convertReverse is called however the underlying source value is not updated. I'm obviously missing something here (either code or understanding!), could anyone please help me?
Best regards,
Chris.
The code is as follows:
Converter:
import java.util.*;
import org.jdesktop.beansbinding.Converter;
public class AdditionalFeaturesConverter extends Converter<String, List<MyEntity>>{
    @Override
    public List<MyEntity> convertForward(final String csv) {
        // will implement once I get this called ;)
        return new ArrayList<MyEntity>();
    @Override
    public String convertReverse(final List<MyEntity> selected) {
        final StringBuilder csv = new StringBuilder();
        for (MyEntity entity : selected) {
            if (csv.length() > 0) {
                csv.append(',');
            csv.append(entity.getId());
        return csv.toString();
Netbeans generated code. Note: the EL worked perfectly for the default generated String -> JTextField binding.
private void initComponents() {
       binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.additionCashbackFeatures}"), jList1, org.jdesktop.beansbinding.BeanProperty.create("selectedElements"));
        binding.setConverter(new testapp.AdditionalFeaturesConverter());
        bindingGroup.addBinding(binding);
}

There is definitely something strange going on here.
When I select from my master list, the binding does not set the selected items in the JList. In fact, the opposite is true - when I select from the master table and the newly selected property is overwritten with the last selection state of the JList.
Has anyone seen this before?

Similar Messages

  • EJB 2.0 STATEFUL SESSION BEANS -- ejbPassivate or ejbActivate is not called

    Hi,
    am using Oracle Jdevloper 9i. When i use Stateful Session beans the ejbPassivate or ejbActivated methods are not being called. What is the reason?

    Hi Arun,
    The decision of when to passivate a stateful session bean is up to a particular vendor's implementation. Typically each vendor will have some configuration that controls this decision, but it's certainly common for passivation to not take place for a given workload. Your best bet is to look at the Oracle documentation to see how the container makes its passivation decision.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Action method not called in Backing Bean

    I am using <x:inputFileUpload> tag inside my jsp page. I am trying to call action method when clicking button, but action method not called.
    My jsp page:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
    <html>
         <head>
              <title>File upload Test</title>
         </head>
         <body>
              <f:view>
                   <h:form id="form1" enctype="multipart/form-data">
                        <h:messages id="asdghsda"/>          
                        <h:outputText value="This is file upload page functionlaity POC" />                                   
                        <h:inputText value="#{fileUploadBean.textField}" />
                        <x:inputFileUpload id="myFileId" value="#{fileUploadBean.myFile}" storage="file" required="true"/>                    
                        <h:commandButton action="#{fileUploadBean.storeFile}" value="Enter here" />                    
                        <h:commandLink value="Clicl Here!!" action="#{fileUploadBean.storeFile}"></h:commandLink>
                   </h:form>               
              </f:view>
         </body>     
    </html>
    My backing bean:
    package com.beans;
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import org.apache.log4j.Logger;
    import org.apache.myfaces.custom.fileupload.UploadedFile;
    public class FileUploadBean {     
         private static Logger logger = Logger.getLogger(FileUploadBean.class.getName());
         private String textField;
         private UploadedFile myFile;
         public UploadedFile getMyFile() {
              logger.info("inside get method");
         return myFile;
         public void setMyFile(UploadedFile myFile) {
              logger.info("inside set method");
              this.myFile = myFile;
         public void storeFile(){          
              logger.info("Inside the storeFile method");
              logger.info("The text field value: " + getTextField());
              try {
                   InputStream in = new BufferedInputStream(myFile.getInputStream());
                   logger.info("The string is: " + in.read());
                   System.out.println(in.read());
                   File f = new File("D:\\share\\sample.txt");               
                   OutputStream out = new FileOutputStream(f);
                   out.write(in.read());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              logger.info("Exit from the storeFile method");
         public String getTextField() {
              return textField;
         public void setTextField(String textField) {
              this.textField = textField;
    My web.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>MyJSFProject</display-name>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>10m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    </web-app>
    Can someone help me on this? I need urgently.

    One straight and simple answer which i can give you method associated to action attributes always returns a java.lang.String Object.
    REF :
    action:
    =====
    If specified as a string: Directly specifies an outcome used by the navigation handler to determine the JSF page to load next as a result of activating the button or link If specified as a method binding: The method has this signature: String methodName(); the string represents the outcome
    source : http://horstmann.com/corejsf/jsf-tags.html#Table4_15
    therefore
    change
    public void storeFile(){
    logger.info("Inside the storeFile method");
    logger.info("The text field value: " + getTextField());
    try {
    InputStream in = new BufferedInputStream(myFile.getInputStream());
    logger.info("The string is: " + in.read());
    System.out.println(in.read());
    File f = new File("D:\\share\\sample.txt");
    OutputStream out = new FileOutputStream(f);
    out.write(in.read());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    logger.info("Exit from the storeFile method");
    }to
    public String storeFile(){
    logger.info("Inside the storeFile method");
    logger.info("The text field value: " + getTextField());
    try {
    InputStream in = new BufferedInputStream(myFile.getInputStream());
    logger.info("The string is: " + in.read());
    System.out.println(in.read());
    File f = new File("D:\\share\\sample.txt");
    OutputStream out = new FileOutputStream(f);
    out.write(in.read());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    logger.info("Exit from the storeFile method");
    return "success";
    }else where you can make use of actionlistener property in the following senario.
    but the method signature has to be void storeFile(ActionEvent ae)
    and could be use like
    <h:commandButton actionlistener="#{fileUploadBean.storeFile}" action="success" value="SUBMIT" /> Hope that might help :)
    REGARDS,
    RaHuL

  • Button action event not call in dataprovider

    hi,
    i have JSF table and it's bound to Mysql database table. when i bound the table and run it's working properly but it's button action event is not call action. when i use static jsf table then it's table action event work properly.
    my jsp code is
    <ui:table binding="#{search.search_table}" id="search_table" lite="true" selectMultipleButton="true" sortPanelToggleButton="true"
                                style="height: 70px; left: 240px; top: 240px; position: absolute; width: 600px" title="Search Text :" visible="true" width="600">
                                <ui:tableRowGroup binding="#{search.tableRowGroup1}" id="tableRowGroup1" rows="5" sourceData="#{search.srch_tablevalDataProvider1}" sourceVar="currentRow">
                                    <!--    <ui:tableColumn headerText="Script" id="tableColumn2" width="700">
                                        <ui:staticText id="staticText4" text="#{currentRow.value['search_script']}"/>
                                    </ui:tableColumn>-->
                                    <ui:tableColumn binding="#{search.tableColumn13}" headerText="Search Word" id="tableColumn13" style="#{search.columnStyle}">
                                        <ui:staticText binding="#{search.search_word1}" id="search_word1" text="#{search.search_word1}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn4}" headerText="#{search_lang['search.contentName']}" height="39" id="tableColumn4"
                                        style="#{search.columnStyle}" width="100">
                                        <ui:staticText id="staticText1" onMouseOver="play_video(this);" text="#{currentRow.value['name']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn6}" headerText="#{search_lang['search.srchTag']}" id="tableColumn6"
                                        sort="search_tags" style="#{search.columnStyle}">
                                        <ui:staticText id="staticText3" text="#{currentRow.value['search_tags']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn5}" headerText="#{search_lang['search.tpDetail']}" id="tableColumn5" style="#{search.columnStyle}">
                                        <ui:imageHyperlink action="#{search.action}" id="imageHyperlink1" text="#{currentRow.value['details']}"/>
                                        <ui:button action="#{search.button2_action}" id="button2" text="Button"/>
                                    </ui:tableColumn>
                                </ui:tableRowGroup>
                             </ui:table>and back bean code is
    public String button2_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            System.out.println("Invoke");
            return null;
        }i don't know what is problem there if found any solution, help me.

    You need to make sure that the getter of the datatable value returns exactly the same list in the apply request values phase of the form submit as it did during the render response phase of the initial display. Only this way JSF can find out which action which row was been invoked. Alternatively you can also place the data bean in session scope (which may have more impact), or use for example Tomahawk's t:dataTable with preserveDataModel attribute set to "true".

  • Command button action not calling when in subview

    i have a page that is fine when it's in it's own view...
    the command button calls a managed bean's method..
    <af:commandButton text="Call Method"
    action="#{backing_myPage.CallMethod}"
    binding="#{backing_myPage.commandButton1}"
    id="commandButton1"/>
    but when i remove the view tags and include it in a main index.jspx page
    that has a main view and a tabbed panel with showdetailitems and
    for each showdetaileditem i have a subview
    and then an include
    <f:subview id="discovered_subview" rendered="true"
    binding="#{backing_index.mypage_subview}">
    <jsp:include page="/mypage.jspx" />
    </f:subview>
    Mypage renders but the commandbutton's action is not called..
    but is called when run as a standalone page
    tia

    I also have the same problem as above. Changing the dropDown values to String does not fix it.
    I am using Netbeans Visual Web Pack.
    I drag a drop down box onto a brand new page.
    I double click the drop down box and in the processValueChange action i put System.out.println("Hello World");
    In the init() method i add 2 options to the drop down box:
    "option 1", "1"
    "option 2", "2"
    values are Strings
    I press F6 to run
    I notice that the drop down box is correctly populated.
    I change the drop down box selection
    Nothing is printed.

  • ActionMethod in CommandLink is not called whenadding Components dynamically

    I want to create a customTable component in which paginator will be a sub tag.
    <custom:customTable value="#{testBean.data}" var="current1">
    <t:panelGrid binding="#{tableBean.paginator}"></t:panelGrid>
    <t:column>
              <h:outputText value="#{current1.name}"/>
    </t:column>
    <t:column>
              <h:outputText value="#{current1.id}"/>
    </t:column>
    </custom:customTable>
    In the encode method of custom renderer ,I am writing logic to render the paginator child component.
    In encode:
    List children = getChildren(uiComponent);
              for (int j = 0, size = getChildCount(uiComponent); j < size; j++) {
                   UIComponent child = (UIComponent) children.get(j);
                   if (child.isRendered()) {
                        boolean columnRendering = child instanceof HtmlPanelGrid;
                   if(columnRendering){
                        RendererUtils.renderChild(facesContext, child);     
    In <t:panelGrid binding="#{tableBean.paginator}"></t:panelGrid> ,getPaginator returns a PanelGrid which has dynamically created CommandLinks.CommandLink has action bind to a method in the managed bean.
    HtmlCommandLink htCommLink = (HtmlCommandLink) jsfUtil
                             .createComponent(HtmlCommandLink.COMPONENT_TYPE);
                   htCommLink.getAttributes().put(IISWebConstants.VALUE_ATTRIBUTE,
                             "A");
                   htCommLink.setAction(jsfUtil.createMethodBinding("#{tableBean.createData}"));
                   htCommLink.getAttributes()
                             .put(IISWebConstants.ON_CLICK, "submit()");                    
                        htCommLink.getAttributes().put(IISWebConstants.RENDERED,
                                  Boolean.TRUE);
                        htCommLink.getAttributes().put(IISWebConstants.STYLE_CLASS,
                                  "link");
    //hpg PanelGrid instance                                   hpg.getChildren().add(htCommLink);
    Problem:Paginator is rendering,Table is rendering but if I click on the commandLink ,action method is not calling.Can any body tell me how to resolve this issue

    i have found the reason!
    after click on this command link, a listener from a SelectOneMenu tag was invoked first. very interesting, but read further to know why!
    i didn't change anything in this input tag, but the problem is that the SelectOneMenu value was initalized with an empty string, but it's first SelectItem was initalized with SelectItem("x", ""). So there was an old value "" and a new value "x" and therefore it was invoked before the action method. this took me some hours to find that out.
    in this listener i made something like this at the end:
           UIViewRoot view = context.getApplication().getViewHandler().createView(context, viewPath);
           view.setViewId(viewPath);
           context.setViewRoot(view);
           context.renderResponse();so it's clear, why it didn't execute the action method.
    so as a global rule, check all your listeners (breakpoints!) when you have a similar problem!

  • Custom converter - parameters not always work

    Hi,
    I have a web page, which part looks like this:
    <a4j:repeat value="#{list}" var="art">
        <h:outputText escape="false" value="#{art.content}">
            <my:substring length="125" />
        </h:outputText>
    </a4j:repeat><my:substring /> is my custom converter, with parameter length (it has setLength, getLength methods).
    Content of #{list} depends on parameter set in page bean. There are also links on the page, which change this parameter and refresh the page:
    <h:commandLink value="#{paginator.currentPage + 2} ">
        <f:setPropertyActionListener target="#{paginator.currentPage}" value="#{paginator.currentPage + 2}"/>
    </h:commandLink>After clicking link, page content changes as it should, but converter works with its default "length" parameter. My setting (length="125") is not used. There is new converter instance created, but setLength method is not called (I checked it by debug).
    Anybody knows how to solve this problem?
    Best regards
    Pawel Stawicki

    This article might provide an interesting read: [http://balusc.blogspot.com/2007/09/objects-in-hselectonemenu.html]

  • ADF VO Row Fetch Range Issue: Action is not called after 10th row

    Hi People!
    I am working with an Application here in which one page has a table based on a view object. This table has range navigation, and the VO configuration for Tuning is to fetch rows in batches of 1000, all in one fetch. Now, i have a single selection configured in this table, and also a button on the <tableActions> facet which calls a method on the backing bean.
    The problem is, for the first 10 rows of this table, the method is called (seen through the debugger), but when we move the selection to the 11th row or further, the page only refreshes but does not call the method.
    This is not a problem with the data, because we tried two other approaches:
    1) removed the range navigation and shown all the records in the same page: the error persists for the 11th row ahead
    2) changed the VO query to return only the 11th row from the previous test using its ID: the action is called, now that the row is the first on the rowset.
    Have you experienced similar behavior? Why the Action is not executed when the selected row comes after the tenth row?
    Any help is greatly appreciated!
    Regards
    Thiago Souza

    Hi Frank, thanks for the reply.
    I have assembled a step-by-step based on the HR schema. For this example, i have created an EmployeesVO based on the EMPLOYEES table, and an App Module to provide a data control. From then on:
    1) Create a JSF JSP to list the Employees VO
    1.1) Bind the JSF Page to a Backing bean
    1.2) Create an af:page element on the page
    2) Drag the EmployeesVO from the Data Control Palette to the af:page
    2.1) Read-Only Table, Selection Enabled
    2.2) Do not include table navigation.
    3) Double-Click the automatically created submit button on the TableSelectOne section
    3.1) Bind it to a method on the Backing Bean
    3.2) Add some code to it, in my case i tested:
         FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Teste"));
    4) Run the example and try two approaches:
    4.1) select one of the first ten rows and click on the button: The action is fired.
    4.2) select the eleventh row and click on the button: The action is not fired.
    4.3) select one of the first ten rows again and click on the button: The action is fired.
    This example didn't even include range navigation, but if you want to test you will see the result is the same.
    Please let me know if you want further info.
    Thanks a lot!
    Thiago Souza

  • CommandButton does not call action method ?

    Hi BalusC or JSF gurus,
    I have a requirement to build a database table and update the row in the database table followed with save.
    I used this from posts : http://balusc.xs4all.nl/srv/dev-jep-dat.html.
    It was very excellent. Thanks BalusC.
    table.jsp:
    <h:dataTable rows="0" value="#{LCCircuitUtil.circuitList}" var="currentRow" binding="#{LCCircuitUtil.dataTable}">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Circuit Name"/>
    </f:facet>
    <h:commandLink action="#{LCCircuitUtil.editLinkAction}">
    <h:outputText value="#{currentRow.circuitId}"/>
    </h:commandLink>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Audit Comments"/>
    </f:facet>
    <h:commandLink action="#{LCCircuitUtil.editLinkAction}">
    <h:outputText value="#{currentRow.auditComment}"/>
    </h:commandLink>
    </h:column>
                   <h:column>
    <f:facet name="header">
    <h:outputText value="Start Date"/>
    </f:facet>
    <h:commandLink action="#{LCCircuitUtil.editLinkAction}">
    <h:outputText value="#{currentRow.startDate}"/>
    </h:commandLink>
    </h:column>
                   <h:column>
    <f:facet name="header">
    <h:outputText value="End Date"/>
    </f:facet>
    <h:commandLink action="#{LCCircuitUtil.editLinkAction}">
    <h:outputText value="#{currentRow.endDate}"/>
    </h:commandLink>
    </h:column>
                   <h:column>
    <f:facet name="header">
    <h:outputText value="Status "/>
    </f:facet>
    <h:commandLink action="#{LCCircuitUtil.editLinkAction}">
    <h:outputText value="#{currentRow.status}"/>
    </h:commandLink>
    </h:column>
    </h:dataTable>
    <h:commandButton value="New" action="#{LCCircuitUtil.newButtonAction}"/>
         </h:panelGroup>
    Upon click the link or newButtonAction i am able to see the edit.jsp with the populated row values..
    <h:form id="EditCircuitForm">
    <h:panelGrid columns="2">
    <h:outputLabel value="CIRCUIT ID" rendered="#{LCCircuitUtil.circuitTO.circuitId > 0}"/>
    <h:outputLabel value="#{LCCircuitUtil.circuitTO.circuitId}" rendered="#{LCCircuitUtil.circuitTO.circuitId > 0}"/>
    <h:outputLabel value="Audit Comment"/>
    <h:inputText value="#{LCCircuitUtil.circuitTO.auditComment}"/>
    <h:outputLabel value="Start Date"/>
    <h:inputText value="#{LCCircuitUtil.circuitTO.startDate}"/>
                   <h:outputLabel value="End Date"/>
    <h:inputText value="#{LCCircuitUtil.circuitTO.endDate}"/>
                   <h:outputLabel value="Status"/>
    <h:inputText value="#{LCCircuitUtil.circuitTO.status}"/>
    </h:panelGrid>
              <h:commandButton value="Save" action="#{LCCircuitUtil.saveAction}"/>               
    <h:commandButton value="Cancel" action="return" immediate="true"/>
              <h:inputHidden value="#{LCCircuitUtil.circuitTO.circuitId}"/>     
    </h:form>
    Save Action in LCCircuitUtil.java
         public String saveAction()
              System.out.println("saveAction ");
         this.updateCircuit(circuitTO);
         System.out.println("End saveAction");
         return "return";
    Issue : I am not able to call saveAction from the edit.jsp..It does not call the save Action in the backhand Managed Bean
    Thanks,
    bk

    hi balusC,
    I have not set any validation criteria anywhere(may be later)..
    <h:panelGrid columns="2">
    <h:outputLabel value="CIRCUIT ID" rendered="#{LCCircuitUtil.circuitTO.circuitId > 0}"/>
    <h:outputLabel value="#{LCCircuitUtil.circuitTO.circuitId}" rendered="#{LCCircuitUtil.circuitTO.circuitId > 0}"/>
    <h:outputLabel value="Audit Comment"/>
    <h:inputText id="ip1" value="#{LCCircuitUtil.circuitTO.auditComment}"/>
    <h:outputLabel value="Start Date"/>
    <h:inputText id="ip2" value="#{LCCircuitUtil.circuitTO.startDate}"/>
                   <h:outputLabel value="End Date"/>
    <h:inputText id="ip3" value="#{LCCircuitUtil.circuitTO.endDate}"/>
                   <h:outputLabel value="Status"/>
    <h:inputText id="ip4" value="#{LCCircuitUtil.circuitTO.status}"/>
                   <h:message for="ip1" /><br>
                   <h:message for="ip2" /><br>
                   <h:message for="ip3" /><br>
                   <h:message for="ip4" /><br>               
    </h:panelGrid>
    I didn't receive any error messages..When i save it refreshes the same page.
    Thank you,
    bk
    Message was edited by:
    kbalas78

  • Web service handler could not called in client web service

    Hi All,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static {
    SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
    WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
    adapter.setTrustedCertificatesFile("D:\\lib\\certs
    cacerts");
    factory.setDefaultAdapter(adapter);
    System.setProperty("weblogic.xml.encryption.verbose","true");
    System.setProperty("weblogic.xml.signature.verbose","true");
    System.setProperty("weblogic.webservice.verbose","true");
    public String sayHello(String user) {
    RemoteService_Impl service = new RemoteService_Impl(wsdl);
    RemotePortType port = service.getRemoteServicePort1();
    String namespace = service.getServiceName()
    .getNamespaceURI();
    QName portName = new QName(namespace,
    "RemoteServicePortType");
    HandlerRegistry reg = service.getHandlerRegistry();
    List handlerList = new ArrayList();
    Map map = new HashMap();
    map.put("Username", "user1");
    map.put("Password", "pwd1");
    HandlerInfo info = new HandlerInfo();
    info.setHandlerClass(WSClientHandler .class);
    info.setHandlerConfig(map);
    handlerList.add(info);
    reg.setHandlerChain(portName,(List)handlerList);
    RemoteServiceResponse = port.callMe(name);
    My Handler file:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
    private HandlerInfo handlerInfo;
    public WSClientAuthenticateHandler(){}
    public void init(HandlerInfo hi) {
    System.out.println("Handler init");
    handlerInfo = hi;
    public void destroy() {
    System.out.println("Handler destroy method called");
    handlerInfo = null;
    public QName[] getHeaders() {
    System.out.println("Handler Header method called");
    try {
    Map map = handlerInfo.getHandlerConfig();
    QName[] headers = handlerInfo.getHeaders();
    System.out.println(" Config :"+map);
    for(int i=0;i<headers.length;i++) {
    System.out.println(headers.getLocalPart()+" "+
    headers.toString()+" "+headers.getNamespaceURI());
    }catch(Exception e) {
    e.printStackTrace();
    return handlerInfo.getHeaders();
    public boolean handleRequest(MessageContext mc) {
    SOAPMessageContext smc = (SOAPMessageContext) mc;
    System.out.println("Calling handler class.....................");
    try {
    SOAPEnvelope se = smc.getMessage().getSOAPPart().getEnvelope();
    System.out.println("Calling handler class.....................");
    SOAPHeader soapHeader = se.getHeader();
    Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
    SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
    SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
    element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
    element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
    System.out.println("Calling handler class.....................");
    System.out.println("** Request: \n "se.toString()"\n");
    }catch(SOAPException e) {
    e.printStackTrace();
    return true;
    /** * Specifies that the SOAP response message be logged to a
    * log file before the
    * * message is sent back to the client application
    * that invoked the Web service.
    public boolean handleResponse(MessageContext mc) {
    System.out.println("Handler Response method called");
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Response: \n"messageContext.getMessage().toString()"\n");
    return true;
    /** * Specifies that a message be logged to the log file if a SOAP fault is
    * * thrown by the Handler instance.
    public boolean handleFault(MessageContext mc) {
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Fault: \n"messageContext.getMessage().toString()"\n");
    return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    "*RemoteServicePortType*");
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    *<portType name="RemoteServicePortType">*
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">
    <soap:address
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">
    <soap:address
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">
    <soap:address
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">
    <soap:address
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    </port>
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • Button action is not calling

    Hi,
    I am new to JSF.
    Here is my problem.
    I have a select one menu and command button on a page
    When ever the page loads for the first time the select one menu is loaded with the data and the button should be disabled.
    When an item is selected from the menu the button should be enabled.
    Upto this part I finished.
    Now the problem is with button.When I click the button the corresponding action method is not calling.
    If the button is enabled during page load then the action method is calling when ever I click the button.
    But I need to make the button disabled until I select an item from the
    select one menu.In this case the action method is not calling when I click the button.
    Please help me.
    Thanks in advance

    Thanks for fast response.
    Here is my jsp code:
    <script>
         function enableLoad(){
         if(document.getElementById("form1:menu1").selectedIndex==0){
         document.getElementById("form1:loadTable").value = 'true';
         else{
         document.getElementById("form1:loadTable").value = 'false';
         document.getElementById("form1").submit();
         </script>
              <h:form styleClass="form" id="form1">
              <TABLE class="tableBorder" cellspacing="10" cellpadding="10">
              <TR>
              <TD width="230" align="right">
              <SPAN class="outputtext">Select The Table To Manage:</SPAN>
              </TD>
              <TD>
              <h:selectOneMenu styleClass="selectOneMenu" id="menu1" value="#{manageReferenceTablesMB.tableValue}"
    onchange="enableLoad()">
                                  <f:selectItems value="#{manageReferenceTablesMB.tableNames}" />
                        </h:selectOneMenu>
              </TD>
              </TR>
              <TR>
              <h:inputHidden id="loadTable" value="#{manageReferenceTablesMB.loadTable}"/>
              <TD colspan="2" align="right">
              <hx:commandExButton type="submit" value="Load Table"
                                  styleClass="commandExButton" id="button1" disabled="#{manageReferenceTablesMB.loadTable}"
                                  action="#{manageReferenceTablesMB.refTable}"></hx:commandExButton>
              </TD>
              </TR>
              </TABLE>
              </h:form>
    This is the backing bean code:
    public class ManageReferenceTablesMB extends BaseMB{
         public SelectItem[] tableNames;
         public String tableValue = "-1";
    public boolean loadTable ;
         public ManageReferenceTablesMB(){
              super(SessionConstants.MANAGE_REFERENCE_TABLES);
              if (this.getFromPageDataBuffer(SessionConstants.MANAGE_REFERENCE_TABLES) == null){
              System.out.println("in constructor");
              Hashtable results = new Hashtable();
              SwqmisFrontController controller = this.getFrontController();
              results = controller.getRefTableNames();
              tableNames = buildMenu((Vector) results.get("REF_TABLE_NAMES"));
              System.out.println("added data");
              System.out.println("........."+tableValue+"..........");
              this.addToPageDataBuffer(SessionConstants.MANAGE_REFERENCE_TABLES,this);
              }else{
                   this.tableNames = ((ManageReferenceTablesMB)this.getFromPageDataBuffer(SessionConstants.MANAGE_REFERENCE_TABLES)).tableNames;
                   this.tableValue = ((ManageReferenceTablesMB)this.getFromPageDataBuffer(SessionConstants.MANAGE_REFERENCE_TABLES)).tableValue;
                   this.loadTable = ((ManageReferenceTablesMB)this.getFromPageDataBuffer(SessionConstants.MANAGE_REFERENCE_TABLES)).loadTable;
         public String refTable(){
              System.out.println("IN REF TABLE");
              System.out.println("....."+tableValue+".......");
              Hashtable results = new Hashtable();
              SwqmisFrontController controller = this.getFrontController();
              results = controller.getRefTable(getDisplayText(tableNames,tableValue));
              if(results!=null && results.size()>1)
              System.out.println("success");
              else
              System.out.println("failure");
              return "success";
         * @return Returns the tableNames.
         public SelectItem[] getTableNames() {
              return tableNames;
         * @param tableNames The tableNames to set.
         public void setTableNames(SelectItem[] tableNames) {
              this.tableNames = tableNames;
         * @return Returns the tableValue.
         public String getTableValue() {
              return tableValue;
         * @param tableValue The tableValue to set.
         public void setTableValue(String tableValue) {
              this.tableValue = tableValue;
         * @return Returns the loadTable.
         public boolean isLoadTable() {
              return loadTable;
         * @param loadTable The loadTable to set.
         public void setLoadTable(boolean loadTable) {
              this.loadTable = loadTable;
    In the above backing bean code the loadTable value is false.
    So under this condition the action method is calling.B'cause the button is in enable state even there is no section in the menu.
    If I make loadTable=true then the action button is in disabled state until the menu item is selected. But the action method is not executing in this case.
    Thanks.

  • Netbeans beans binding

    __How TO Bind The Domain object Directly To Detail View ?__
    when we create master detail table with netbeans .netbeans uses the following binding patern.bind the list to master table and master tables selected element to lists domain object
    how to use netbeans beans binding feature create a from which only have detail view (no master table )
    and bind domain (customer) object directly to GUI fields
    and i should have to the abilty to add new (create new ) domain object using the same form.
    I don’t want jtable in my form
    note:-and I have to be able to persist the old object and create new object in the same form
    ie :- add new button on the same form
    please visit following link for picture
    [http://netbeans7.blogspot.com/]

    I'll give my usual comment here:
    Take this to a NetBeans forum--since it's how to use the NetBeans GUI tool and hasn't anything to do with you coding Java--or go back and learn how to code GUI's without an auto-coder. I and many others are very reluctant to give any advice other than that to anyone that wants to use the auto-code features of a product.

  • JHeadstast 10.1.3 - JhsPageLifecycle issue : jhs prepareRender not called

    Hello,
    I'm evaluating Jheadstart 10.1.3.
    I have created 2 projects but both don't behave the same way.
    In one project everything works as expected but not in the second.
    It seems that the prepareRender phase implemented in JhsPageLifecycle is not called appropriately.
    Here are the relevant stack traces :
    [WORKING PROJECT]
    7 nov. 2006 11:27:03 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:initContext
    7 nov. 2006 11:27:03 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:prepareModel
    11:27:03 DEBUG (JhsPageLifecycle) -Executing prepareModel, page=/create.jspx, pagedef=createPageDef
    11:27:03 DEBUG (JhsNavigationHandlerImpl) -Executing checkRoles
    7 nov. 2006 11:27:03 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:prepareRender
    11:27:03 DEBUG (JhsPageLifecycle) -Executing prepareRender, page=/create.jspx, pagedef=createPageDef
    [NOT WORKING PROJECT]
    7 nov. 2006 11:28:35 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:initContext
    7 nov. 2006 11:28:35 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:prepareModel
    11:28:35 DEBUG (JhsPageLifecycle) -Executing prepareModel, page=/app/temp.jspx, pagedef=app_tempPageDef
    11:28:35 DEBUG (JhsNavigationHandlerImpl) -Executing checkRoles
    7 nov. 2006 11:28:36 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:initContext
    7 nov. 2006 11:28:36 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:prepareModel
    7 nov. 2006 11:28:36 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:prepareRender
    7 nov. 2006 11:28:36 oracle.adf.controller.v2.lifecycle.Lifecycle executePhase
    FIN: [ADFc] Execute:prepareRender
    What should I look at in order to make both projects work ?
    Thanks,
    Seb.

    I've checked my faces-config.xml. It had the folowing inside :
      <application>
        <default-render-kit-id>oracle.adf.core</default-render-kit-id>
      </application>
      <lifecycle>
        <phase-listener>oracle.adf.controller.faces.lifecycle.ADFPhaseListener</phase-listener>
      </lifecycle>Since JhsCommon-beans.xml redefines the phase listener, I had un instable state.
    May be this will serve someone else.
    Seb.

  • Enum operator overloads not called

    Hi,
    we are faced with a serious problem of the current Forte C++ compiler version (WS6U2 with actual patches). The following test program shows that the compiler does not accept operator overloads for enums. Instead of this all enums are implicitly converted to int.
    The sample compiles and runs fine with three calls to the overloaded operator|() on other compilers such as g++. The funny thing ist that also the unpatched WS6U2 Forte C++ compiler (5.3 2001/05/15) works properly here.
    So, what are the concerns of the newer compiler versions from Sun? From our point the code should be accepted by an ISO C++ compliant compiler.
    $ cat test.cc
    enum BitFlags { BIT0, BIT1 };
    BitFlags operator|(BitFlags lhs, BitFlags rhs)
    return static_cast<BitFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs));
    int main(int, char**)
    BitFlags a = BIT0 | BIT1; // Error
    BitFlags b = BitFlags(BIT0 | BIT1); // OK, but operator|() not called
    BitFlags c = ::operator|(BIT0, BIT1); // OK (explicit operator call)
    return 0;
    $ CC test.cc
    "test.cc", line 11: Error: Cannot use int to initialize BitFlags.
    1 Error(s) detected.
    $ CC -V
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-07 2002/04/10
    Thanks in advance,
    Michael v. Szombathely

    This regression was not reproducible and works o.k. as of patch 11685-09. So, if you get the current patch 111685-14, this problem is fixed in that patch.

  • "start" not called for Custom Login Command

    Hello,
    I'm working on getting acegi to handle the authentication instead of the app server. So I extended AppServerLoginCommand and overrode doAuthenticate and "start". But "start" never seems to get called; neither during initialization of the server nor before or after doAuthenticate is called. Note that doAuthenticate *does* get called, so BlazeDS does know about my custom command. I tried implementing just LoginCommand instead of extending AppServerLoginCommand but the same result.
    The reason I need start is because I want to grab the WebApplicationContext and from there get the authenticationManager bean so that doAuthentication can do its job.
    I noticed that "stop" never gets called either.
    Any pointers or clues would be appreciated.
    /r

    I looked through the source code and as best I can tell "start" never gets called for LoginCommand. This is, by no means, a certainty since I only partially followed the stack trace and looked at the source near the place where the LoginCommand gets created, so there may be another point in the lifecycle where start gets called. But anyway, if you look at the file at:
    http://opensource.adobe.com/svn/opensource/blazeds/trunk/modules/core/src/java/flex/messag ing/config/MessagingConfiguration.java
    near
    private LoginCommand initLoginCommand(LoginCommandSettings loginCommandSettings)
    you'll notice that the LoginCommand gets created but start is not called.

Maybe you are looking for

  • Help reqd on MM data uploading thru LSMW by view steps...

    Hi all.... Pls understand my requirement and post ur replies...i dont need the basic LSMW learning steps for MM,Vendor etc.,like that... My problem is...im want to upload my material master datas by steps like 1st i want to uplaod the basic views 1&2

  • Tracking a stolen device

    Hi all One of our portables has been stolen. Since a few days, the device is reporting again in Intune. Intune tells us something more about the "Last User to Log on" and "The Network Adaptor Configurations" (a private IP Address, but not one of our

  • Mainstage 2 - MUCH worse CPU usage!

    On my MBP, the same settings same project was hovering around 75% cpu with Mainstage 1, now Mainstage 2 is MAXED. Had to lower sample rate AND increase buffer to make it useable. This is unacceptable! Have noticed a few bugs fixed, and some great fea

  • Colouring a header in a table ?

    Hi People, Is it possible to give color shade to the header of a table in smartform? thanks, siva

  • DN mapping rule  problem

    Hi, all. Here is problem - i try to replicate entry from Active Directory connector view dn: cn=user, ou=123,ou=bank,o=ADCView to MetaView entry dn: cn=user, ou=345,ou=internal users,o=Meta I have DN mapping rule: Selection criteria: (%objectclass%^p