Multiple methods

can multiple methods be called like this?
Whatever class = new Whatever();
class.method1().method2().method3(param);

can multiple methods be called like this?
Whatever class = new Whatever();
class.method1().method2().method3(param);Why don't you do this?
class.method1(param);
public method1(param){
class.method2(param);
public method2(param){
class.method3(param);

Similar Messages

  • Call Webservice URL with multiple methods in PI 7.0

    Dear Gurus,
    I have the following requirement:
    I need to make multiple calls to a same webservice (URL) which have multiple methods on its WSDL. I know it is possible in PI 7.1. But is it possible in PI 7.0?
    I have already designed and configured the scenarios and generated ABAP Proxy. When I call the endpoint without specifyng the method I got the following message:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Endpoint {http://mywebserviceurl.com} does not contain operation meta data for: {http://mynamespace}MyMessageInterface</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Please somebody could help me to solve this issue?
    Thank you in advance.
    Fabio Purcino

    >>. But is it possible in PI 7.0?
    Just few cents..
    Test using SOAPUI or  XMLSPY and use that same WSDL URL in the target URL of Communication channel. Just to make sure you use the right endpoint.
    or
    You can specify the method name as  soap action dynamically using udf in mapping and see how it behaves.

  • OO ALV hotspot creation not working with Multiple Methods.

    Hi,
    I create a Test Report for Hotspot creation - It works. Code is  as -->
    class my_event_handler definition.
      public section.
      methods :
      handle_hotspot_click for event hotspot_click of cl_gui_alv_grid importing e_row.
      endclass.
      class my_event_handler implementation.
        method handle_double_click.
          read table itab index e_row-index into wa.
          if sy-subrc = 0.
           set PARAMETER ID 'ANR' FIELD order
    call transaction IW33.         
    endif.
      endclass.
    BUT - When I take multiple methods in PUBLIC SECTION. & Call it from START-OF-SELECTION the HotSpot is NOT WORKING
    CLASS get_details DEFINITION.
      PUBLIC SECTION.
        METHODS:  data_gathering,
                  display_alv.
                  handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid IMPORTING e_row .
      PRIVATE SECTION.
        CLASS-METHODS: get_data,
                       merge_data,
                       set_header IMPORTING er_table TYPE REF TO cl_salv_table,
                       set_coloum IMPORTING pr_columns TYPE REF TO cl_salv_columns_table.
    ENDCLASS.       
    CLASS IMPLEMENTATION - IS SAME AS ABOVE.
    START-OF-SELECTION.
      CREATE OBJECT lr_details.
      lr_details->data_gathering( ).
      IF gi_final IS NOT INITIAL.
        lr_details->display_alv( ).
    *    lr_details->handle_hotspot_click( EXPORTING row = ?  ).  " What to take?
      ELSE.
        MESSAGE 'No Data for the Selection Critaria' TYPE 'S' DISPLAY LIKE 'E'.
      ENDIF.
    How get Hotspot in this Case, Do I need to take the Method in START-OF-SELECTION ?
    if YES - then what to Export ? If NO - then how to create Hotspot in this case?

    Thanks Neil. Now it's working.
    For this One line clue - I really searched a lot.
    Thank you so much.
    If checking this link For Reference -->
    Search 'SET HANDLER' in Google for sample programs.
    * Before Class Defination
    CLASS get_details DEFINITION DEFERRED.
    DATA: event_receiver1  TYPE REF TO get_details,
    * At the End of Method display_alv (Check question for Methods)
    CREATE OBJECT event_receiver1.
    SET HANDLER event_receiver1->handle_hotspot_click FOR ALL INSTANCES.

  • Multiple method signatures in an MBean

    The text formatting seems to be broken on this site. Sorry for the mass of text!
    I have an MBean containing some utility functions used within a custom authenticator. At the moment, there all use a single data source, but I need to extend them to use multiple datasources. I also need to maintain backwards compatability with the original system.
    I have therefore modififed the xml bean descriptor file and Impl java class by duplicating all the methods, adding a dataSource ID param, as follows:
    I started with this method descriptor:
    <pre>
    <MBeanOperation
    Name = "getMaintenanceMode"
    ReturnType = "boolean"
    Description = "Whatever"
    >
    <MBeanException>javax.management.MBeanException</MBeanException>
    <MBeanException>weblogic.management.utils.NotFoundException</MBeanException>
    </MBeanOperation>
    </pre>
    and impl:
    <pre>
    public boolean getMaintenanceMode() throws MBeanException , javax.management.MBeanException, weblogic.management.utils.NotFoundException
    </pre>
    and have now added this :
    <pre>
    <MBeanOperation
    Name = "getMaintenanceMode"
    ReturnType = "boolean"
    Description = "Whatever"
    >
    <MBeanOperationArg Name = "dataSourceId" Type = "int"
    Description = "Data Source ID"
    />
    <MBeanException>javax.management.MBeanException</MBeanException>
    <MBeanException>weblogic.management.utils.NotFoundException</MBeanException>
    </MBeanOperation>
    </pre>
    and
    <pre>
    public boolean getMaintenanceMode(int dataSourceId) throws MBeanException , javax.management.MBeanException, weblogic.management.utils.NotFoundException
    </pre>
    With these code changes in place, the MBean builds correctly, using the MBeanMaker, however WLS(814) falls over on startup with the exception:
    <pre>
    javax.management.JMRuntimeException: Two operations with the same name, "getMaintenanceMode", in MBean type: com.aol.universal.security.tools.DashboardUserTools
    at weblogic.management.commo.ModelMBeanTypeMBean.getExpandedMBeanInstanceInfo(ModelMBeanTypeMBean.java:1092)
    at weblogic.management.commo.ModelMBeanTypeMBean.<init>(ModelMBeanTypeMBean.java:250)
    at sun.reflect.GeneratedConstructorAccessor3.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at com.sun.management.jmx.MBeanServerImpl.internal_instantiate(MBeanServerImpl.java:2232)
    at com.sun.management.jmx.MBeanServerImpl.createMBean(MBeanServerImpl.java:763)
    at weblogic.management.internal.RemoteMBeanServerImpl.createMBean(RemoteMBeanServerImpl.java:897)
    at javax.management.loading.MLet.getMBeansFromURL(MLet.java:542)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1633)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1528)
    at weblogic.management.internal.RemoteMBeanServerImpl.private_invoke(RemoteMBeanServerImpl.java:988)
    at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:946)
    at weblogic.management.commo.Commo.initTypesAtLocation(Commo.java:1409)
    at weblogic.management.commo.Commo.initTypes(Commo.java:552)
    at weblogic.management.commo.Commo.initTypes(Commo.java:534)
    at weblogic.management.AdminServerAdmin.initializeCommo(AdminServerAdmin.java:656)
    at weblogic.management.AdminServerAdmin.initializeRepository(AdminServerAdmin.java:874)
    at weblogic.management.AdminServerAdmin.initialize(AdminServerAdmin.java:267)
    at weblogic.t3.srvr.T3Srvr.initializeHere(T3Srvr.java:771)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:670)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:344)
    at weblogic.Server.main(Server.java:32)
    </pre>
    Granted there <i>are</i> two methods with the same name, but they have different signatures, so they are <i>different</i> methods! Its just simple OO method overloading, after all!
    Has anyone run into this in, too? Is there a solution?
    cheers
    Paul

    Hi,
    I doubt that the addition of a second signature actually invalidates (the red X icon) the first signature, but rather it shows the signature as Valid with Changes (the pen & yellow triangle icon). Technically, that is the correct signature status, but because it caused so much confusion, beginning with version 9, we've changed the user interface and stopped indicating changes to the PDF if the only change is a subsequent signature.
    If on the other hand you are getting the red X for the first signature please let me know as I'd be curious to see the file.
    Steve

  • CFTRANSACTION across multiple methods??

    I have a couple of question around CFTRANSACTION
    1) Can I use it around several component calls? eg
    <cftransaction>
    <cfinvoke component="myComponent"
    method="InsertTable1">
    <cfinvokeargument ........ />
    </cfinvoke>
    <cfinvoke component="myComponent"
    method="InsertTable2">
    <cfinvokeargument ........ />
    </cfinvoke>
    </cftransaction>
    2) If this is an inappropriate use of CFTRANSACTION, is there
    a way to programmatically achieve transactioning when database
    inserts/updates/deletes are performed across multiple component
    methods.

    In article <f4t1r9$akd$[email protected]>
    "Swampie"<[email protected]> wrote:
    > I have a couple of question around CFTRANSACTION
    >
    > 1) Can I use it around several component calls? eg
    Yes.
    > 2) If this is an inappropriate use of CFTRANSACTION
    No, this is appropriate.
    Just remember that you can't have a transaction spanning
    operations on
    multiple data sources and, prior to CF8, you cannot have
    nested
    transactions (hence Reactor and Transfer both have a boolean
    flag on
    save() methods to indicate you are wrapping the calls in your
    own
    cftransaction tag.
    Sean
    I'm trying a new usenet client for Mac, Nemo OS X.
    You can download it at
    http://www.malcom-mac.com/nemo

  • Run Multiple Methods at the same time

    Hey Everyone,
    So here is my dilemia. I have these three classes and two of them are subscribers to a middleware so when I call one of these classes to subscribe the code stops while the subscriber listens for the message. The problem is that the other class I have is the publisher and unless I want to run the publisher as a separate script I need to find a way to run it once the subscriber is listening. Some have suggested I use a callback but I am unfamiliar with how a callback would work. In Matlab when I use callbacks I still end up waiting for the subscriber to come back with a response so I am not sure this is the solution to my problem in Java.
    I have a main method in a main class which calls methods in each of three classes however once it subscribes to the first one on the list it stops and waits for the subscriber to finish working. Does anyone have any suggestions of how to allow the subscriber to continue to listen but still return back to the main method and allow me to run the next subscriber and so on? Thanks for your help!!

    You'll need some sort of multithreading. Whether you roll your own or there's some prepackaged tools out there you can use, I don't know, as I didn't understand your requriements very well.
    http://java.sun.com/docs/books/tutorial/essential/threads/

  • WebService with multiple methods

    Hello to everybody.
    I need an help with the develop of a WebService that it comes with 2 methods: I have already created a lot of WebService in JCAPS6 with only one method and everything was gone well. I tried to implement a WebService with 2 or more method but when I tried to deploy the project I always received this error message: "Deploying application in domain failed; Deployment descriptor file META-INF/application.xml in archive [nameOfArchive]. Duplicate unique value [element] declared for identity constraint of element "application"."
    Theese are the steps that I have done:
    1) create an XSD for Input message
    2) create an XSD for Output message
    3) create a WebServiceDefinition with 2 methods "Method1" and "Method2" and all message (input/output) implemented
    4) create a BusinessProcess (bp1) to implement Method1 operation
    5) create a BusinessProcess (bp2) to implement Method2 operation
    6) create a Connectivity map whith "bp1" and "bp2" directly connected with a new "Web Service External Application"
    7) create a deployment profile
    The "Build" operation was gone well but the "Deploy" operation always returned me an exception.
    What can I do to develop this type of WebService?
    Anyone can help me?
    Thank you in advance.
    Best regards,
    Marco Tranquillin

    My collegue found a solution:
    1) create WSDL with 2 or more operations (with input,output and fault messages);
    2) drag & drop "Event Based Decision" element into Business Process;
    3) link "Start" to "Event based decision";
    4) link "Event based decision.end" to "End";
    5) link a scope (with inside what you want) with "Event based decision";
    6) choose your operation from WSDL and drag & drop it OVER the icon with the mail icon;
    7) link operation.reply with the output scope and with the element "Event Based Decision.end";
    Marco Tranquillin

  • How to execute multiple methods of application module from managed bean using operation binding

         im using jdev 11.1.2.3
    gettiing error..........in my page as below
    java.lang.NullPointerException
    ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #1
    and weblogic log as below
    RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
    javax.servlet.ServletException
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:521)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NullPointerException
        at view.com.pof.admin.users.POFAdminUser.createPasswordHistory(POFAdminUser.java:64)
        at view.com.pof.admin.users.POFAdminUser.performOperationBinding(POFAdminUser.java:49)
        at view.com.pof.admin.users.POFAdminUser.saveData(POFAdminUser.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.el.parser.AstValue.invoke(Unknown Source)
        at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
        at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1545)
        at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
        at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
        ... 38 more

    User, I fail to understand what your header (of the question) has to do with the stack trace. You get a npe in your code
    view.com.pof.admin.users.POFAdminUser.createPasswordHistory(...)
    This is the point where I would start my investigation.
    Timo

  • Atomic execution of multiple methods

    Is it a flawed idea to try to execute a sequence of methods atomically in the following way?
    synchronized(obj) {
    obj.method1();
    obj.method2();
    Even if the object is thread-safe, it can still have methods that are not declared synchronized (e.g. because they involve a single atomic read/write operation). So these methods are not blocked by the synchronized block.
    Is it better to consider the object's lock something internal to the object and should not be manipulated outside the object's implementation? In another word, is it better to rely on an external lock (i.e. an external object created solely for the purpose of locking) to achieve atomicity? Obviously, it's harder to make sure all invocations of method1 and method2 are done while holding this lock.

    A thread will not block unless it synchronizes on a
    "locked" object. If an object is "locked" and a
    different thread enters one of its unsynchronized
    methods it will not block.If an object is locked it will not allow another thread to access it's unsynchronized method.
    Here is an example of locking an object and trying to access an unsychronized method with another thread which cannot be done until the synch block has finished.
    public class Test3 extends Thread
        Test2 t2;
        /** Creates a new instance of Test3 */
        public Test3(Test2 t2Instance)
            t2 = t2Instance;
        public void run()
           // this is my seperate thread which calls a unsynchronized method
           // but it won't call it until after the synch block is through
           t2.unsynchronizedMethod();
           System.out.println("Called the unsych method using another thread.");
    public class Test2
        /** Creates a new instance of Test2 */
        public Test2(int maxIndex)
            synchronized( this )
                // loop for 100 times to deminstrate the synch block
                for(int i = 0; i < maxIndex; i++)
                    System.out.println("In synch block; count is " + i);               
        public void unsynchronizedMethod()
            System.out.println("Accessed unsynchronized method");
    public class Test1
        /** Creates a new instance of Test1 */
        public static void main(String[] args)
            Test2 t2 = new Test2(10000);
            Test3 t3 = new Test3(t2);
            t3.start();
            t2.unsynchronizedMethod();
    }The thread has to wait until the synch block is through before it can access the unsynchronized method of the locked object.

  • Re: multiple methods - Help

    It looks you used it, what are you saving the extra 5 duke'd for ?
    Noah

    So i take out the static in main.Not really an option. A static main() method is required if you are going to
    run your program. (And you should be compiling and running your program
    with each change you make - there's no other way of seeing whether or not
    it's "working". The alternative is to end up with a whole lump uncompilable
    code that's impossible for you to sort out. And that's not an alternative.)
    I have an order class which has setter and getter methods within it, and
    some variables.And I'm suggesting that your methods should be part of that class. That way
    they can be called in a non static way from the static main() method.
    I was thinking about the return statements like you said, but unsure
    what/where to return.Where to return is easy: returning a value is the very last thing a method
    does. You return as soon as you've calculated whatever it is you want to
    return.
    What a method returns depends on what you want it to return. Decide on
    this before you write a line of code. And document it.

  • Finding a squareroot of an Integer, using multiple Methods

    K, I'm somewhat new to Java, and I have an assignment I'm working on. The basic idea is that I have to find the get a number from a user, and then send that number to another METHOD, and return the squareroot value? Anybody have any idea on how to start this....as I said, I have very basic Java skills, so please, bare with me.
    Thanks

    Dear Sudha,
    Thank you very much for the explanation. However, due
    to being fairly new in Java programming, I tend to get
    very confused each time I stumble across something
    different from the steadfast rules I was taught at the
    university. Regarding your explanation, I have found
    it very ambiguous. Would you kindly mind delineating
    it in more detail? If I understood it correctly, the
    main reason for your usage of "return" statement is
    because of the decleration of variables in the Threads
    section right? So the action of returning is simply
    averted when one uses the statement of
    System.exit(0) . I am clear on that. However,
    doesn't the fact that this main method has the word
    void mean anything in terms of return
    statements as it means in other methods? Can you
    expound more on that if I may ask? Please forgive my
    inquisitiveness.
    Regards,
    VahidI have a problem, and for the first time in here I'm going to be a b**ch (<- you know what word that is), I must ask why the words inquisitiveness, expound, and ambiguous are used? Why can't you just use curious and other plain words that make more sense than trying to fit together these complex english words to something that is already complex. I don't care whos gone to university or college for what, I care about the ease of reading, why make it harder to understand? Stick to the basics... why not? Sounds good to me.

  • Executing multiple methods off of one button

    Hi,
    I have a parameter form based on the bind variables of a view object and I am trying to execute a second method via the "ExecuteWithParams" buttons.
    I have included an <f:actionListener/> within my command button so my current button code is as follows:
    <af:commandButton actionListener="#{bindings.ExecuteWithParams.execute}"
    text="Submit"
    disabled="#{!bindings.ExecuteWithParams.enabled}"
    action="Go" partialSubmit="false">
    <af:setActionListener from="#{bindings.Param1.inputValue}"
    to="#{Input.Param1}"/>
    <af:setActionListener from="#{bindings.Param2.inputValue}"
    to="#{Input.Param2}"/>
    <af:setActionListener from="#{bindings.Param3.inputValue}"
    to="#{Input.Param3}"/>
    <af:setActionListener from="#{bindings.Param4.inputValue}"
    to="#{Input.Param4}"/>
    <f:actionListener type="model.InputBean"/>
    </af:commandButton>
    model.InputBean:
    public class InputBean extends AppModuleImpl implements ActionListener{
    ....... (includes sets and gets for Input.Param1-4)......
    public void processAction(ActionEvent e){
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
    BindingContext bc = (BindingContext)vb.getValue(fc);
    DCDataControl dc = bc.findDataControl("AppModuleDataControl");
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    AppModule service = (AppModule)am;
    service.Method(Param1, Param2);
    The service.Method() is called but errors out with a nullPointerException at both parameters.
    I've hard coded the method and found it does work, I am just having trouble passing the variables in to start with.
    The setActionListeners within the button code are so I can pass the values that are entered in each Param to the next page, I thought I might be able to
    use these to set the Params for service.Method() but it seems this isn't happening.
    Any Ideas?
    Thanks,

    Hi,
    That has helped, I was able to execute my second method and redirect to the other page on the one button submit
    but now my view objects that I dropped from the data control palette don't return any rows.
    Any ideas?
    Thanks,
    Not sure what I did, but it started working!
    Edited by: Ruari on May 21, 2009 11:26 AM

  • How would I change the variables in multiple methods with the user input?

    Here is my code for a tic tac toe game I have to do for an assignment, it is currently set at the normal 3 x 3, but the teacher what the user to be albe to change these to between 3-5 before they start playing, here is my codeing
    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[i][j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[i][j].equals(" "))
    board[i][j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[i][j];
    r = r + "|\n";
    return r;
    I am having a problem figuring out how to change the variables ROWS , COLUMNS to the given user input, it seems easy but i can't really figure out how to do it
    thanks ahead of time

    import java.util.*;
    public class TicTacToe
    Constructs an empty board.
    private String[][] board;
    private static int ROWS = 3;
    private static int COLUMNS = 3;
    public TicTacToe()
    int size = in.nextInt();
    board = new String[ROWS][COLUMNS];
    // Fill with spaces
    for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
    board[j] = " ";
    Sets a field in the board. The field must be unoccupied.
    @param i the row index
    @param j the column index
    @param player the player ("x" or "o")
    public void set(int i, int j, String player)
    if (board[j].equals(" "))
    board[j] = player;
    Creates a string representation of the board, such as
    |x o|
    | x |
    | o|
    @return the string representation
    public String toString()
    String r = "";
    for (int i = 0; i < ROWS; i++)
    r = r + "|";
    for (int j = 0; j < COLUMNS; j++)
    r = r + board[j];
    r = r + "|\n";
    return r;
    }sorry for not posting code correctyl new to this forums
    Thanks for the help but let me rephrase my question, the rows and columns are the same like 3x3, 4x4 ,or 5x5,
    -when the program runs it will ask the user for what they want to set the tic tac toe at between 3 - 5.
    My question is how do I get the code
    Scanner a = new Scanner ( System.in );
    System.out.print("Enter the size of the tic tac toe box to be between 3-5 : ");
    int sizeTicTacToe = a.next();to change the variables of ROWS COLUMNS
    I just want to know of a way to make the users input of sizeTicTacToe to change the variables ROWS & COLUMNS in my toString() and TicTacToe() methods

  • Multiple main methods

    Can we have more than one main method in a class/in various classes?if not why? and if yes then is that possible to call main() method with some other object nam,,,,say for eg...j.main()?
    As I'm new to java if anybody can explain me using an example as applicable it would be a better understanding for me over the concept

    It's not necessary to have main in a class and it's also ok to have main in multiple classes.
    You can also have multiple methods named 'main' in a class ( confusing, but legal ) as long as they follow the rules for overloading.
    The entry point for a Java program has to be a method with the signature
    public static void main ( String [] args )If you don't have this, you can't run that class. If you do, you can.
    The method has to be public because it will be called by the OS. It also has to be static since the object will not be instantiated till later; the runtime environment needs to be able to call the method without having to instantiate an object. The String array as parameter is to allow passing of command line arguments to the class.
    EDIT: A little slow there.
    Edited by: nogoodatcoding on Oct 16, 2007 5:48 PM

  • Multiple Issues with iTunes on New iMac

    Hello Apple Community,
    I recently bought a 27" iMac with 3.1Ghz i5 processor running on Snow Leopard and finally set it up.  I have owned many Macs in the past and currently have been using a 5 year old 15" MacBook Pro on Snow Leopard that has been running flawlessly but I needed something with a bit more processing power.  When I first took my iMac out of the box I went ahead and used the Migration Assistant to move my applications and files over from my MacBook Pro but after multiple attempts I had to stop and simply move the music, document, and photo data on to a portable hard drive while I got the Migration Assistant to move the applications.  I simply moved the old iTunes music folder over to my new iMac and replaced the iTunes folder on my iMac.  The new iMac has already been authorized through my iTunes account and the music will play.  Now here are my current issues.
    When I play a song on iTunes, there appears to be a random amount of fade-in and/or crossfade when I switch playing songs.  I have checked the playback preferences and crossfade is not checked.  Some songs the crossfade will take a second while sometimes it will be as much as 10 seconds of crossfade.  On my MacBook with the identical library and settings, it does not have these issues.
    The other issue I have been experiencing is if iTunes has been open and my computer sits for a little while (usually after awaking from sleep or even listening to a few songs without touching the keyboard, the songs will stop playing on their own and when I press the play button, it begins to "play" the track but there is no sound coming from iTunes.  I have checked the volume slider in iTunes and it is still at max volume while all other applications still work and output sound.  iTunes will only work properly if I close it and re-open it.
    The final issue is similar to the last one in that when I try and play previews in the iTunes Music store it will not play but when I hit the play button iTunes will then appear to be "playing" but no sound from either the store or any of my songs from the Library.
    iTunes works perfectly fine on my MacBook Pro and it does have any of these issues.  Both Macs are currently running iTunes 10.4.1.  All songs in each library are checked and will play to a degree.
    I have deleted iTunes and all corresponding library files, (basically anything with iTunes in the name) and tried to reinstall iTunes and used multiple methods to replace the music files including using Home Sharing, a portable Hard Drive, and dragging and dropping the music files from the shared folder and no matter what I try, I still cannot get iTunes on my iMac to work properly.  I have been searching around the support forums for others who might have had this issue but I cannot seem to find much.  Any help would be greatly appreciated!

    I had not tried that before, but from your suggestion, I went ahead and did it and it seems to have gotten rid of the crossfade issues I was experiencing but whenever I try and listen to a preview in the iTunes music store it still does not appear to be working.  Also, I was testing a number of tracks and it seems like there are a few tracks in particular that will make iTunes stop playing when I click on them and then if I attempt to play something else, iTunes says it is playing but no sound is coming from it. 
    What I have found that is interesting is the first time I ran the Disk Utility it repaired a HUGE number of misc. files.  After running it and still experiencing problems I tried to run it again but this time the files were not as numerous and were all within the /Library/CoreServices menu.  Each subsequent time I ran the Disk Utility and rebooted, I tried to run the Disk Utility again and the same files seem to still be having the same issues.  This is just an example of one of the files I have been having an issue with.
    Permissions differ on "System/Library/CoreServices/Menu Extras/RemoteDesktop.menu/Contents/Resources/zh_TW.lproj/RemoteDesktopMenu.nib" , should be drwxr-xr-x , they are -rwxr-xr-x .
    Repaired "System/Library/CoreServices/Menu Extras/RemoteDesktop.menu/Contents/Resources/zh_TW.lproj/RemoteDesktopMenu.nib" .
    One in particular gave me a Warning and said it could not be repaired.  I'm not sure if it is important to repair but I still seem to be having some issues here and there.  Here is the message from the Disk Utility regarding the file in question.
    Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired.

Maybe you are looking for