Methods Vs FM

Hi Gurus,
Please clarify my query.
I have been using some of the methods in Objects (can also be done by using Functional Modules).
For an effective OO programming , the usage of functional modules are acceptable or not?
Thanks

Hello Raja,
Object oriented programming is mainly used when we need to cater to the requirement of simulating characteristics and behaviour of mulitple instants (or real life objects) of a specific type (class).
It is this advantage of multiple instantiation that leads us to use classes and objects. A class has atrributes and methods to describe characteristics and behaviour of real life entities respectively. Inside your method implementation if required you can use function modules, there is nothing wrong in that, but function modules should not be written as independent modularisation unit in a program written completely in object oriented manner.
1 more thing - function groups and function modules support encapsulation - a property of object oriented programming - global data of function group can be accessed only by function modules of that function group - but function groups and function modules do not support multiple instantiation unlike classes in object oriented programming. So if you need multiple instantiation you should use classes and methods instead of function groups and function modules.
Hope this clarifies.
Regards
Indrajit

Similar Messages

  • Error while calling a method on Bean (EJB 3.0)

    I am getting an error while calling a method on EJB. I am using EJB3.0 and my bean is getting properly deployed(i am sure b'cos i can see the successfullly deployed message). Can any body help me
    Error is -->
    Error while destroying resource :An I/O error has occured while flushing the output - Exception: java.io.IOException: An established connection was aborted by the software in your host machine
    Stack Trace:
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
    at sun.nio.ch.IOUtil.write(IOUtil.java:75)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
    at com.sun.enterprise.server.ss.provider.ASOutputStream.write(ASOutputStream.java:138)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at org.postgresql.PG_Stream.flush(PG_Stream.java:352)
    at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159)
    at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.rollback(AbstractJdbc1Connection.java:1031)
    at org.postgresql.jdbc2.optional.PooledConnectionImpl$ConnectionHandler.invoke(PooledConnectionImpl.java:223)
    at $Proxy34.close(Unknown Source)
    at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:274)
    at com.sun.enterprise.resource.LocalTxConnectorAllocator.destroyResource(LocalTxConnectorAllocator.java:103)
    at com.sun.enterprise.resource.AbstractResourcePool.destroyResource(AbstractResourcePool.java:603)
    at com.sun.enterprise.resource.AbstractResourcePool.resourceErrorOccurred(AbstractResourcePool.java:713)
    at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:424)
    at com.sun.enterprise.resource.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:393)
    at com.sun.enterprise.resource.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:69)
    at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:618)
    at com.sun.gjc.spi.ConnectionHolder.close(ConnectionHolder.java:163)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:379)
    at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:367)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:402)
    at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.afterJTSTransaction(DatasourceAccessor.java:100)
    at oracle.toplink.essentials.threetier.ClientSession.afterTransaction(ClientSession.java:104)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.afterTransaction(UnitOfWorkImpl.java:1816)
    at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.afterCompletion(AbstractSynchronizationListener.java:161)
    at oracle.toplink.essentials.transaction.JTASynchronizationListener.afterCompletion(JTASynchronizationListener.java:87)
    at com.sun.ejb.containers.ContainerSynchronization.afterCompletion(ContainerSynchronization.java:174)
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:467)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
    at $Proxy84.addDepartment(Unknown Source)
    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:585)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    End of Stack Trace
    |#]
    RAR5035:Unexpected exception while destroying resource. To get exception stack, please change log level to FINE.
    EJB5018: An exception was thrown during an ejb invocation on [DepartmentSessionBean]
    javax.ejb.EJBException: Unable to complete container-managed transaction.; nested exception is: javax.transaction.SystemException
    javax.transaction.SystemException
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:452)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
    at $Proxy84.addDepartment(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    Means theres an error in XML/ABAP conversion probably due a syntax error...
    Regards
    Juan

  • Issue with SharePoint foundation 2010 to use Claims Based Auth with Certificate authentication method with ADFS 2.0

    I would love some help with this issue.  I have configured my SharePoint foundation 2010 site to use Claims Based Auth with Certificate authentication method with ADFS 2.0  I have a test account set up with lab.acme.com to use the ACS.
    When I log into my site using Windows Auth, everything is great.  However when I log in and select my ACS token issuer, I get sent, to the logon page of the ADFS, after selected the ADFS method. My browser prompt me which Certificate identity I want
    to use to log in   and after 3-5 second
     and return me the logon page with error message “Authentication failed” 
    I base my setup on the technet article
    http://blogs.technet.com/b/speschka/archive/2010/07/30/configuring-sharepoint-2010-and-adfs-v2-end-to-end.aspx
    I validated than all my certificate are valid and able to retrieve the crl
    I got in eventlog id 300
    The Federation Service failed to issue a token as a result of an error during processing of the WS-Trust request.
    Request type: http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue
    Additional Data
    Exception details:
    Microsoft.IdentityModel.SecurityTokenService.FailedAuthenticationException: MSIS3019: Authentication failed. ---> System.IdentityModel.Tokens.SecurityTokenValidationException:
    ID4070: The X.509 certificate 'CN=Me, OU=People, O=Acme., C=COM' chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. 'A certification chain processed
    correctly, but one of the CA certificates is not trusted by the policy provider.
    at Microsoft.IdentityModel.X509CertificateChain.Build(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509NTAuthChainTrustValidator.Validate(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler.ValidateToken(SecurityToken token)
    at Microsoft.IdentityModel.Tokens.SecurityTokenElement.GetSubject()
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
    --- End of inner exception stack trace ---
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.BeginGetScope(IClaimsPrincipal principal, RequestSecurityToken request, AsyncCallback callback, Object state)
    at Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService.BeginIssue(IClaimsPrincipal principal, RequestSecurityToken request, AsyncCallback callback, Object state)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.DispatchRequestAsyncResult..ctor(DispatchContext dispatchContext, AsyncCallback asyncCallback, Object asyncState)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.BeginDispatchRequest(DispatchContext dispatchContext, AsyncCallback asyncCallback, Object asyncState)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.ProcessCoreAsyncResult..ctor(WSTrustServiceContract contract, DispatchContext dispatchContext, MessageVersion messageVersion, WSTrustResponseSerializer responseSerializer, WSTrustSerializationContext
    serializationContext, AsyncCallback asyncCallback, Object asyncState)
    at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceContract.BeginProcessCore(Message requestMessage, WSTrustRequestSerializer requestSerializer, WSTrustResponseSerializer responseSerializer, String requestAction, String responseAction, String
    trustNamespace, AsyncCallback callback, Object state)
    System.IdentityModel.Tokens.SecurityTokenValidationException: ID4070: The X.509 certificate 'CN=Me, OU=People, O=acme., C=com' chain building
    failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. 'A certification chain processed correctly, but one of the CA certificates is not trusted by the policy provider.
    at Microsoft.IdentityModel.X509CertificateChain.Build(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509NTAuthChainTrustValidator.Validate(X509Certificate2 certificate)
    at Microsoft.IdentityModel.Tokens.X509SecurityTokenHandler.ValidateToken(SecurityToken token)
    at Microsoft.IdentityModel.Tokens.SecurityTokenElement.GetSubject()
    at Microsoft.IdentityServer.Service.SecurityTokenService.MSISSecurityTokenService.GetOnBehalfOfPrincipal(RequestSecurityToken request, IClaimsPrincipal callerPrincipal)
    thx
    Stef71

    This is perfectly correct on my case I was not adding the root properly you must add the CA and the ADFS as well, which is twice you can see below my results.
    on my case was :
    PS C:\Users\administrator.domain> $root = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\
    cer\SP2K10\ad0001.cer")
    PS C:\Users\administrator.domain> New-SPTrustedRootAuthority -Name "domain.ad0001" -Certificate $root
    Certificate                 : [Subject]
                                    CN=domain.AD0001CA, DC=domain, DC=com
                                  [Issuer]
                                    CN=domain.AD0001CA, DC=portal, DC=com
                                  [Serial Number]
                                    blablabla
                                  [Not Before]
                                    22/07/2014 11:32:05
                                  [Not After]
                                    22/07/2024 11:42:00
                                  [Thumbprint]
                                    blablabla
    Name                        : domain.ad0001
    TypeName                    : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
    DisplayName                 : domain.ad0001
    Id                          : blablabla
    Status                      : Online
    Parent                      : SPTrustedRootAuthorityManager
    Version                     : 17164
    Properties                  : {}
    Farm                        : SPFarm Name=SharePoint_Config
    UpgradedPersistedProperties : {}
    PS C:\Users\administrator.domain> $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\
    cer\SP2K10\ADFS_Signing.cer")
    PS C:\Users\administrator.domain> New-SPTrustedRootAuthority -Name "Token Signing Cert" -Certificate $cert
    Certificate                 : [Subject]
                                    CN=ADFS Signing - adfs.domain
                                  [Issuer]
                                    CN=ADFS Signing - adfs.domain
                                  [Serial Number]
                                    blablabla
                                  [Not Before]
                                    23/07/2014 07:14:03
                                  [Not After]
                                    23/07/2015 07:14:03
                                  [Thumbprint]
                                    blablabla
    Name                        : Token Signing Cert
    TypeName                    : Microsoft.SharePoint.Administration.SPTrustedRootAuthority
    DisplayName                 : Token Signing Cert
    Id                          : blablabla
    Status                      : Online
    Parent                      : SPTrustedRootAuthorityManager
    Version                     : 17184
    Properties                  : {}
    Farm                        : SPFarm Name=SharePoint_Config
    UpgradedPersistedProperties : {}
    PS C:\Users\administrator.PORTAL>

  • Using G_SET_GET_ALL_VALUES Method

    Hi,
    I need to use the following method. G_SET_GET_ALL_VALUES. But I'm not sure of the data type that it returns.
    CALL FUNCTION 'G_SET_GET_ALL_VALUES'
      EXPORTING
      CLIENT                      = ' '
      FORMULA_RETRIEVAL           = ' '
      LEVEL                       = 0
        setnr                       = wa_itab_progrp-setname
      VARIABLES_REPLACEMENT       = ' '
      TABLE                       = ' '
      CLASS                       = ' '
      NO_DESCRIPTIONS             = 'X'
      NO_RW_INFO                  = 'X'
      DATE_FROM                   =
      DATE_TO                     =
      FIELDNAME                   = ' '
      tables
        set_values                  = ????????
    EXCEPTIONS
      SET_NOT_FOUND               = 1
      OTHERS                      = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Can anyone please let me know what I should do at the SET_VALUES section.
    Thanks
    Lilan

    Hi,
    See the FM Documentation,
    This function module determines all the values of a set or its subordinate sets. The required call parameter is the set ID (SETNR). The other parameters are optional:
    FORMULA_RETRIEVAL: 'X' => The formulas in the set are also returned (default ' ' requires fewer database accesses)
    LEVEL: The default value is 0 and means "expand all levels". Values other than 0 determine the level to which they are to be expanded
    VARIABLES_REPLACEMENT: 'X' => The value variables in the set hierarchy are replaced by their default values (this means additional database accesses for each variable)
    NO_DESCRIPTIONS: 'X' => The short descriptions of the sets and set lines are not read from the database. For performance reasons you should only set this parameter to ' ' if you need the texts
    The values determined are returned to the internal table SET_VALUES.
    Thanks.

  • Clearing values from request in decode method

    I am using a custom table paginator. In its ‘decode’ method I have the next code to control whether ‘next’ link is clicked:
    String pLink = (String)requestMap.get("pLink" + clientId);
    if ((pLink != null) && (!pLink.equals(""))) {
         if (pLink.equals("next")) {     
         } else if (pLink.equals("previous")) {
    }But the next sequence produces some problems:
    1.     Initial page load.
    2.     Click on ‘next’ link.
    3.     Table navigates ok to next page.
    4.     Reload page (push F5).
    5.     The previous click still remains in the request, so decode method think ‘next’ link is pressed again.
    6.     Application abnormal behaviour arises.
    So, I am trying to clear the ‘next_link’ key from the request, but next code throws an UnsupportedOperationException:
    String pLink = (String)requestMap.get("pLink" + clientId);
    if ((pLink != null) && (!pLink.equals(""))) {
         if (pLink.equals("next")) {     
         } else if (pLink.equals("previous")) {
         requestMap.put("pLink" + clientId, "");
    }Do any of you have some ideas?

    Hey, where are you RaymondDeCampo, rLubke, BalusC ... the masters of JSF Universe?
    ;-)

  • Method all values from row

    Hi,
    Is there a method that get the all the values of a row? I've gone through the java api but didn't found one, but wanted to be sure.
    If not I'll have to do getValueAt for every column?
    Grtz

    Here is one possible implementation using RowTableModel (a self made class).
    To access a row, we can use this: Product product = (Product) model.getRow(rowIndex);
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    public class Tabel extends JPanel {
        private JTable table;
        private JTextField filterText;
        private TableRowSorter<MyTableModel> sorter;
        private String output;
        private final MyTableModel model;
        public Tabel() {
            //Create a table with a sorter.
            model = new MyTableModel();
            sorter = new TableRowSorter<MyTableModel>(model);
            table = new JTable(model);
            table.setRowSorter(sorter);
            table.setPreferredScrollableViewportSize(new Dimension(500, 200));
            table.setFillsViewportHeight(true);
            //Single selection
            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            //Making sure columns can't be dragged and dropped
            table.getTableHeader().setReorderingAllowed(false);
            //Double click event
            table.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent mouseEvent) {
                    if (mouseEvent.getClickCount() == 2) {
                        System.out.print(output);
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            add(scrollPane);
            JPanel form = new JPanel();
            JLabel l1 = new JLabel("Filter Text:");
            form.add(l1);
            filterText = new JTextField(15);
            //Whenever filterText changes, invoke newFilter.
            filterText.getDocument().addDocumentListener(
                    new DocumentListener() {
                        public void changedUpdate(DocumentEvent e) {
                            newFilter();
                        public void insertUpdate(DocumentEvent e) {
                            newFilter();
                        public void removeUpdate(DocumentEvent e) {
                            newFilter();
            l1.setLabelFor(filterText);
            form.add(filterText);
            add(form);
         * Update the row filter regular expression from the expression in
         * the text box.
        private void newFilter() {
            RowFilter<MyTableModel, Object> rf = null;
            //If current expression doesn't parse, don't update.
            try {
                rf = RowFilter.regexFilter("(?i)" + filterText.getText(), 0); //"(?i)" => Zoeken gebeurd case-insensitive
            } catch (java.util.regex.PatternSyntaxException e) {
                return;
            sorter.setRowFilter(rf);
        class MyTableModel extends RowTableModel {
            private final List<Product> mData;
            private final List<String> cNames;
            public MyTableModel() {
                super(Product.class);
                mData = new ArrayList<Product>();
                mData.add(new Product("Frontline Small", 5, 1));
                mData.add(new Product("Frontline Medium", 10, 2));
                mData.add(new Product("Frontline Large", 15, 1));
                mData.add(new Product("Frontline Extra Large", 20, 2));
                mData.add(new Product("Frontline spuitbus", 7.5, 3));
                cNames = new ArrayList<String>();
                cNames.add("Product");
                cNames.add("Prijs");
                cNames.add("Aantal stuks beschikbaar");
                setDataAndColumnNames(mData, cNames);
                setColumnClass(0, String.class);
                setColumnClass(1, Double.class);
                setColumnClass(2, Integer.class);
            public Object getValueAt(final int rowIndex, final int columnIndex) {
                switch (columnIndex) {
                    case 0:
                        return mData.get(rowIndex).getDescriction();
                    case 1:
                        return mData.get(rowIndex).getPrice();
                    case 2:
                        return mData.get(rowIndex).getNumber();
                return null;
            @Override
            public Class getColumnClass(int column) {
                return super.getColumnClass(column);
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            Tabel newContentPane = new Tabel();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(final String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    class Product {
        private String descriction;
        private double price;
        private int number;
        Product(final String descriction, final double price, final int number) {
            this.descriction = descriction;
            this.price = price;
            this.number = number;
        public String getDescriction() {
            return descriction;
        public void setDescriction(final String descriction) {
            this.descriction = descriction;
        public int getNumber() {
            return number;
        public void setNumber(final int number) {
            this.number = number;
        public double getPrice() {
            return price;
        public void setPrice(final int price) {
            this.price = price;
        @Override
        public String toString() {
            return descriction + ", " + price + ", " + number;
    }

  • How can I move an ArrayList from one method to another?

    As the subject reveals, I want to know how I move an ArrayList. In one method, I fill my ArrayList with objects, and in the next I want to pick an arbitrary object out of the ArrayList.
    How do I make this work??

    You pass the same array list to both the method. Both method are getting the same thing.
    void main(){
    //create array list here
    ArrayList aList = new ArrayList();
    //pass it to a method to fill items
    fillArrayList(aList);
    //pass the same arraylist to another method
    printArrayList(aList);
    void fillArrayList(ArrayList list){
      list.add("A");
    void printArrayList(ArrayList list){
    //The array list will contain A added by the previos method
    System.out.println(list);
    FeedFeeds : http://www.feedfeeds.com                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • HT1918 Can I have multiple payment methods on one account

    Currently, both of my teenage sons and I are sharing an Apple account with one payment method. I would like to have a payment method for each of us.

    If they are teenagers, it is not too soon to set up individual accounts per person. 
    This will address the separate payments issue, and will make it much easier in a few years when they start heading off to university or moving to their own living arrangements.

  • A method to convert an existing iCloud account to a Child iCloud Account for Family Sharing

    I do not see any method by which to convert an existing iCloud account (we have three set up for our kids, all their birthdays are set later than their actual birthdays so we could grab their actual names before they were all gone years ago) to a new Child iCloud Account for use with Family Sharing (namely to be able to take advantage of the new features: Family Calendar, Photostream, 'Ask to Buy' on the Stores, etc. on their own iPad minis.
    If this is just not possible under the current scheme, please oh please Apple make this an option - there are probably thousands of others in this same boat, and I refuse to give up my kids' iCloud accounts!

    I've read every string and workaround solution on these forums (to date). There's really no good options here.
    USER STORY: My kid (age 7) has an iPad 2.  I created an email address for him (which he doesn't know about). I created an apple ID for him (which he also doesn't know or care about) and I set up his Apple ID with my credit card.  In addition I've set up parental controls on the iPad to lock it down and make it more age appropriate.   Over the past year or so it's worked out fine, he sees something he might like, brings the iPad to me and if I approve, I enter the Apple ID Password  and approve the purchase.   After a year of doing this, he has a nice little collection of apps, kid songs, a few movies, etc.   I would like to move my kid over to a legitimate kid account now that Apple has released features that support this.  Currently the ability to convert an account does not exist. Seems like it should be easy to change a birthday, etc.
    Almost seems like Apple is penalizing us for getting our kid an iPad last year. 
    Apple  - Please consider my user story for your upcoming feature enhancements.

  • How can i execute ejb method in a servlet?

    hi
    I am using a IBM HTTP Server and Weblogic Server.
    I could execute below source in a main method of application but i could not that in a init method of servlet because of ClassCastException.
    (a classpath of weblogic contains client's classpath)
    // source code
    Hashtable props = new Hashtable();
    props.pu(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,
    "t3://192.168.1.5:7001");
    Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("session.LigerSessionHome");
    LigerSessionHome home = (LigerSessionHome) PortableRemoteObject.narrow (obj, LigerSessionHome.class);
    // error code
    Exception : session.LigerSessionBeanHomeImpl_ServiceStub
    java.lang.ClassCastException: session.LigerSessionBeanHomeImpl_ServiceStub
    at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:253)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
    at credit.getCreditResearch(credit.java:41)
    at creditResearchClient.doGet(creditResearchClient.java:122)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    thanks

    Have your stubs somehow got out of sync? So that your Servlet engine is pointing to a different jar than that of your jvm on which you were running your client application
    hi
    I am using a IBM HTTP Server and Weblogic Server.
    I could execute below source in a main method of
    application but i could not that in a init method of
    servlet because of ClassCastException.
    (a classpath of weblogic contains client's classpath)
    // source code
    Hashtable props = new Hashtable();
    props.pu(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,
    "t3://192.168.1.5:7001");
    Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("session.LigerSessionHome");
    LigerSessionHome home = (LigerSessionHome)
    PortableRemoteObject.narrow (obj,
    LigerSessionHome.class);
    // error code
    Exception :
    session.LigerSessionBeanHomeImpl_ServiceStub
    java.lang.ClassCastException:
    session.LigerSessionBeanHomeImpl_ServiceStub
    at
    com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(Porta
    leRemoteObject.java:253)
    at
    javax.rmi.PortableRemoteObject.narrow(PortableRemoteObj
    ct.java:136)
    at credit.getCreditResearch(credit.java:41)
    at
    creditResearchClient.doGet(creditResearchClient.java:12
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java
    740)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java
    865)
    thanks

  • Can I use classes and methods for a maintenance view events?

    Hello experts,
    Instead of perform/form, can I instead use classes and methods, etc for a given maintenance view event, lets say for example I want to use event '01' which is before saving records in the database. Help would be greatly appreciated. Thanks a lot guys!

    Hi viraylab,
    1. The architecture provided by maintenance view
       for using EVENTS and our own code inside it -
       It is provided using FORM/PERFORM
       concept only.
    2. At this stage,we cannot use classes.
    3. However, inside the FORM routine,
       we can write what ever we want.
       We can aswell use any abap code, including
       classes and methods.
      (But this classes and methods won't have any
       effect on the EVENT provided by maintenance view)
    regards,
    amit m.

  • How to call a specific method in a servlet from another servlet

    Hi peeps, this post is kinda linked to my other thread but more direct !!
    I need to call a method from another servlet and retrieve info/objects from that method and manipulate them in the originating servlet .... how can I do it ?
    Assume the originating servlet is called Control and the servlet/method I want to access is DAO/login.
    I can create an object of the DAO class, say newDAO, and access the login method by newDAO.login(username, password). Then how do I get the returned info from the DAO ??
    Can I use the RequestDispatcher to INCLUDE the call to the DAO class method "login" ???
    Cheers
    Kevin

    Thanks for the reply.
    So if I have a method in my DAO class called login() and I want to call it from my control servlet, what would the syntax be ?
    getrequestdispatcher.include(newDAO.login())
    where newDAO is an instance of the class DAO, would that be correct ?? I'd simply pass the request object as a parameter in the login method and to retrieve the results of login() the requestdispatcher.include method will return whatever I set as an attribute to the request object, do I have that right ?!!!!
    Kevin

  • How to select a specific column in a bean method?

    Hey everyone,
    I'm trying to select a specific column in my adf table so i can hightlight the ones i can after, with a method bean that does a match from another table. I'm using JDeveloper 12.1.2.0.0.
    Here's my table at the moment (its a static list that Timo and Alejandro helped me create, thanks to them again!):
    <af:table value="#{bindings.Anos1.collectionModel}" var="row"
                                                              rows="#{bindings.Anos1.rangeSize}"
                                                              emptyText="#{bindings.Anos1.viewable ? 'No data to display.' : 'Access Denied.'}"
                                                              rowBandingInterval="0" fetchSize="#{bindings.Anos1.rangeSize}"
                                                              filterModel="#{bindings.Anos1Query.queryDescriptor}"
                                                              queryListener="#{bindings.Anos1Query.processQuery}"
                                                              filterVisible="false" varStatus="vs" id="t5"
                                                              styleClass="AFStretchWidth" columnSelection="multiple"
                                                              inlineStyle="max-width:100%;" columnStretching="multiple"
                                                              columnSelectionListener="#{ControlBean.onAnoColumnSelect}"
                                                              disableColumnReordering="true"
                                                              binding="#{ControlBean.dimAnos}">
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2011.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2011"
                                                                   id="c54" width="16%">
                                                            <af:outputText value="#{row.A2011}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2011.tooltip}"
                                                                           id="ot54">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2011.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2012.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2012"
                                                                   id="c55" width="16%">
                                                            <af:outputText value="#{row.A2012}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2012.tooltip}"
                                                                           id="ot55">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2012.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                        <af:column sortProperty="#{bindings.Anos1.hints.A2013.name}"
                                                                   filterable="true" sortable="false"
                                                                   headerText="2013"
                                                                   id="c56" width="16%">
                                                            <af:outputText value="#{row.A2013}"
                                                                           shortDesc="#{bindings.Anos1.hints.A2013.tooltip}"
                                                                           id="ot56">
                                                                <af:convertNumber groupingUsed="false"
                                                                                  pattern="#{bindings.Anos1.hints.A2013.format}"/>
                                                            </af:outputText>
                                                        </af:column>
                                                    </af:table>
    I've deleted some of the columns because they are all equal and by doing so, you have less problems in reading it.
    In my method i have a matchEm but i'm trying to select a column by using this line:
            dimAnos.setColumnSelection("A2012");
    dimAnos is the binding for my table Anos (Years in Portuguese). I even tried another values fro the columnSelection but i couldn't make it selected. Am i doing anything wrong?
    Please help me or give me an idea of how can i do this.
    Regards,
    Frederico.

    Hi Frederico,
    The method setColumnSelection is meant to set whether your table supports column selection or not. It doesn't select the column. In order to select the column, you need to set the column attribute Selected to true. So I don't know if its an option for you but you can create a binding to all the columns you have in you bean, and then call the method A2012.setSelected(true), and then add a partial target to the table to re render it and show the selected column.
    Hope this helps

  • Error while adding a new method to the Session Bean

    Hello everyone. I'm using jdev 11g, ejb, jpa & jsf. Everything works fine. But when I try to add a custom method to the Session Bean, I'm having an error.
    Here is my steps:
    1) I added a new method to SessionBean.java. Something like this:
    public void Hello() {
    System.out.println("Hello!");
    2) Then using Structure palette I exposed this method through Local interface and created data control
    3) Finally, I made a command button binded to this method (just droped it from DataControls.dcx to my page)
    When I start the page and click the button, I'm having the following error:
    Error 500--Internal Server Error
    javax.faces.el.EvaluationException: Method not found: Hello.execute(javax.faces.event.ActionEvent)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1227)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:70)
    ... (I've truncated the log because there is nothing important in the missing part)

    Yes, I have binding in the page def. Everything is correct there:
    <methodAction id="Hello" RequiresUpdateModel="true" Action="invokeMethod"
    MethodName="Hello" IsViewObjectMethod="false"
    DataControl="PriceServiceLocal"
    InstanceName="PriceServiceLocal.dataProvider"/>
    I've droped the method from the Data Controls panel

  • Error while making a method in a file application

    Hi !!!. How's all ?. My name is Agustin and I live in C&oacute;rdoba (in the centre of Argentina) !!!. I would like to know if anyone can see if there is something wrong with this code !. The thing I tried to make is the following...
    This program stores in a file songs... In this case, the author, the name of the song, the song and the length of thwe song...
    I tried to make a method that returns the name of the songs that have certain words... Let say I type: "love goodbye"... the program will search in the file and returns for ex:
    The songs which has "love" are:
    Marcela Gandara - Antes de ti.
    Jesus Adrian Romero - Me dice que me ama.
    The songs which has "goodbye" are:
    bla bla
    bla bla
    Hope you understand... Here is the code... What I want to know is the mistake I'm making... If you want the complete code, just send a mail or add me to the msn... [email protected]
    public String buscadorLetras(String busq)
    String auxF="";
    String auxVec="";
    int cant=0,band=0,num=0;
    String aux="",aut="",let="",nomLet="";
    String[] palabras=busq.trim().split(" ");
    String[] palAux=busq.trim().split(" ");
    for(int i=0;i<palabras.length;i++)
    if(palabras.length()<1000)
    for(int j=palabras[i].length();j<1000;j++)
    palabras[i]+=" ";
    else
    palabras[i]=palabras[i].substring(0,1000);
    try
    for(int i=0;i<palabras.length;i++)
    flujo.seek(0);
    while(flujo.getFilePointer()<flujo.length())
    for(int j=0;j<1000;j++)
    aut+=flujo.readChar();
    for(int j=0;j<1000;j++)
    nomLet+=flujo.readChar();
    for(int j=0;j<1000;j++)
    let+=flujo.readChar();
    cant=flujo.readInt();
    if(let.indexOf(palabras[i])>=0)
    band=1;
    if(band==1)
    aux+="\n"+nomLet;
    num++;
    band=0;
    if(flujo.getFilePointer()==flujo.length())
    auxF+="Las letras con la palabra "+palAux[i]+" son "+num+" - Lista:\n"+aux;
    num=0;
    aut="";
    nomLet="";
    let="";
    band=0;
    catch(IOException e)
    {e.printStackTrace();}
    return auxF;

    public String buscadorLetras(String busq)
    String auxF="";
    String auxVec="";
    int cant=0,band=0,num=0;
    String aux="",aut="",let="",nomLet="";
    String[] palabras=busq.trim().split(" ");
    String[] palAux=busq.trim().split(" ");
    for(int i=0;i<palabras.length;i++)
    if(palabras.length()<1000)
    for(int j=palabras[i].length();j<1000;j++)
    palabras[i]+=" ";
    else
    palabras[i]=palabras[i].substring(0,1000);
    try
    for(int i=0;i<palabras.length;i++)
    flujo.seek(0);
    while(flujo.getFilePointer()<flujo.length())
    for(int j=0;j<1000;j++)
    aut+=flujo.readChar();
    for(int j=0;j<1000;j++)
    nomLet+=flujo.readChar();
    for(int j=0;j<1000;j++)
    let+=flujo.readChar();
    cant=flujo.readInt();
    if(let.indexOf(palabras[i])>=0)
    band=1;
    if(band==1)
    aux+="\n"+nomLet;
    num++;
    band=0;
    if(flujo.getFilePointer()==flujo.length())
    auxF+="Las letras con la palabra "palAux[i]" son "num" - Lista:\n"+aux;
    num=0;
    aut="";
    nomLet="";
    let="";
    band=0;
    catch(IOException e)
    {e.printStackTrace();}
    return auxF;
    }Edited by: agustinCba on Jan 20, 2009 6:49 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while opening a dwg file :java.lang.NoSuchMethodException: Method

    Hello Experts,
    I tried to integrate WebCenter Content with Autovue ,the integration was good untill i get this error while trying to open a dwg file checked in Content Server using View in Autovue option in Actions :
    java.lang.NoSuchMethodException: Method fileOpen(com.cimmetry.core.SessionID, com.cimmetry.core.DocID, com.cimmetry.core.Authorization, <null>, java.lang.Boolean, <null>) not found in class com.cimmetry.jvueserver.VCETConnection
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ar.d(Unknown Source)
         at com.cimmetry.jvueserver.ar.a(Unknown Source)
         at com.cimmetry.jvueserver.ah.run(Unknown Source)
    Any suggestions would help me,
    Thanks in Advance
    Raj

    Hi Raj,
    The solution to this problem is posted in My Oracle Support:
    Error: "java.lang.NoSuchMethodException: Method fileOpen" when Trying to View Files Using AutoVue Integrated to Oracle Universal Content Management (UCM) (Doc ID 1341644.1).
    It has all the details, step by step.
    Jeff

Maybe you are looking for

  • DVD/Blueray drive not working

    I tried to put a DVD and a blueray disk in laptop.  error E: application not found.  My laptop is 9 months old.  I haven't used the drive until now.  Satellite S875D-S7350.  If I download the driver for the dvd-blueray will that fix the problem?  It

  • Photo Quality Difference - DVD Slide Show vs iMovie

    I have seen a marked difference in quality of photos in iDVD slide shows vs photos I've incorporated in iMovie. The iMovie rendered photos are very high resolution and fill the screen, whereas photos rendered as a slide show in iDVD are of poor resol

  • Modifying SQL query

    Hi, Please find my query below: SELECT T2.STATUS               ,COUNT(*) CNT         FROM (               SELECT T1.ID, MAX(T1.STATUS_ID) STATUS_ID               FROM TABLE1 T1               WHERE  TRUNC(T1.START_DT) >= TO_DATE(RegisteredDateFrom,'dd

  • Cache sequence

    Hi All, I have a straight insert/select - insert into t_tab (p_id, p_name, p_ser_id, p_flag) select my_seq.nextval, p_name, p_ser_id, p_flag from my_table The table my_table has about 500K records. It takes lot of time. Most time spent that sequence

  • Would appreciate some help with this.

    Hello, I have a class that looks like this: import extra.*; public class Bokhylla { int x; public Bok[] b?cker = new Bok[x]; public Bokhylla(int antal) { x = antal; The problem is that I want x in my array to be set from the constructor, but the code