EL : How do I insert a dynamic value in an expression ?

Hi,
Here's my code -
<c:forEach items="languageCodes" var="aCode">
<c:if test="${myMap.aCode} != null" >
doSomething
</c:if>
</c:forEach>
I need ${myMap.aCode} to work as if it was ${myMap.${aCode}}, invoking myMap's getter with the current value of the variable aCode, instead of myMap.get("aCode") with aCode as a String.
Any thoughts on this would be very much appreciated.

Should anyone stumbles into the same issue, the solution is pretty simple -
<c:set var="headerName" value="host"/>
${header[headerName]}
It's an excerpt from a very nice tutorial, over here -
http://java.sun.com/developer/EJTechTips/2004/tt0126.html
Balus, it's Your attitude that you may wanna [edit]. As soon as you grow up.

Similar Messages

  • How can i insert the variable value in MS ACCES Query

    i am creating one Query (query1) in MS ACCESS ( like we creaate Tables, Forms and Reports in MS ACCESS ) in this Query i have given 2 constent value in BETWEEN CLAUSE , after that i Created a CROSS QUERY which is based on the privious Query (query1).
    Now i want to insert the variable value using JSP and HTML in to Query(query1).
    Doing this i want to execute the Query (query1) with variable perameters and
    wants to get the risponce form CROSS QUERY.
    In this matter how can i insert the value in Query(query1) using JDBC and JSP.

    The query is
    Select ZMSGMAP.GROUP_CODE as 'group', ZMSDSTATE.STATE_DESC as 'state', ZMSTRN.YRMON, sum(ZMSTRN.CMAQTY) as 'qty' from ZMSDSTATE,ZMSGMAP,ZMSTRN Where ZMSTRN.STATE=ZMSDSTATE.STATE and ZMSTRN.PLANT=ZMSGMAP.PLANT_CODE and ZMSTRN.YRMON between "+p1+" and "+p2+" Group by ZMDGMAP.GROUP_CODE, ZMSDSTATE.STSTE_DESC, ZMSTRN.YRMONUsing this query i m trying to display the risult but the YRMON is displaying in a single column, i want to display it ia seperat columns. here p1 and p2 is YRMON(it is the yer month like 200102), for this solution i have created Cross table Query which is based on uper Query (query1) and design it column wise Display, it is givng the right display, but the problem is this i m not getting the technique throw which i can insert the variable values in to the query1 (which is designed in MS ACCESS).
    u can contact me on [email protected] for more details.

  • How to use Insert for mulit-values

    Can anyone help, I try to insert mulit-values using insert command. but keep getting error. here is the code.
    INSERT INTO PRODUCTS
    VALUES (
    'C','CABLE',39.95,
    'D','DSL',29.95,
    'U','DIALUP_56K',19.95);
    Thank you!

    The SQL you posted isn't valid, assuming that there are only three columns in your table. The type of insert statement you posted can only insert 1 row at a time.
    You could look into loading data into collections and using the bulk insert syntax to insert multiple values in a single statement. Please post to the PL/SQL forum if you need more assistance on this.
    Justin

  • How can i insert new updated values in a table??

    Hi ,
    Can any one suggest me is there any way to insert the recently added data from one table to another table where both the tables have the same structure.
    Suppose i have 10 rows in both table T1 and T2 and now if we add another 4 new rows in the table T2 .Can i update my table T2 w.r.t. T1 with these new row values.
    Remember both the 10 rows in the tables T1 and T2 are the same and the strucuture of the tables are also the same.
    please advice the way to achieve this and if then explain me how to achieve it?Looking forward for the response
    B.r
    debashis

    Hi shailendra and all experts,
    I thought of a more simple approach instead of going to the concept of stored procedure.But i am unable to do it on a scheduled basis like if i want this query to be run on a periodic basis i need to implement this sql query using a job.
    can u suggest how to do it..As far as i know we can include the sql query inside a job to be scheduled on a weekly basis.
    And also have a look at the sql i have written below it will insert all the extra row values of t2 into t1.please help me in scheduling it on a periodic basis .
    Looking forward for ur response .I am almost near the goal i need ur help ..
    reg
    debashis
    insert into t1 select distinct t2.apinumber,t2.wellname from t1,t2 where t2.apinumber NOT IN (select t1.apinumber from t1);

  • How can i insert into dynamic table  ?

    i have regular internal table with data  .
    i have dynamic table <dyn_tab>
    i insert the data from itab
    MOVE-CORRESPONDING ITAB TO <LS_LINE>.
        INSERT <LS_LINE> INTO TABLE <DYN_TABLE>.
    OK  , NOW I WANT TO ADD THE DATA FROM OTHER TABLE
    THAT HOLD THE DATA THAT ALL THE DYNAMIC TAB BUILD FOR
    HOW CAN I DO THIS INSERT  ?
    I NEED TO INSERT "KOSTL" TO MATCH LINE in <DYN_TABLE>
    THIS WHAT I TRIED TO DO :
          SHIFT INDX1 LEFT DELETING LEADING SPACE.
          CONCATENATE 'KOSTL' INDX1 INTO FIELD .
    ASSIGN COMPONENT FIELD  OF STRUCTURE <DYN_TABLE> TO <FS>.
    <FS> = IT_EKKN-KOSTL.
      but i get dump that <FS> not been assign .

    hi, 
    pls chk the sample code below.
    REPORT zmaschl_create_data_dynamic .
    TYPE-POOLS: slis.
    DATA: it_fcat TYPE slis_t_fieldcat_alv,
    is_fcat LIKE LINE OF it_fcat.
    DATA: it_fieldcat TYPE lvc_t_fcat,
    is_fieldcat LIKE LINE OF it_fieldcat.
    DATA: new_table TYPE REF TO data.
    DATA: new_line TYPE REF TO data.
    FIELD-SYMBOLS: <l_table> TYPE ANY TABLE,
    <l_line> TYPE ANY,
    <l_field> TYPE ANY.
    * Build fieldcat
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_structure_name = 'SYST'
    CHANGING
    ct_fieldcat = it_fcat[].
    LOOP AT it_fcat INTO is_fcat WHERE NOT reptext_ddic IS initial.
    MOVE-CORRESPONDING is_fcat TO is_fieldcat.
    is_fieldcat-fieldname = is_fcat-fieldname.
    is_fieldcat-ref_field = is_fcat-fieldname.
    is_fieldcat-ref_table = is_fcat-ref_tabname.
    APPEND is_fieldcat TO it_fieldcat.
    ENDLOOP.
    * Create a new Table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = it_fieldcat
    IMPORTING
    ep_table = new_table.
    * Create a new Line with the same structure of the table.
    ASSIGN new_table->* TO <l_table>.
    CREATE DATA new_line LIKE LINE OF <l_table>.
    ASSIGN new_line->* TO <l_line>.
    * Test it...
    DO 30 TIMES.
    ASSIGN COMPONENT 'SUBRC' OF STRUCTURE <l_line> TO <l_field>.
    <l_field> = sy-index.
    INSERT <l_line> INTO TABLE <l_table>.
    ENDDO.
    LOOP AT <l_table> ASSIGNING <l_line>.
    ASSIGN COMPONENT 'SUBRC' OF STRUCTURE <l_line> TO <l_field>.
    WRITE <l_field>.
    ENDLOOP.
    Regards
    Anver
    <i>if hlped pls mark points</i>

  • JDBC - how to handle insert that returns value (bind?)

    Hi,
    I'm trying to do an insert into a table in an Oracle database with an auto-incrementing primary key (using a trigger and sequence) and I need to retrieve the value after the insert. From SQL*Plus, I'd enter:
    var id number;
    INSERT INTO mytable (name) VALUES ('foo') RETURNING id into :id;
    whereupon if I do "print id", I get the value of the id field from the newly-inserted record.
    The big question is how to achieve the same thing using JDBC. I've been flailing around all morning trying to figure it out and suspect it has something to do with using a CallableStatement instead of a PreparedStatement, but all of the examples I've seen so far only deal with calling stored procedures instead of raw SQL, and they all omit the part where some variable is bound to the resultset.
    Assuming I want to have the Java variable (int? Integer()?) "newId" set to the value being returned by the SQL statement as "id" (or ":id"?), what do I need to do between getting the connection and looking at "newId" to see what the value returned by the statement is?
    ie,
    Connection conn = db.connect();
    int newId;
    // show me what I need to do here
    System.out.println("The id of the newly-inserted record is:");
    System.out.println(newId);Thanks!

    This is untested:
    use the executeUpdate() method from the Statement. The return value will be your result from the RETURNING id portion of your SQL statement, if not then you'll probably have to do a seperate select or/and explicit return to get the value back from SQL.

  • How can I increment a dynamic value each time the request is sent?

    One of my requests is passing a sequence number which gets incremented every time the request is sent. The sequence number is incremented in javascript on the client; the html looks something like this: target=target+"&sequenceNumber="+sequenceNumber++;
    How can I simulate that behavior in eload?

    In this case all we needed was a randomly generated incrementing number, so we used the timestamp function available within Navigation Editor which is lightweight and easy to use.
    Open Navigation Editor (Ctrl + E) >
    Select the Query String (or Post) parameter which should be randomly incremented and change its Type in the properties window to function. The function name will auto populate to TimeStamp.
    Save the script and run...

  • How to get and disply dynamic values on the fly and display in applet

    hello all ,
    i have a problem in refreshing a applet.
    i have a scrolling applet which will get the share values from the database and display in a scrolling applet in the browser . i am getting the values and displaying it.
    but the problem is , if i enter a new record in the database, until and unless i press refresh button of the browser, i am not getting the new values . please help me if anybody having the idea. please mail me to [email protected]
    thank you all.
    by
    samba

    You want a database update to trigger an applet refresh? Can't be done.
    However, you can have the applet periodically re-query the database and update its display with the information it retrieves. Just kick off a Thread that sleeps for a bit, wakes up, queries the db, updates the display, and goes back to sleep.

  • How do I return a true value for multiple expressions?

    Hi, I hope this question makes sense...
    In, for example, cell A1, I would like to return a True value when:
    C1>B1, and
    C2>B2, and
    C3>B3, and
    C4>B4, and
    C5>B5
    That is, if all column C values are greater than all corresponding column B values, then I would like to return a True value in cell A1.
    If one or more C values are less than or equal to their corresponding B values, e.g. B4<=C4, then I would like to return a False value in cell A1.
    Can this be achieved using a single formula in cell A1? If so what would that formula be?
    Thanks

    In column D I will insert the formula:
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",IF(C>B,"",1))
    In A1 I will insert:
    =SUM(D)<0
    or
    in column D
    =IF(OR(ISBLANK(B),ISBLANK(C)),"",C>B)
    in A1
    =COUNTIF(D,FALSE)=0
    Yvan KOENIG (from FRANCE mardi 2 septembre 2008 12:11:28)

  • How to access a request scope value in groovy expression of bind variable?

    I need to filter the VO query based on the username.Following is what I am doing:
    <af:commandButton text="#{translationviewBundle['LoginPage.LOGIN']}"
    id="cbLogin" partialSubmit="true"
    action="validate">
    <af:setPropertyListener to="#{requestScope.userName}"
    type="action"
    from="#{backingBeanScope.LoginUserBb._username}"/>
    </af:commandButton>
    In the bind variable(pUserName) I set the value as : adf.context.current.requestScope.get('userName')
    and the VO query :
    SELECT DISTINCT
    LANGUAGES.NAME,
    LANGUAGES.ISO_CODE LANGUAGE_CODE
    FROM
    LANGUAGES LANGUAGES, USER_LANGUAGES USER_LANGUAGES
    WHERE LANGUAGES.NAME <> 'English'
    AND LANGUAGES.LANGUAGE_CODE = USER_LANGUAGES.LANGUAGE_CODE
    AND USER_LANGUAGES.USER_ID = :pUserName
    ORDER BY NAME
    I get the following error: "Missing IN and OUT parameter at the index 1" and the query returns nothing.
    Any suggestions pls?
    Thanks,
    Swathi Patnam

    Your ADF BC layer shouldn't depend on a specific view layer, the best practice in such a case is to have an AM service method exposed to the client and have it accept a parameter.
    Something like this:
    http://blogs.oracle.com/shay/2010/07/am_service_method_-simpledem.html

  • How can i add a dynamic header value in to the pdf

    I am using a AssemblerService (Invoke DDX) to modify a Pdf file. How can i enter a dynamic value into the header using ddx ?
    DDX used
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
        <PDF result="Out1">       
            <PDF source="Doc2">
                <Header>
                    <Right>
                        <StyledText>
                            <p>"here i need to add a dynamic data from the process"</p>
                        </StyledText>
                    </Right>
                </Header>
            </PDF>
        </PDF>
    </DDX>
    Thank You.

    Insertion Point is a placeholder Object which is used to dynamically replace while assembling. Search through the assmber guide to get any hints.
    Nith

  • How to insert a default value into MS server in java - help please

    hi
    suppose if i have a table and one of the column has a default value when the table was created. how can i insert the default value into this column? assuming that the column is the second column and i can't specify the column name when inserting. thanks.

    thanks for ur response, so if i have insert statement as follow
    insert into someTable values (1,'val1', 'val2', 'val3', 'val4')
    and column 3 has default value = DEFAULT
    then, to insert default value, my insert statement will look like this
    insert into someTable values (1,'val1', 'val3', 'val4')
    but the number of values will not match the number of columns.

  • How can I insert data into the standard CRM tables ?

    Hi Experts,
    Scenario----
    I need to download few attributes (fields) from SAP MDM to SAP CRM via SAP XI. I'm using the 'COMT_PRODUCT_MAINTAIN_API' API for it.
    The attributes(fields) that are present in the strucutres of API are downloaded into CRM system (by executing the Inbound proxy that is created based on the Message Interface created on XI) by calling the functions present in the API.
    And for those fields that are not present in CRM, but need to be downloaded into CRM, I'm creating the Set Type attributes in CRM, which get appended to the API.
    My query is:
    There are fields in CRM into which I need to insert the values. But they are not listed in the API. So, how can I insert(/download) the values into these standard fields?
    Regret the long description. Intended to be clear.
    TIA. Points will be awarded.
    Regards,
    Kris
    Edited by: Kris on Jul 21, 2008 8:00 AM

    he INSERT program throws exception???
    can any one help me how to insert data into tabel.I have never used the jdbc driver to access, but what do you think that the flag READONLY=true means? An insert is not a read.
    Kaj

  • Insert 600 variable values in pop up filter of a web query

    Hello all,
    in order to analyze some Material movements I have to insert 600 material numbers in the selction of a query. In Bex Analyzer I can copy and paste the variable in the variable pop up screen.
    But when I execute the query in web the filter pop up screen is different to the sap gui pop up screen from Bex Analyzer.
    How can I insert 600 variable values in the variable filter screen when I execute a query in web?
    The BW release is 3.5 Any ideas would be great.
    Best regards,
    Stefan from Munich/Germany

    <FONT FACE = "Tahoma", Font Color = "Blue">
    Hi<br>
    I don't think that option is possible in Web Reporting. However you may include different ranges of material numbers at the same time for ths purpose.<br>
    Something is better than nothing
    <br><br>
    Hope it helps.<br><br>
    Cheers Abhijit<br>
    </FONT><FONT FACE = "Verdana", Font Color = "Red">
    removed
    </FONT>

  • Dynamic value in TVARVC table for standard report

    Hello,
    I am trying to archive objects like FI_DOCUMNT. For this purpose I want to create dynamic variant for the date. ( Date not in complete format) yyyy/mm.
    So, I created an entrie in TVARVC table, and I linked it with the attribute of my variant by choosing "T" option.
    My question is, how Can I fill the dynamic value for TVARVC entry?, knowing that it a standard report that is responsible for archiving.
    Cordialy,

    Hi Merou,
    this might help:
    Create Variant for dynamic population of current date
    Check the reponses about saving dynamic variants with column "L" and follow the rest of the instructions.
    Best,
    Sander    

Maybe you are looking for