How to add list of objects of class to the cookie in java

Hi all ,
I have arraylist of the object of clases like
                       List<CLASSNAME> sampleList = new arrayList<CLASSNAME>;where CLASSNAME contains getter,setters of fields
How can I add this sampleList to the cookies because cookie only contain cookie name and cookie value which is string only.
    public void createNewCookie(String cookieName, String cookieValue, int cookieMaxAge){
    HttpServletResponse httpServletResponse = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
    Cookie cookie = new Cookie(cookieName, cookieValue);
    cookie.setMaxAge(cookieMaxAge);
    httpServletResponse.addCookie(cookie);
    public String getCookie(String cookieName){
    FacesContext vFacesContext = FacesContext.getCurrentInstance();
    ExternalContext vExternalContext = vFacesContext.getExternalContext();
    Map vRequestCookieMap = vExternalContext.getRequestCookieMap();
    Cookie vMyCookie = (Cookie)vRequestCookieMap.get(cookieName);
    if(vMyCookie != null)
       return vMyCookie.getValue();
    else
    return null;
   

Hi Timo,
My requirement is as follow.
When anonymous user visit the website he can add the list of items he checked to buy .Add these items to list.
When any user logged in assign this list to the that logged in user.When user logged out clear this list.
So i think I have to put this list in the SessionScope it will be the best.
But what about anonymous users . When many anonymous users visit the websites can they have different list according to the anonymous user in session scope

Similar Messages

  • How to extract List of Objects and Classes in BO

    Hi
    I need to get a list of all Classes and Objects in a universe.
    Is there a way to extract this list in an excel.
    I dont need the PDF file which can be saved from a universe with all the universe information.
    I just need a plain excel file with the classes, objects under it, object definitions etc.
    Is there a VBA code to do so?
    I know there is one to extract the user info from CMS.
    Please help.
    Thanks in advance.

    Option Explicit
    Dim DesignerApp As Designer.Application
    Dim Univ As Designer.Universe
    Dim Wksht As Excel.Worksheet
    Sub GetInfo()
        Set DesignerApp = New Designer.Application
        DesignerApp.Visible = True
        Call DesignerApp.LoginAs
        Set Univ = DesignerApp.Universes.Open
        'DesignerApp.Visible = False
        Set Wksht = ThisWorkbook.Worksheets("Objects")
        Wksht.Unprotect
        Wksht.Columns().ClearContents
        Wksht.Cells(1, 1) = "Class"
        Wksht.Cells(1, 2) = "Objects"
        Wksht.Cells(1, 3) = "Table Reference"
        Wksht.Cells(1, 4) = "Object Description"
        Wksht.Cells(1, 5) = "Object Type"
        Wksht.Cells(1, 6) = "Qualification"
        Call GetObjectInfo(Univ.Classes, 1)
        Wksht.Protect
        DesignerApp.Quit
        Set DesignerApp = Nothing
    End Sub
    Private Sub GetObjectInfo(Clss, RowNum As Long)
        Dim Cls As Designer.Class
        Dim Obj As Designer.Object
        For Each Cls In Clss
            For Each Obj In Cls.Objects
                RowNum = RowNum + 1
                Wksht.Cells(RowNum, 1) = Cls.Name
                Wksht.Cells(RowNum, 2) = Obj.Name
                Wksht.Cells(RowNum, 3) = Obj.Select
                Wksht.Cells(RowNum, 4) = Obj.Description
                If Obj.Type = 2 Then
                    Wksht.Cells(RowNum, 5) = "Character"
                ElseIf Obj.Type = 3 Then
                    Wksht.Cells(RowNum, 5) = "Date"
                ElseIf Obj.Type = 1 Then
                    Wksht.Cells(RowNum, 5) = "Number"
                Else
                    Wksht.Cells(RowNum, 5) = "Long Text"
                End If
                If Obj.Qualification = dsDimensionObject Then Wksht.Cells(RowNum, 6) = "Dimension"
                If Obj.Qualification = dsDetailObject Then Wksht.Cells(RowNum, 6) = "Detail"
                If Obj.Qualification = dsMeasureObject Then Wksht.Cells(RowNum, 6) = "Measure"
            Next Obj
            If Cls.Classes.Count > 0 Then
                Call GetObjectInfo(Cls.Classes, RowNum)
            End If
        Next Cls
    End Sub
    Above is the macro to document BO universes (Classes, Objects, TableName.FieldName, Object description, Object Type and Object Qualification ).
    You need to open the excel sheet->Go to TOOLS> MACRO --->VB EDITOR (Alt+F11) and paste this code in MODULE1
    To run the macro, You need to press Alt+F8 key and Click RUN button. Then designer window pops out, enter user id and password and select the required universe.
    Enjoy Macro

  • How to add a container object in a station globals

    Hi,
    How to add a container object in a station globals

    Hi radlou,
    This might be what you're looking for:
    NewSubProperty Method
    Syntax
    PropertyObject.NewSubProperty ( lookupString, ValueType, asArray, typeNameParam, options)
    Purpose
    Creates a new subproperty with the name the lookupString parameter specifies.
    Parameters
    lookupString As String
    [In] Pass the lookup string for the new subproperty to be created. If you pass a lookup string with multiple levels (such as "x.y.z"), this method creates all of the necessary intermediate container objects. Refer to lookup string for more information about the strings you can use.
    ValueType As PropertyValueTypes
    [In] Pass the type of value you want the new subproperty to store.
    asArray As Boolean
    [In] Pass True to make the new subproperty an array whose elements are of the type you specify in valueType.
    typeNameParam As String
    [In] Pass the name of an existing type if you want to create the new subproperty as an instance of a named type. Otherwise, pass an empty string. If you pass a type name, you must pass PropValType_NamedType for the ValueType parameter. Refer to NamedPropertyTypes for a list of built-in named types.
    options As Long
    [In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options. You do not need to pass the InsertIfMissing option to create the new subproperty. Pass DoNothingIfExists if you want the method to not report an error if the subproperty already exists.

  • How to add services for object in ECC6.0

    Hi everybody,
                        Can anybody tell me how to add "Services for Object" icon in ECC 6.0 because this icon is there in 4.6C but not coming in ECC 6.0.
    Thanks in Advance

    Hi Saurabh,
                Thanks for your reply. I have checked the path given by you...System-> Service for object, but it is showing no service available as told by you. Cud you please tell me how to add this service because this is working fine in 4.6C but I dont know how to add these services in ECC 6.0. If any code for this which is written in 4.6C which I can refer... please tell me where to see the code for adding services (in 4.6C)  b'coz its very urgent.

  • How to add list of multiple file types to file type of file dialog box in LabVIEW

    How to add list of multiple file types to file type of file dialog box in LabVIEW?
    In file dialog box there is option to add only one file type,in the list,not by seperating commas,
    regards,
    Naresh.N

    Write the file types in pattern Input string, separated by a semicolon ;
    For example:  *.vi;*.doc;*.jpeg;*.xls
    This should return the set of files with matching extensions
    Message Edited by devchander on 09-10-2008 08:02 AM
    Message Edited by devchander on 09-10-2008 08:03 AM

  • How to add a ChartOfAccounts object into the database.

    how to add a ChartOfAccounts object into the database. please shows sample code
    thanks

    Dim CoA As SAPbobsCOM.ChartOfAccounts
                CoA = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oChartOfAccounts)
                CoA.Code = 11223344
                CoA.ExternalCode = "a1234"
                CoA.ForeignName = "f Test Account"
                CoA.Name = "Test Account"
                CoA.AccountType = SAPbobsCOM.BoAccountTypes.at_Other
                CoA.ActiveAccount = SAPbobsCOM.BoYesNoEnum.tYES
                CoA.FatherAccountKey = 100001
                If CoA.Add <> 0 Then
                    MessageBox.Show(oCompany.GetLastErrorDescription)
                Else
                    MessageBox.Show("Added Account")
                End If
    Remember the father account key must be a valid account number in the company where you are trying to add the new account.  (The G/L Account code seen in the SBO client)

  • How to add more than one input arguments to the tpcall

    Hi
    Can any one know how to add more than one input arguments in the tpcall using WTC (Jatmi)?
    Par example, I have un service Tuxedo getConsoClient(char* cli_id, char* type)
    To call this service, I'm using tpcall("getConsoClient", dataIn, 0);
    here, I did't know how to add two parameters in the TypedBuffer object. I'm new to WTC.
    Any hints will be greatly appreaciated.
    Advanced thanks

    Thanks for you help. But in java Jatmi, I have lot of problem to convert array into TypedBuffer or TypedString. See below code, I'm tried using vector or tableau etc..
    But I have always same erreur. :(
    public void getClientInfo() {
         Context ctx;
         TuxedoConnection myTux;
         TypedString numinst = new TypedString("1");
         TypedString idClient = new TypedString("1003");
         TypedString[] dataIn = {numinst,idClient};
         //TypedString dataIn = new TypedString(numinst+"\0"+idClient+"\0");
         Vector input = new Vector();
         input.add(0,numinst);
         input.add(1,idClient);
         Reply rpy = null;
         try{          
              System.out.println("getClientInfo called : " + dataIn);
              TuxedoConnectionFactory tcf;               
              ctx = new InitialContext();
              tcf = (TuxedoConnectionFactory) ctx.lookup("tuxedo.services.TuxedoConnection");
              myTux = tcf.getTuxedoConnection();          
              System.out.println("About to call tpcall cnx = "+myTux);
              rpy = myTux.tpcall("LireInfoCli_SE",(TypedBuffer)dataIn, 0);          
              System.out.println("tpcall successfull!");
              TypedFML32 typ = (TypedFML32) rpy.getReplyBuffer();
              System.out.println("Reply Type = "+rpy.getReplyBuffer().getType());
              System.out.println("Reply toString = "+typ.toString());
              while(typ.Fiterator().hasNext()){
                   System.out.println("Reply toString = "+typ.Fiterator().next().toString());               
              myTux.tpterm(); // Closing the association with Tuxedo
         }catch (TPReplyException tpx) {
              // Could not get the tuxedo object, throw TPENOENT
              System.out.println("TPReplyException perrno = " + tpx.gettperrno()+" DETAILS "+tpx.gettperrordetail()+" getLocalizedMessage "+tpx.getLocalizedMessage()+" "+tpx.getCause());
              tpx.printStackTrace();
         }catch (TPException tpx1) {
              // Could not get the tuxedo object, throw TPENOENT
              System.out.println("TPReplyException perrno = " + tpx1.gettperrno()+" DETAILS "+tpx1.gettperrordetail()+" getLocalizedMessage "+tpx1.getLocalizedMessage()+" "+tpx1.getCause());
              tpx1.printStackTrace();
         }catch (NamingException ne) {
                   // Could not get the tuxedo object, throw TPENOENT
                   System.out.println("Could not get TuxedoConnectionFactory : " + ne.getMessage());
                   ne.printStackTrace();
         }catch(Exception e){
                   System.out.println("Exception in getClientInfo ->"+e.getMessage());
                   e.printStackTrace();
         return;
    }

  • How to add a new column (Project Number) in the action items table under NPD Module?

    There are two projects with same name and created by same person in NPD.
    So when it is displayed in "Action Items" table, It looks similar.
    To avoid this, I need one more column (Project Number) to be added in the "Action Items" table and " Strategic briefs and projects" table.
    So, How to add a new column (Project Number) in the "Action Items" table and " Strategic briefs and projects" table under NPD Module?
    Please do the needful.

    There is no out of the box configuration available to add columns to NPD action items.   As always we welcome enhancement requests. 
    Thanks
    Kelly

  • There ' is a panel that sayscopy' preparing to duplicate to "desktop". I clicked stop three days and it still trying to stop. Tried to 'force quit' does not show up, looked in activity monitor but i am not sure how it is listed. I am new to the mac world.

    there is panel in the upper right corner of my screen that says 'copy' preparing to duplicate to "desktop". I clicked stop three days ago and it is still trying to stop. Tried to 'force quit' does not show up in finder, looked in activity monitor but i am not sure how it is listed. I am new to the mac world.

    Force quit/Restart the Finder.
    Then for safety...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.

  • JSP: How do display list of objects in jsp table?

    sorry that my question my confuse you, let me explain more.
    in my java class, have method : public List retrieveAllVacancies(); and it returns a list of available vacancies.
    on my jsp page, i want to display the vicancies in the table have 3 rows:
    vacancy title  |  location  |  contract type
    should i use some form of for loop or iterator to get the vacancies in the list? how does the jsp page get the list of objects?
    anyone can help me? thanks

    i found out the actual thing i look for is how to pass the vector to the jsp page.
    <table>                                                                                                    
        <%
             Vacancy vacancy= new Vacancy();
            Vector allVacancies = new Vector();
            *//allVacancies = (java.util.Vector)request.getAttribute("allVacancies");*
            if(allVacancies.size() == 0) 
                out.print("<br><br><br>     There are no vacancies available!!");
            else
        %>
        <tr>
            <td>Vacancy Title</td>
            <td>Contract Type</td>
            <td>Location</td>
        </tr>
        <%
            for (int i=0;i<allVacancies.size();i++)
                vacancy = (Vacancy)allVacancies.get(i);
         %>
        <tr>
            <td><% out.print(vacancy.getVacancyTitle());%></td>
            <td><% out.print(vacancy.getContractType());%></td>
            <td><% out.print(vacancy.getVacancyLocation()); %></td>
        </tr>
    <%
    %>
    </table>*//allVacancies = (java.util.Vector)request.getAttribute("allVacancies");*
    if i have this line, when i open the jsp page it will gives NullPoniterException.
    the following was what i found for the similar problem,
    You can add the Vector to the HttpSession with_
    session.setAttribute(String name, Object value)_
    or to the ServletRequest with_
    request.setAttribute(String name, Object value)._
    In the other JSP, retrieve the value with_
    session.getAttribute(String name)_
    or to the ServletRequest with_
    request.getAttribute(String name)._
    but i tried to do in this way it didn't work. for sure i didn't do it correctly. could anybody give bit more explanation about how to pass the Vector to the jsp page?
    any help would be appreciated.

  • HOW TO ADD NEW HR OBJECTS ????

    Hi,
    i would like to new objects in HR object selection list,especially for PPOCE.
    I donot know how to add new objects in the object selection list.
    pls anyone who knows this ,could share your knowledge with me.
    tks
    theresita

    Hi Theresita,
    All the configuration is in the IMG under Personnel Management > Organizational Management > Hierarchy Framework.  You'll want to review all the entries and related documentation, as adding objects to PPOME/PPOCE is not a simple 'one table' process.  You may need new evaluation paths to support the views you want to see in the framework, so set these up ahead of time.  Parameters to support your configuration are: OM_ARRAYTYPE_DISPLAY; OM_DIS_OBJECTMANAGER; OM_FRAMEWORK_OBJ_NR; OM_FRAM_SCEN_DISPLAY: OM_OBJIM_SCEN_DISPLAY: OM_TABTYPE_DISPLAY.  You'll notice once you add these parameters, you can see the technical names of the scenarios you're working with in PPOME/PPOCE.
    Good luck,
    Sharon

  • How to add OLE wordpad objects to a crystal report through VB program

    Can we programmatically add OLE wordpad objects to a crystal report XI r 2. through VB.NET or VB6?
    And is there a way of treating a database binary/blob field as an ole object in CR?

    Hi Mohan,
    Try it in the Designer first. If it works in the designer then it will work in our SDK's but you'll have to use RAS. So when you post your question to the .NET Development - Crystal Reports Forum be sure to specify what version you are using and anything else as far as versions go.
    It may be easier to simply link the OLE Object in the designer, check the help file out on how to.
    Thank you
    Don

  • How to add a field object to group header section in crystal report document?

    Hi All, I have got two questions mentioned below, please share your inputs. 1)I want to know whether it is possible to add a field object to header section in crystal report document programmatically? I am using crystal runtime for visual studio. I know that using RAS we can do it, but I want to do it using managed library of crystal runtime. Please suggest. 2) I am doing a POC where I am using RAS (unmanaged library) to manipulated crystal report document. Please see code below: var dbTable = _reportDocument.ReportClientDocument.DatabaseController.Database.Tables[0]; var dbField = dbTable.DataFields.FindField(item.ColumnName,                         CrystalDecisions.ReportAppServer.DataDefModel.CrFieldDisplayNameTypeEnum.crFieldDisplayNameName,                         CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishUS); CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject fieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();                     fieldObject.DataSourceName = dbField.Name;                     fieldObject.FieldValueType = dbField.Type; var groupHeaderArea = _reportDocument.ReportClientDocument.ReportDefController.ReportDefinition.GroupHeaderArea[0].Sections[i]; _reportDocument.ReportClientDocument.ReportDefController.ReportObjectController.Add(fieldObject, groupHeaderArea); In above code last line throwing exception : "The report field type is not valid." at CrystalDecisions.ReportAppServer.Controllers.ReportObjectControllerClass.Add(ISCRReportObject ReportObject, Section Section, Int32 nIndex) Thanks, Jai

    Hi Jaikumar
    As per the SCN Rules of engagement, one question per thread please.
    Re. your 1st question. Adding a field to a report is considered to be a report creation APIs (RCAPI). Only the RAS SDK has RCAPIs, so you can not use plain jane crystal APIs. For how to with RAS, see the examples here: NET RAS SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
    Also, consult the Developer Help Files:
    Report Application Server .NET SDK Developer Guide
    Report Application Server .NET API Guide
    Re. your second question, please create a new discussion.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • How to add "services for object " in ECC 6.0

    Hi Saurabh,
    Thanks for your reply. I have checked the path given by you...System-> Service for object, but it is showing no service available as told by you. Cud you please tell me how to add this service because this is working fine in 4.6C but I dont know how to add these services in ECC 6.0. If any code for this which is written in 4.6C which I can refer... please tell me where to see the code for adding services (in 4.6C) b'coz its very urgent.

    Hi Saurabh,
                Thanks for your reply. I have checked the path given by you...System-> Service for object, but it is showing no service available as told by you. Cud you please tell me how to add this service because this is working fine in 4.6C but I dont know how to add these services in ECC 6.0. If any code for this which is written in 4.6C which I can refer... please tell me where to see the code for adding services (in 4.6C)  b'coz its very urgent.

  • How to display List of objects in jsp?

    Hi,
    I have a list containing Collection of bean objects.
    Now I want to display the values in the list of objects in a jsp using JSTL.
    Any body help me how to retrieve the bean objects from the List and how can i display that values in the jsp.
    Advanced Thanks,
    Mahendra

    Have you tried to use <:forEach></c:forEach> tag available in jstl?

Maybe you are looking for

  • Is there and FAQ for SHARING Itunes library on one computer?

    I know this has been discussed, but my SEARCH queries seem to be coming up short. There are two of us here, on one Imac. My wife and I. We both have itunes accounts and seperate logins. I have the itunes library in the SHARED folder on the imac. What

  • External Drive won't init over 128GB, Not FW firmware issue

    This one is killing me: I got a Maxtor 6L 300R0 drive the other day and hooked it up to my Dual 1GHZ MDD via a FW enclosure to init it - I am planning on migrating all my data from 3 internals over to 1 drive. The enclosure can handle drives over 128

  • Macbook Pro trackpad taps but doesn't click.

    I have a 2009 macbook pro and the trackpad taps but doesn't click. I was wondering if something can be done to fix it so the click works again without taking it in to get fixed? I am currently using a wireless mouse, which is okay but just gets annoy

  • JDBC receiver error urgent

    Hello Friends, I am using file to JDBC scenario. i am getting following errors in the JDBC receiver though i have set all the parameters correctly. the same scenario is working when i used XI server but it is giving errors when i am connecting to rem

  • DataGaurd - Failback query

    Dear Guru's I am requesting you all. can any one please explain the fail back procudere after a fail over in dataguard. I go through the oracle DG concepts giude but it s not explained any where. Thanks, Prasanna.