Creating session objects

Hi
Does anyone know the correct way to create a session object?
Below is the code I have created which passes three parameters from a jsp file in an attempt to create a session object. I am unsure as to whether it is correct or not!
Any help will be appreciated.
package cart;
public class CartItem implements java.io.Serializable
     private static int StockID;
     private static String ProdName;
     private static int price;
     private Vector Items;
     public CartItem(int StockID, String Name, int pPrice)
               StockID = StockID;
               ProdName = Name;
               price = pPrice;
     public ShoppingCart()
               Items = new Vector(StockID, Name, Price);
     public String getName()
          return ProdName;
     public int getStockID()
          return StockID;
     public int getPrice()
          return price;
}

Can anyone shed any light on this query
thanks

Similar Messages

  • VBoxManage: error: Failed to create a session object!

    When I run
    vagrant up
    I get the following output:
    Bringing machine 'default' up with 'virtualbox' provider...
    There was an error while executing `VBoxManage`, a CLI used by Vagrant
    for controlling VirtualBox. The command and stderr is shown below.
    Command: ["list", "hostonlyifs"]
    Stderr: VBoxManage: error: Failed to create a session object!
    VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available)
    VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.
    I tried directly running
    VBoxManage list
    and I get this output:
    VBoxManage: error: Failed to create a session object!
    VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available)
    VBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.
    VirtualBox (and vagrant) were both working earlier today, but I updated a bunch of packages via
    yaourt -Syua
    which I suspect is what caused the problem. Here's (what I think are) the relevant part of
    /var/logs/pacman.log
    [2013-10-22 15:53] [PACMAN] starting full system upgrade
    [2013-10-22 15:55] [PACMAN] upgraded libpng (1.6.5-1 -> 1.6.6-1)
    [2013-10-22 15:55] [ALPM-SCRIPTLET] >>> Updating module dependencies. Please wait ...
    [2013-10-22 15:55] [ALPM-SCRIPTLET] >>> Generating initial ramdisk, using mkinitcpio. Please wait...
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Starting build: 3.11.6-1-ARCH
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [base]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [udev]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [autodetect]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [modconf]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [block]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [filesystems]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [keyboard]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [fsck]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Generating module dependencies
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Creating gzip initcpio image: /boot/initramfs-linux.img
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Image generation successful
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Starting build: 3.11.6-1-ARCH
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [base]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [udev]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [modconf]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [block]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> WARNING: Possibly missing firmware for module: aic94xx
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> WARNING: Possibly missing firmware for module: bfa
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> WARNING: Possibly missing firmware for module: smsmdtv
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [filesystems]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [keyboard]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] -> Running build hook: [fsck]
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Generating module dependencies
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Creating gzip initcpio image: /boot/initramfs-linux-fallback.img
    [2013-10-22 15:55] [ALPM-SCRIPTLET] ==> Image generation successful
    [2013-10-22 15:55] [PACMAN] upgraded linux (3.11.5-1 -> 3.11.6-1)
    [2013-10-22 15:56] [ALPM] warning: /boot/syslinux/syslinux.cfg installed as /boot/syslinux/syslinux.cfg.pacnew
    [2013-10-22 15:56] [ALPM-SCRIPTLET] Syslinux BIOS update successful
    [2013-10-22 15:56] [ALPM-SCRIPTLET] If you used syslinux-install_update to install syslinux:
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> If you want to use syslinux with menu and all modules please rerun
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> # /usr/bin/syslinux-install_update -i -a -m
    [2013-10-22 15:56] [ALPM-SCRIPTLET]
    [2013-10-22 15:56] [ALPM-SCRIPTLET] If you manually installed syslinux:
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> Please copy or symlink all .c32 modules to your /boot/syslinux directory.
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> If (/ and /boot on seperate fs):
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> # cp /usr/lib/syslinux/bios/*.c32 /boot/syslinux
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> If (/ and /boot on same fs):
    [2013-10-22 15:56] [ALPM-SCRIPTLET] ==> # ln -s /usr/lib/syslinux/bios/*.c32 /boot/syslinux
    [2013-10-22 15:56] [PACMAN] upgraded syslinux (4.07-1 -> 6.02-3)
    [2013-10-22 15:56] [ALPM-SCRIPTLET] In order to use the new version, reload all virtualbox modules manually.
    [2013-10-22 15:56] [PACMAN] upgraded virtualbox-host-modules (4.2.18-7 -> 4.3.0-1)
    [2013-10-22 15:56] [PACMAN] upgraded virtualbox (4.2.18-2 -> 4.3.0-1)
    After merging in the changes from
    /boot/syslinux/syslinux.cfg.pacnew
    , I ran
    /usr/bin/syslinux-install_update -i -a -m
    , and then rebooted the system, and that's when I first discovered VirtualBox was no longer working.
    I tried
    sudo modprobe vboxdrv
    sudo modprobe vboxnetadp
    sudo modprobe vboxnetflt
    and
    sudo modprobe vobxpci
    based on what I saw from https://bbs.archlinux.org/viewtopic.php?id=130317
    I tried
    chown root.root /tmp; chmod ug-s /tmp; chmod 1777 /tmp
    based on what I saw from https://www.virtualbox.org/ticket/2335#comment:4
    The output of
    /bin/ls -ld /tmp
    is
    drwxrwxrwt 4 root root 80 Oct 22 16:46 /tmp
    Not sure what to try next.
    Last edited by Nebu (2013-10-22 21:33:35)

    I also can confirm the same issue as with previous posters, tried all stuff found on the net that seems related to this issue.
    Nothing so far as solved it for me, I also had to downgrade to 4.2.18. Not optimal but atleasat i can work until this has been sorted out.
    Last edited by loxan (2013-10-24 09:02:19)

  • How to get Request/Session objects in a Webdynpro application

    Hi
    I am working in Enterprise Portal 7.0.
    in one of the iViews which displays a JSP page, i have set a parameter in request and session objects.
    How can i get it in my Webdynpro ABAP Application?
    Thanks & Regards
    Abhimanyu L

    hi Abhimanyu
    I believe originally access to session was deliberately not made available inside WDA.
    Growing security concerns due to misuse of session information and
    perhaps other reasons as well.
    X.509  is considered a better approach.
    This may not help you in your problem.
    But you may see a trend in WDA pushing more robust and client independent
    approaches.
    Full x.509 access should remove the need for session fiddling.
    Also when developers access such session info directly, there is a possiblity
    when they dont understand the technology exactly that they create a security hole.
    You may know how to do safely, it is however discouraged.
    Im not aware of a way to get at the session info inside the WDA framework.
    Well not without a mod to the framework.
    It may be possible without a mod, but I dont know the trick.
    If someone has a little trick... please post.
    You may need to use BSP, if your only solution requires access to the session info.
    regards
    Phil

  • Creating Activity object for a Service Request object...

    <b>[This thread was migrated from the On Demand Developer Forum in the old Siebel Community] </b>
    drangineni
    New Contributor
    Ho do we use Activity object of a Service Request object. I am trying to
    create an Activity object for a existing Service Request object.
    I am looking for some sample code.
    I greatly appreciate your help.
    Product: CRM OnDemand
    11-26-2006 12:40 PM
    Re: Creating Activity object for a Service Request object...
    BigSlick
    Valued Contributor
    drangineni, What programming language are you using?
    BS
    12-04-2006 10:56 AM
    Re: Creating Activity object for a Service Request object...
    drangineni
    New Contributor
    Hi, I am using C# .
    12-04-2006 07:40 PM
    Re: Creating Activity object for a Service Request object...
    BigSlick
    Valued Contributor
    drangineni, assuming you know the service requestid or externalId of the
    Sr you are dealin gwith you would first set that value.
    ServiceRequest1[] objSRList =new ServiceRequest1[1];
    objSRList[0] = new ServiceRequest1();
    objSRList[0].ServiceRequestId = <YourSRId>;
    Then you create an array of activities and initialize the first one:
    objSRList[0].ListOfActivity = new Activity[1];
    objSRList[0].ListOfActivity[0] = new Activity();
    Now set the data fields
    objSRList[0].ListOfActivity[0].Subject ="My Subject";
    objSRList[0].ListOfActivity[0].Description ="My Description";
    objSRList[0].ListOfActivity[0].Display = "Task"; //valid values are either
    "Task" or "Appointment"
    Then call the ServiceREquestInsertOrUpdate method on the ServiceRequest
    WebService and pass in the above variable.
    BS
    12-06-2006 12:36 PM
    Re: Creating Activity object for a Service Request object...
    drangineni
    New Contributor
    Thank you BigSlick.
    The following error is thrown when I use the
    ServiceRequestInsertOrUpdate(objInput)
    "No user key can be used for the Integration Component instance 'Service <br/>
    Request_Action'.(SBL-EAI-04397)"
    When I use the prxySrvcRequest.ServiceRequestInsert(objInput), no error is
    thrown and the Activity gets added, but a new Service Request object is
    created, but the Activity gets added to an existing Service Request
    object. I greatly appreciate your help.
    The following is the code:
    int ActivityLength = 0;
    WSOD_ServiceRequest.ServiceRequest1[] ServiceRequest = new
    WSOD_ServiceRequest.ServiceRequest1[1];
    ServiceRequest[0] = new WSOD_ServiceRequest.ServiceRequest1();
    ServiceRequest[0].ServiceRequestId = this.Request.QueryString["id"];
    ServiceRequest[0].ListOfActivity = new
    WebSelfService.WSOD_ServiceRequest.Activity[ActivityLength + 1];
    ServiceRequest[0].ListOfActivity[0] = new WSOD_ServiceRequest.Activity();
    ServiceRequest[0].ListOfActivity[ActivityLength].Description =
    this.txtDescription.Text;
    ServiceRequest[0].ListOfActivity[ActivityLength].Display = "Task";
    ServiceRequest[0].ListOfActivity[ActivityLength].Subject = "My Subject";
    WSOD_ServiceRequest.ServiceRequest prxySrvcRequest = new
    WebSelfService.WSOD_ServiceRequest.ServiceRequest();
    WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Input
    objInput = new
    WebSelfService.WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Input();
    WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Output
    objOutput = new
    WebSelfService.WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Output();
    objInput.ListOfServiceRequest = ServiceRequest;
    Session objSession;
    objSession = (Session) Application["Session"];
    prxySrvcRequest.Url = objSession.GetURL();
    try
    objOutput = prxySrvcRequest.ServiceRequestInsertOrUpdate(objInput);
    catch(Exception e)
    12-09-2006 09:53 AM
    Re: Creating Activity object for a Service Request object...
    drangineni
    New Contributor
    Thank you BigSlick.
    The following error is thrown when I use the
    ServiceRequestInsertOrUpdate(objInput)
    "No user key can be used for the Integration Component instance 'Service <br/>
    Request_Action'.(SBL-EAI-04397)"
    When I use the prxySrvcRequest.ServiceRequestInsert(objInput), no error is
    thrown and the Activity gets added, but a new Service Request object is
    created, but the Activity gets added to an existing Service Request
    object. I greatly appreciate your help.
    The following is the code:
    int ActivityLength = 0;
    WSOD_ServiceRequest.ServiceRequest1[] ServiceRequest = new
    WSOD_ServiceRequest.ServiceRequest1[1];
    ServiceRequest[0] = new WSOD_ServiceRequest.ServiceRequest1();
    ServiceRequest[0].ServiceRequestId = this.Request.QueryString["id"];
    ServiceRequest[0].ListOfActivity = new
    WebSelfService.WSOD_ServiceRequest.Activity[ActivityLength + 1];
    ServiceRequest[0].ListOfActivity[0] = new WSOD_ServiceRequest.Activity();
    ServiceRequest[0].ListOfActivity[ActivityLength].Description =
    this.txtDescription.Text;
    ServiceRequest[0].ListOfActivity[ActivityLength].Display = "Task";
    ServiceRequest[0].ListOfActivity[ActivityLength].Subject = "My Subject";
    WSOD_ServiceRequest.ServiceRequest prxySrvcRequest = new
    WebSelfService.WSOD_ServiceRequest.ServiceRequest();
    WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Input
    objInput = new
    WebSelfService.WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Input();
    WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Output
    objOutput = new
    WebSelfService.WSOD_ServiceRequest.ServiceRequestWS_ServiceRequestInsertOrUpdate_Output();
    objInput.ListOfServiceRequest = ServiceRequest;
    Session objSession;
    objSession = (Session) Application["Session"];
    prxySrvcRequest.Url = objSession.GetURL();
    try
    objOutput = prxySrvcRequest.ServiceRequestInsertOrUpdate(objInput);
    catch(Exception e)
    12-10-2006 08:49 AM
    Re: Creating Activity object for a Service Request object...
    BigSlick
    Valued Contributor
    Ah yes, I forgot you also need to specify a unquie Id for the activity.
    It's kinda strange.
    Try adding this:
    ServiceRequest[0].ListOfActivity[ActivityLength].ActivityId = "DummyId";
    //OD will overwrite this with a real Id
    Or if you have a unquie ID for your Activities you can use:
    ServiceRequest[0].ListOfActivity[ActivityLength].ExternalSystemId = <Your
    Unique Value>;
    Hope that helps,
    BS
    12-11-2006 10:52 AM
    Re: Creating Activity object for a Service Request object...
    surgientweb
    New Contributor
    Hi all,
    I have a similar problem, but mine is returning a message that field
    "Display" is required. Looking at this post and the documentation it is
    obvious that Display is a required field, but my WSDL did not include a
    field called "Display", so my proxy did not generate one.
    I tried adding a field called Display to the WSDL and the proxy class, but
    I get a different error... I figure I maybe cannot add it manually like
    that - but I think the bigger problem is it is not part of the WSDL that
    Siebel OD generates for me in my admin account.
    On top of that Display is not shown in the list of fields for Activity
    through the admin interface.. is it possible my account is bugged? Am I
    missing something simple here? BigSlick, I see you mention a .Display in
    your code sample so I thought you might understand what is wrong. Here is
    my code (I am trying to add a activity to a lead).
    Thanks for any insight into this!
    private void InsertLeadActivity(Session session, NameValueCollection data,
    string leadID)
    try
    if (blnDebug)
    Response.Write("Setting up Activity<br>";
    // instantiate the proxy service
    Activity_Service.Activity activityProxy = new Activity_Service.Activity();
    // set up the target URL
    activityProxy.Url = session.GetURL();
    activityProxy.CookieContainer = session.GetCookieContainer();
    // set up input argument
    ActivityNWS_Activity_Insert_Input input = new
    ActivityNWS_Activity_Insert_Input();
    input.ListOfActivity = new Activity1[1];
    input.ListOfActivity[0] = new Activity1();
    if (blnDebug)
    Response.Write("Getting Data<br>";
    // dg note: name value
    // input.ListOfActivity[0].MrMrs = data["MrMrs"];
    input.ListOfActivity[0].LeadId = leadID.ToString();
    input.ListOfActivity[0].Description = DataToString(data);
    input.ListOfActivity[0].Subject = "Website Submission Activity";
    input.ListOfActivity[0].Priority = "3-Low";
    //input.ListOfActivity[0].DueDate =
    DateTime.Now.AddDays(7).ToShortDateString();
    input.ListOfActivity[0].Owner = this.defaultLeadOwner;
    input.ListOfActivity[0].Type = "Call";
    //input.ListOfActivity[0].Display = "Task";
    input.ListOfActivity[0].ActivityId = "DummyId";
    input.ListOfActivity[0].ExternalSystemId = "web";
    activityProxy.Activity_Insert(input);
    catch (Exception exInsertActivity1)
    if (blnDebug)
    Response.Write("<br>Error inserting activity.<br><br>" +
    exInsertActivity1.ToString() + "<br>";
    01-06-2007 05:05 PM
    Re: Creating Activity object for a Service Request object...
    surgientweb
    New Contributor
    Figured it out.. the field "Display" is also known as "Activity"........
    Here are some notes for other people.. good luck and feel free to write me
    at raskawa-at-gmail-com if you want a code sample.
    Some unpublished nice to knows for Siebel On Demand Activities....
    In summary:
    - .Activity is also known as Display in documentation and on the error
    messages coming back from the WS. Also, it appears based on these boards
    some people actually have a .Display field. Maybe different accounts
    generate different WSDL's.... buggy.
    - If a error message is thrown saying "Description is required" it really
    means "Subject is required" (make sure .Subject has a value)
    - If a error message is thrown complaining that ActionType is not right..
    that is really .Type.. make sure it's lookup value is valid for the
    dropdown values in your CRM OD system.
    My code/values that worked..
    input.ListOfActivity[0].LeadId = leadID.ToString();
    input.ListOfActivity[0].Description = DataToString(data);
    input.ListOfActivity[0].Subject = "Website Submission Activity";
    input.ListOfActivity[0].Priority = "3-Low";
    //input.ListOfActivity[0].DueDate =
    DateTime.Now.AddDays(7).ToShortDateString();
    input.ListOfActivity[0].Owner = this.defaultLeadOwner;
    input.ListOfActivity[0].Type = "Call";
    input.ListOfActivity[0].ActivityId = "DummyId";
    input.ListOfActivity[0].ExternalSystemId = "web";
    //input.ListOfActivity[0].Display = "Task"; //doesn't work
    input.ListOfActivity[0].Activity = "Task"; //does work.
    01-06-2007 05:17 PM
    Re: Creating Activity object for a Service Request object...
    raskawa
    First Time Contributor
    Hi,
    This is surgientweb (under my own login now..)
    Anyway, I wanted to add that I figured out that there are two ways to add
    a Activity to a Lead. Via the Lead object (by getting a ListOfActivities)
    OR by creating a Activity directly and just adding your "LeadID" to it (or
    you can also add a "ContactID" to relate the activity to a Contact.)
    Feel free to email me for a code example (raskawa....at....gmail)
    -David
    01-09-2007 02:58 PM

    Hi Stephane,
    You can definitely read the categories using Tables in CRM. The logic is a bit complicated though.
    Use the following steps to retrieve Categories using Std. CRM Tables:
    1. Pass transaction GUID in field GUID of table CRMV_REPORT_SUBJ and get KATALOGART, CODEGRUPPE and CODE field values in lv_catalog, lv_codegrp and lv_code.
    2. Now you need to concatenate these 3 fields values carefully like this:
    CONCATENATE lv_catelog lv_codegrp '    ' lv_code into lv_category1.
    Remember there are 4 spaces between lv_codegrp and lv_code.
    3. Now pass this lv_category1 in field OBJEXT in table CRMC_ERMS_CAT_OK and get OBJGUID in field lv_objguid.
    4. Pass this lv_objguid in field OBJ_GUID and LNK_TYPE = 'IS_CODE' in table CRMC_ERMS_CAT_LN and get value of CAT_GUID in lv_cat_guid.
    5. Pass this lv_cat_guid in field CAT_GUID in table CRMC_ERMS_CAT_CA and get value of CAT_ID in field lv_cat_text.
    Remember this lv_cat_text is the text value of your last level of category of transaction.
    6. To get its upper cateogry level value, simply use table CRMC_ERMS_CAT_HI and get parent guid value and pass this as CAT_GUID again in table CRMC_ERMS_CAT_CA to get its text.
    Alternatively, you can also use class method cl_crm_ml_category_util=>get_parse_all to get all levels of categories.
    Hope this helps.
    Thanks
    Vishal

  • Solution Manager EWA - cannot create session in satellite system

    "Hi,
    I want to configure EWA self service using Solman 4.0. I succesfully did the following :
    a. Maintained SMSY and create the required trusted RFC connections from SM to satellite system. All connection and authorization passed in SM59. I used SAP_ALL/SDCCN_ALL role and assigned objects S_RFC*.
    b. Assigned the system to a logical system.
    c. Created the a new solution and activate "Solutions Monitoring > Earlywatch Alert"
    d. Activated and maintained required RFC in SDCCN in satallite system.
    My problem is that the create EWA alert request (Red Flag with a specific session number ) coulnd be pass to the satelitte system even though all the trusted RFC and authorization is set. When i execute the SESSION_REFRESH in the satellite system, the session is not created.
    Did I miss out any steps. Can any one share any help ?
    FYI, there is no connection to SAPOSS yet, so i did not manage to run RTCCTOOL completed, but i doubt this is required for EWA self service."
    I  have the same problem as Solution Manager EWA - cannot create session in satellite system
    tried all of solutions,  but it does not help... Created the CM (high) for SAP, but get 1 response for 1 week from them:(

    Dear Sapbcer,
    Have you tried the following option :
    Execute SMSY and from the Server entry Execute the "Read System Data Remote" option in change mode.
    Save the data captured and then try using Refresh Session Task from SDCCN of the satellite system. Do select the RFC for Solution Manager while performing this task.
    Hope this helps.
    Regards
    Amit

  • I need to add the values stored in the session object into the html textbox

    Dear Sir,
    i have been trying to create an edit employee details page
    What i have done till now is as follow:
    1. Got employee id from HTML page.
    2. Compared it with the id stored in the database.
    3. If the id is correct then pulled the record of the corresponding employee and stored it in the session object.
    4. Dispatched the session values to another servlet EditEmpDetails2.java
    what i need to do now
    5. Now i need to set the session values in the text field of the html form
    6. I also need to be able to edit those vales and store the edited values in the database.
    Please help me as i have tried doing it for 1 week without any clues
    i have tried to create a html page which is something like this:
    <html>
    <head>
    <title>Edit Employee Details Page</title>
    <body BGCOLOR="red" text="black">
    <h1 ><font color="black">Edit Employee Details Page</font></h1>
    <form action = "EditEmpDetails" method="Get">
    <table width="50% align="center"
    <tr><td>Employee ID: </td>
    <td><INPUT TYPE="TEXT" name="employeeid"<br></td></tr>
    <tr><td><center><input type="submit" value="submit"></center></td></tr>
    <tr><td><center><input type="reset" value="reset" ></center></td></tr>
    </table>
    </form>
    </body>
    </html>
    design of my servlet EditEmpDetails.java
    public void EditEmpDetails1 extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    HttpSession session = request.getSession();
    String employeeid;
    String X = request.getParameter("employeeid");
    System.out.println("Employee iD:" + X);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:murphy");
    String query = "Select * from users where employeeid=?";
    PreparedStatement stat = con.prepareStatement(query);
    System.out.println(stat);
    stat.setString(1,X);
    ResultSet rs = stat.executeQuery();
    while(rs.next())
    String Z = rs.getString(password);
    if(Z.equals(X))
    String A = rs.getString(1);
    session.setAttribute("employeeid", A);
    String B = rs.getString(2);
    session.setAttribute("firstname", B);
    String C = rs.getString(3);
    session.setAttribute("lastname", C);
    String D = rs.getString(4);
    session.setAttribute("gender", D);
    String E = rs.getString(5);
    session.setAttribute("dateofbirth", E);
    String F = rs.getString(6);
    session.setAttribute("address", F);
    String G = rs.getString(7);
    session.setAttribute("postalcode", G);
    String H = rs.getString(8);
    session.setAttribute("phone", H);
    String I = rs.getString(9);
    session.setAttribute("mobile", I);
    String J = rs.getString(10);
    String url = "/EditEmpDetao;s.java";
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url)
    dispatcher.forward(request,response);
    catch (Exception e)
    system.out.println(e)
    I do not know how to put the values stored in the session object into the html text box

    3. If the id is correct then pulled the record of the corresponding employee and stored it in the session object.do you really need to store this in session object?
    5. Now i need to set the session values in the text field of the html form which form? in a new html/jsp page? i suggest go for a JSP
    In your JSP page use JSP expression tags to put the session attributes.
    it's something like : <input type='text' name='employeeid' value='<%= session.getAttribute("employeeid") %>' >and you need to generateanother servlet for saving the details/modifications to the database.
    I think i m clear enough.
    if you need more clarifications. just try it and then post your problem.
    Diablo

  • How to use a Session object in a Javascript function

    I have an object that I have set in my session.
    On my jsp I want to pull it out of my session and use it as a parameter for a javascript function. But I am not sure how to do that... the function call is below... I want to assign a value to ifFormat (last variable in function) But I am not sure what to use inside javascript.
    <script type="text/javascript">
         Calendar.setup({inputField:"f_date_dfFirstPmtDate",
                                              button:"f_trigger_dfFirstPmtDate",
                                             singleClick:true,
                                              ifFormat:XXXXX});
    </script>

    Note that javascript runs on the client side, and JSP runs on the server. JSP and the session objects are NOT available to javascript in reaction to the user.
    If this function is called only when the page is first created, not when the user interacts with the page, or if you want that value to be constant with respect to the javascript, then you can do this:
    <%
      String someValue = (String)session.getAttribute("theAttributeName");
    %>
    <script type="text/javascript">
         Calendar.setup({inputField:"f_date_dfFirstPmtDate",
                                              button:"f_trigger_dfFirstPmtDate",
                                             singleClick:true,
                                              ifFormat:<%=someVale%>});
    </script>

  • How to use session object in jsp

    hi all
    marry christmas
    can anyone plz tell me how to use session obect in jsp
    rachna
    Message was edited by:
    rachna_arora82

    hi rachna,
    JSP has a default(implicit) session object...... use the getSession(true) method on the session object and then going u can either get or set attributes depending on the requirement
    That was in general and now with the issue u have got..... what u can do is that the u can create session for every user who logs in and when he/she tries to login again then u can probably check for the existing session object in the JSP and perform the logic as required..... any clarifications plzzzzzzz let me know
    Thanks n Regards
    Naveen M
    Message was edited by:
    Novice_inJAVA
    Message was edited by:
    Novice_inJAVA

  • How to obtain a session object from session id

    Hi all,
    let say that I have a list of session ids, and I want by scheduald task to check whether the session is alive\active.
    I saw that the HttpSessionContext was deprecated. (see: http://javasolution.blogspot.com/2007/08/getting-session-object-using-session-id.html)
    Is there any other way to check if the session is alive?

    Do it the other way: let the session itself notify that it is not alive anymore.
    Implement a HttpSessionListener which adds the session to list/set/map on create and removes the session from it on destroy, register it in the web.xml and run it.

  • Access Session objects

    Hi you all,
    How can I access, from a normal class which doesn't extend the HttpServlet abstract class, any session objects that might have been stored. It is a requirement that all the classes that I am using which make part of the bussiness logic cannot extend the HttpServlet. Since the HttpServlet in an abstract class I cannot create an instance of it... so how can I access any session objects without extending the HttpServlet class.
    Any help is welcome,
    Thanks,
    MeTitus

    You could pass the session object as a parameter to the contructor or in any method calls. However most people will tell that this is poor design an dyou should extract any needed data from the session and only pass that data to the objects instead of the entire session object.

  • How to create an object only if not exist?

    how to create an object only if not exist? is it possible?
    if not what can I do?
    Thanks.

    Well, the jsp:useBean tag is a great way to do things.
    But another way is:
    <%  
          MyObjectType myObject = null;
          if(session.getAttribute("myObject"))==null) {
             myObject = ... ; //initiate your object
             session.setAttribute("myObject", myObject);
          myObject = (MyObjectType) session.getAttribute("myObject");
    %>As you can see, this is more messy, but you can do it.

  • How to use session object in windows application

    hi, I am programming in jdeveloper. i need to know that while i m making a web application i can use a session object for the particular session. now i m builiding a windows application for my final semester and i need to insert product id and then it should go to another frame and there it can store multiple information for a particular product id.
    e.g
    product id : 001
    next frame.
    filter name.
    filter position.
    when these are added then it should be able to add more filters for the same product id and i dont understand how to do that.
    Please let me know as i am lost and dont know how to proceed further. if some body wants to have a look on the codes he is most welcome.
    Waiting for an answer
    thank you

    Hi,
    in Swing applications you don't have a session object to store data. You can use a helper class though to act as a temporary memory. Just create a static class that has a hashtable method to add / read / remove data
    Frank

  • Failed to create deployable object 'local/Calendar' since it not a WD objec

    Hi
    I created a calendar application in Web dynpro,There iam getting this error .will any one please help me how to avoid this.
    com.sap.tc.webdynpro.services.sal.core.DispatcherException: The requested deployable object 'local/Calendar' and application 'CalendarApp' are not deployed on the server. Please check the used URL for typos.
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.getApplicationDeployableObjectPart(RequestManager.java:383)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.initTask(RequestManager.java:317)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:143)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create deployable object 'local/Calendar' since it is not a Web Dynpro object.
         at com.sap.tc.webdynpro.serverimpl.core.deployment.AbstractDeployableObject.<init>(AbstractDeployableObject.java:106)
         at com.sap.tc.webdynpro.serverimpl.wdc.deployment.DeployableObject.<init>(DeployableObject.java:56)
         at com.sap.tc.webdynpro.serverimpl.wdc.deployment.DeployableObjectFactory.getDeployableObject(DeployableObjectFactory.java:95)
         at com.sap.tc.webdynpro.services.sal.deployment.core.DeployableObjectInternal.getDeployableObjectInternal(DeployableObjectInternal.java:34)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.getApplicationDeployableObjectPart(RequestManager.java:380)
         ... 20 more

    Hi Sushma,
                     lot of new features have been added in CE EHP1 version .for more information refer this [link|http://help.sap.com/saphelp_nwce711/helpdata/en/26/b7fa511a964597a5d8c1b778508936/content.htm] and search in SDN for new features in EHP1 version.
    in CE EHP1, local web dynpro projects cannot be used as it is deprecated in this version.
    i believe this calendar is a local standalone project created in CE 7.1 version and conert this local project to development component.
    right click on ur local project --> Development component -->Convert Project to Development Component.
    After this, go ur NWDI --> select ur component --> right click --> Create project (& Sync ysed Dcs) ..
    finally deploy and run ur component .
    Hope this helps.
    Thanks and Regards

  • How to keep track of which tab is currently active in the page using Session object?

    Hi,
    Just curious as to whether it is possible to have a PL/SQL event fire on an active tab.
    The reason is I want to keep track of which tab is currently active on the page is that I have "generic" forms and reports published as portlets that I wish to be able to determine from the session object what page/tab the user is coming from and apply certain restrictions etc.
    kind regards,
    Matt.
    null

    Hi Konstantina,
    Yes You can do like that 2012-->q1-->January
    Steps:
    1. Create time dimension hierarchy as by following like Total--> year--> Quarter--> Month--> if you need you can keep Description.
    2. Drag the Year column from period dimension table to the dimension hierarchy of year.
    3. Drag the quarter column from period dimension table to the dimension hierarchy of Quarter.
    4. Drag the month column from period dimension table to the dimension hierarchy of month.
    5. Drag the hierarchy to period dimension table in presentation layer.
    In Answer side keep as it as Default: drill in primary and secondary interaction under column properties.
    For more refer : http://mkashu.blogspot.com
    Regards
    VG

  • Storing array(or other data structure) in a session object

    hi wise ones
    to minimise my calls to a database I would like to store the information retrieved from a ResultSet in an array and then store this in a session object, retrieving it with getAttribute("nameOfArray"); when I need it.
    I have tried to print the object contents to test what is happening but am getting a[b] [Ljava.lang.String;@11d646c[/b] response which is something, but not what I expected.
    Is using a session the right way to make the information available to all servlets? If not what other method is appropriate?
    thank you

    thanks for your comments Annie & MLRon. I have tried both suggestions but am still hitting problems
    the usual method to get the elements results in my compiler complaining that sessionINFO is an object and .length cannot be applied to an object.
    for (int i = 0; i < sessionINFO.length; i++) {
                       out.print(sessionINFO);
                   out.print("<BR>");
    An array IS an object though?
    I have used Arrays.asList(sessionINFO) and get another compiler error stating that java.util.Arrays cannot be applied to an object
    I took my variables from the ResultSet and converted them all to Strings and put them into a String array
    int bankIDLogin=customerResults.getInt("id");
                                   //convert to String for array
                                   String bankIDLoginSTR = String.valueOf(bankIDLogin);
                                  String passwordLogin =customerResults.getString("password");
                                  String accNo=customerResults.getString("number");
                                  float accBal=customerResults.getFloat("balance");
                                  //convert to String for array                              
                                  String accBalSTR = String.valueOf(accBal);
                                  //put info into array
                                  String[]customerDetails={bankIDLoginSTR,passwordLogin,accNo,accBalSTR};then I put that array into the session object
                        HttpSession session =req.getSession(true);
                        session.setAttribute("id",bankID);
                        session.setAttribute("customerdetails",customerDetails);In a separate servlet I called the session object
    Object sessionINFO = session.getAttribute("customerdetails");How can I get the original array out of this object?
    What should I do if more than one result set is created and I need to create two session objects with customer details, (one customer has two accounts)? multi dimensional array?

Maybe you are looking for

  • How can I delete a single unwanted page in a Pages document?

    I'm unable to delete a single unwanted page from a document.

  • Printing issue in Adobe Reader

    Customer supplied blueprint in greyscale. When I print it out, it is too light to read the dimensions. When I adjust the printer to the darkest setting, the dimensions become choppy. Would like to convert the greyscale so I can print a regular black

  • Acrobat 9 Pro - Change Image Compression/Quality w/ Javascript?

    Hello, I've got a folder-level script that will merge PDFs by using "insertPages" to add a list of PDFs to a new document. The file size is too large, and I've noticed that if I go into the PDF Optimizer manually and change the Image Settings so the

  • Question to Z10 apps

    Hello, I´m new here (and from Germany) and I have questions. Actually I have an Android Smartphone, but I want to change to BB and I want to buy a Z10. How is the situation about apps? I ask for a compass (in Android i. e. part of the "Swiss Army Kni

  • How to reimplement the handleUnload javascript method ?

    Hi all, we are facing an issue here with a generated BPS application(using BPS_WB) which is integrated in another BSP application (cProjects). In fact, often, users are clicking on another tab in cProjects, and they are losing the data they were crea