How to get an ArrayList Object in servlet from JSP?

How to get an ArrayList Object in servlet from JSP?
hi all
please give the solution for this without using session and application...
In test1.jsp file
i am setting values for my setter methods using <jsp:usebean> <jsp:setproperty> tags as shown below.
After that i am adding the usebean object to array list, then using request.setAttribute("arraylist object")
---------Code----------
<jsp:useBean id="payment" class="com.common.PaymentHandler" scope="request" />
<jsp:setProperty name="payment" property="strCreditCardNo" param="creditCardNumber" />
<%-- <jsp:setProperty name="payment" property="iCsc" param="securityCode" /> --%>
<jsp:setProperty name="payment" property="strDate" param="expirationDate" />
<jsp:setProperty name="payment" property="strCardType" param="creditCardType" />
<%--<jsp:setProperty name="payment" property="cDeactivate" param="deactivateBox" />
<jsp:setProperty name="payment" property="fAmount" param="depositAmt" />
<jsp:setProperty name="payment" property="fAmount" param="totalAmtDue" /> --%>
<jsp:useBean id="lis" class="java.util.ArrayList" scope="request">
<%
lis.add(payment);
%>
</jsp:useBean>
<%
request.setAttribute("lis1",lis);
%>
-----------Code in JSP-----------------
In testServlet.java
i tried to get the arraylist object in servlet using request.getAttribute
But I unable to get that arrayObject in servlet.....
So if any one help me out in this, it will be very helpfull to me..
Thanks in Advance
Edward

Hi,
Im also facing the similar problen
pls anybody help..
thax in advance....
Litty

Similar Messages

  • How to reach public variables in a servlet from jsp

    this is myclass.java servlet
    public class myclass{
         public String var1,var2;
        public void method1() {
        var1="test1";
        var2="test2";
    }this is my jsp page;
    <%@ page import="com.xxx.albumlerim.myclass"%>
    <%
    myclass tester=new myclass();
    tester.method1();
    out.print(tester.var1);
    out.print(tester.var2);
    %>jsp can run the method but doesnt recognize tester.var1 and tester.var2 how can i reach this variables what i must do.?
    thank you
    Burak
    Message was edited by:
    netsonicc

    I may have used the term incorrectly. Basically I meant using the <jsp:include> tag to invoke a servlet directly. Then the servlet could send the output you need. That way you could keep things more modular.
    So for example -- you say you have a servlet with these values. Maybe you could add some functionality to it so if it's invoked with a particular URL, it produces output displaying these values.
    Then you could use <jsp:include> to invoke that new functionality via that URL.
    Just an idea.

  • How to get the UserTransaction object in  stateless session bean

    Hi, I am using jboss server and jdk5 version and using EJB.
    My Application flow :
    JSP à Action(Struts) à Service Locator à Session bean à Entity Bean(cmp) à DB.
    I tried to get the UserTransaction object in my Action. Its my code.
    InitialContext ctx = new InitialContext();
    UserTransaction uTrans = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
    After used uTrans.begin(),uTrans.commit() and uTrans. rollback () also.
    Its working fine .
    But, I used the the same code inside in my session bean its not working.
    Stateless Session Manager Bean code :
    public class SampleManagerBean implements SessionBean {
    public void ejbCreate() throws CreateException {  }
    public void ejbRemove() {  }
    public void ejbActivate() {   }
    public void ejbPassivate() {   }
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
         public void createSample() throws EJBException
         try{
                   InitialContext ctx = new InitialContext();
                   UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
              }catch(Exception e) {
              System.out.println(“ Exception === > “+e)
    Its throws the error ie: javax.naming.NameNotFoundException: UserTransaction not bound
    How to get the UserTransaction object in my session bean. Kindly give solution the above errors.
    - Thendral

    first of all, you could just use sessionContext.getUserTransaction(). however, that would only work if your bean is using bean-managed transactions. the default is container-managed transaction, in which case you cannot get a UserTransaction object. if you want to manage transactions, you need to add the TransactionManagementType.BEAN annotation to your ejb.

  • How to get the view Object in UserDefined Action

    Hi  All,
       Any body tell me how to get the view object , like the view object avilable in the wdDoModifyView() method as parameter.
    I have requirement like, i want to change the , no of rows displaying in the table should be changed at the runtime based onthe no of rows  selected in the dropdown box.
    The action which i created will be assigned to that dropdown box, on select of the available option, i will get the view object and change the properties of the "maxrows" of the table .
    so for getting the view object in the  the Action methods tell me what is the procedure for getting the current view object.

    Hello Vishal,
    Simply create a value attribute (say rowCount) of type 'integer' and bind it to the 'visibleRowCount' property of your table. Then, in the actionHandler get the value from the UI element (in your case, I guess it is drop down) and set it to the attribute 'rowCount' like this.
    wdContext.currentContextElement.setRowCount(
        wdContext.current<nodeElement>.set<AttributeBound toDropDown>);
    Bala

  • How to  get the profile object in simple java class  (Property accessor)

    Hi All,
    Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
    I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
    a.I dont have request object also to do request.resolvename.
    b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
    Advance Thanks.

    Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
    Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
    getPropertyValue() {
    super.getPropertyValue() // Chance of getting value set by Profile A.
    // Perform logic
    There is a chance that profile B getting the value set by Profile A and hence inconsistency.
    How about doing this way??
    Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
    <attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
    getPropertyValue()
    //You have Profile item descriptor and also storeId property value.
    // Use CustomCatalogTools.findSku();
    // Use storeId, profile repository item, sku repository item to perform the logic
    Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
    -karthik

  • How to get customer-specific objects into PCUI ?

    Hello,
    we want to get an Z-table as tab page of the business partner-application into PCUI. It should 'only' be possible to create new entries - today there is no need to modify or delete records.
    Does there exist something like a "cookbook" on this task or has anyone of you experience how to get customer-specific objects (without using EEWB) into PCUI ?
    Thanks in advance
    Martin

    Option 1:
    If you are good in ABAP.
    You can add new tab in which create a new Field group. Assign it to a model access clas in which handle the table update.You can get the details in PCUI cookbook itsel.
    Option 2:
    If you are good at java
    Develop an FM to update the table.
    Call the FM from webdynpro
    Include this webdynpro as HTML viewer in PCUI.
    Regards,
    Abdul Raheem S

  • How to get an initialised Object according to it's name?

    How to get an initialised Object according to it's name?
    For example I have 5 HashSets (initialised, with data) hs1 hs2 hs3 hs4 and hs5
    Sometimes I want to get one of them according to it's number : "hs"+number
    How this can be done (method class.forName is dedicated to antoher thing).
    Thanks

    I forgot to write that I do not want to use a Map :)
    (sure, it' possible via Map, no question).
    But in Perl, for example, I could simply write
    $ab="col" + "or";
    $color="Beidge";
    and than I can use address to a variable $color in
    such a way : $$ab
    ... So if a Map is an only way... than it will be a
    Map... pity..I do not really know Perl so I can not comment on it; but, are there any compiled languages (at least compiled to the degree of Java) that support this construct? All of the programming languages that I can think of that have this construct are more along the lines of scripting languages.
    Just curious.

  • How 2 get the path of a file Using jsp

    how 2 get the path of a file Using jsp
    i have tried getPath...but i'm geting the error
    The method getPath(String) is undefined for the type HttpServletRequest
    any idea how 2 get the path of a file

    You need ServletContext#getRealPath().
    API documentation: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • How to get standard program ,script,smartforms all from sap

    hi friends
    how to get standard program ,script,smartforms all from sap.
    thanks&regards
    Babasish

    Hi,
    reports:
    goto se38
    all programs not starting with y or z will be sap std programs only
    same for se71 scripts
    samse for smartforms
    but the use of those will be known when you see the documentation
    for each programme
    for std programs there will be documentation available so that you can understand
    why they have developed that object
    thanks & regards,
    Venkatesh

  • How to get the values of Select-options from the screen.

    The value of parameter can be obtained by function module 'DYNP_VALUES_READ' but How to get the values of Select-options from the screen? I want the F4 help values of select-options B depending on the values in Select-option A.So I want to read the Select-option A's value.

    Hi,
    Refer this following code..this will solve your problem...
    "Following code reads value entered in s_po select options and willprovide search
    "help for s_item depending upon s_po value.
    REPORT TEST.
    TABLES : ekpo.
    DATA: BEGIN OF itab OCCURS 0,
    ebelp LIKE ekpo-ebelp,
    END OF itab.
    SELECT-OPTIONS   s_po FOR ekpo-ebeln.
    SELECT-OPTIONS s_item FOR ekpo-ebelp.
    INITIALIZATION.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_item-low.
      DATA:
      dyn_field TYPE dynpread,
      temp_fields TYPE TABLE OF dynpread,
      zlv_dynpro TYPE syst-repid.
      zlv_dynpro = syst-repid.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname     = zlv_dynpro
          dynumb     = syst-dynnr
          request    = 'A'
        TABLES
          dynpfields = temp_fields
        EXCEPTIONS
          OTHERS     = 0.
      LOOP AT temp_fields INTO dyn_field.
        IF dyn_field-fieldname EQ 'S_PO-LOW'.
            SELECT * INTO CORRESPONDING fields OF TABLE itab FROM ekpo
            WHERE ebeln EQ dyn_field-fieldvalue.
            EXIT.
        ENDIF.
      ENDLOOP.

  • I update my IPhone4 to IOS6 from IOS4.3.3. My all songs are missing in the Iphone4. How to get those songs into my Iphone from ITunes. Even after sync also not coming to IPhone.

    I update my IPhone4 to IOS6 from IOS4.3.3. My all songs are missing in the Iphone4. How to get those songs into my Iphone from ITunes. Even after sync also not coming to IPhone.

    The iphone is not  storage/backup device.
    The sync is one way - computer to iphone.
    The only exception is itunes purchases.  File>Devices>Transfer Purchases
    You should copy everything from your old computer, or your backup copy of your old computer, to your new one.

  • How to get the current logged in username from windows and put it into an AS var

    Hello,
    I was hopeing someone would know how to get the current logged in username from windows and put it into a var, so I can create a dynamic text box to display it.
    Thanks in advance
    Michael

    Just for everyone’s info, this is the script I have used to get the logged in windows username into flash ---- not and air app.
    In the html page that publishes with the .swf file under the <head> section:-
    <script language="JavaScript" type="text/javascript">
    function findUserName() {
         var wshell=new ActiveXObject ("wscript.shell");
         var username=wshell.ExpandEnvironmentStrings("%username%");
         return username;
    </script>
    The ActionScript:-
    import flash.external.ExternalInterface;
    var username:String = ExternalInterface.call ("findUserName");
    trace (username); // a quick test to see it in output

  • HT3702 i want to change my region and i don't know how to get rid of the remaing amout from my gift card ($0.48)

    i want to change my region and i don't know how to get rid of the remaing amout from my gift card ($0.48)

    Request that iTunes Support zreo balance your account.
    iTunes Support -
    http://www.apple.com/support/itunes/

  • How to Get details of list of SC from list of PO & vice versa ?

    Hello All,
    Can Please anyone tell me how to get the list of Shopping Carts from the list of PO. I have list of Purchase orders numbers. Can you please suggest any standard table or combination of standard tables from which I can get this report ?
    We have Stand alone system and do not have access to back end system.
    Thank you in advance.
    Digant

    you can use below code
    TYPES: BEGIN OF ty_po_guid_sc_guid,
                po_guid TYPE swo_typeid,
                sc_guid TYPE swo_typeid,
              END OF ty_po_guid_sc_guid.
    TYPES: BEGIN OF ty_sc_guid_sc_num,
                sc_guid TYPE guid,
                sc_num  TYPE crmt_object_id_db,
              END OF ty_sc_guid_sc_num.
    DATA: lt_po_guid_sc_guid TYPE STANDARD TABLE OF ty_po_guid_sc_guid,
             ls_po_guid_sc_guid TYPE ty_po_guid_sc_guid,
             lt_sc_guid_sc_num  TYPE STANDARD TABLE OF ty_sc_guid_sc_num,
             ls_sc_guid_sc_num  TYPE ty_sc_guid_sc_num.
    *Get the SC guid related to PO guid
    SELECT a~objkey AS po_guid c~objkey AS sc_guid INTO TABLE lt_po_guid_sc_guid
                  FROM srrelroles   AS a
                  JOIN bbp_pdbinrel AS b ON a~roleid EQ b~role_b
                  JOIN srrelroles   AS c ON b~role_a EQ c~roleid
                  FOR ALL ENTRIES IN lt_po_guid_sc_guid
                  WHERE a~objkey EQ lt_po_guid_sc_guid-po_guid.
           LOOP AT lt_po_guid_sc_guid INTO ls_po_guid_sc_guid.
             MOVE ls_po_guid_sc_guid-sc_guid TO ls_sc_guid_sc_num-sc_guid.
             APPEND ls_sc_guid_sc_num TO lt_sc_guid_sc_num.
           ENDLOOP.
           IF lt_sc_guid_sc_num[] IS NOT INITIAL.
    * Get the shopping cart number
             SELECT a~guid AS sc_guid b~object_id AS sc_num INTO TABLE lt_sc_guid_sc_num
             FROM crmd_orderadm_i AS a
              JOIN crmd_orderadm_h AS b ON a~header EQ b~guid
                  FOR ALL ENTRIES IN lt_sc_guid_sc_num
                  WHERE a~guid = lt_sc_guid_sc_num-sc_guid
                      AND b~object_type = 'BUS2121'.
           ENDIF.
    <removed>
    Please do not ask for points. Message was edited by: Zoltan Keller

Maybe you are looking for

  • How do i get my printer to print in colour? urgent:(

    Hey guys, I have recently bought a samsung CLX-3180 series and i sought for the updates and found them, now it copies in colour when i select that option but whenever i print via the mac it only prints in black, whatever i do. How do i solve this?

  • Cisco Layer 3, Voice, & VLAN

    I have a vSphere 5.5 install and I'm in the process of a network upgrade in preparation for a VOIP implementation.  The Switch hardware I'm using is a stack of Cisco 3850 Layer 3 switches and I've been going in circles on getting vlan traffic to work

  • FCPX ISSUES AFTER INSTALLING LATEST UPDATE

    Well, I updated FCPX and now it won't let me SHARE.  Any ideas.  thanks, Jeff

  • 3D files supported features

    I've been testing collada files in iBooks Author exported from Maya. So far I found that spot light don't work on the iPad. It works in Preview though. If you can try it from another 3D package I would like to know if you get the same results as I do

  • IPad mini problem downloading

    Every time i try to download a free app on the iPad it asks me for my credit card info? Why?