C:forEach tag inside another c:forEach tag

Hi,
I've got en error when I tried to use <c:forEach> inside another <c:forEach> to display a vector of String arrays.
The error message is:
javax.servlet.ServletException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
The concerned section of the javabean mybean.java is:
//connect to database to get the resultset
ResultSet rs = cst.getResultSet();
if (rs != null) {
myVector = new Vector();
while (rs.next()) {
String myArray[] = new String[10];
myArray[0]=rs.getString(1);
myArray[1]=rs.getString(2);
myArray[9]=rs.getString(10);
myVector.addElement(myArray);
rs.close()
The concerned jsp calling the bean is:
<jsp:useBean id="theBean" scope="session" class="mybean" />
<jsp:setProperty name="theBean" property="..." />
<%
Vector myVector=theBean.getResultFromDatabaseIntomyVector();
pageContext.setAttribute("myVector",myVector);
%>
<table>
<c:forEach var = 'vectorItem' items='${myVector}'>
<tr>
<c:forEach var = 'arrayItem' items='${vectorItem.value}'>
<td><c out value='${arrayItem}'/></td>
</c:forEach>
</tr>
</table>
Can anyone show me what's the right jsp for displaying a vector of String arrays?
Thanks in advance.
Geraldine

I think your problem is with the second forEach loop.
The first for loop goes through the items in "myVector"
Each item "vectorItem" should be of type String[]
Accessing ${vectorItem.value} is what creates the error.
JSTL converts this as
vectorItem["value"] , can't turn the string "value" into an integer (to use as an array index) and thus throws an error.
To fix: use ${vectorItem} rather than ${vectorItem.value}
(nb you would use {vectorItem.value} if you were iterating over a Map, as the iterator exposes an object of type Map.Entry
Also in your code, I only see one closing tag for a forEach.
I think it should be like this (indented for readability)
<table>
<c:forEach var = 'vectorItem' items='${myVector}'>
<tr>
  <c:forEach var = 'arrayItem' items='${vectorItem}'>
    <td><c out value='${arrayItem}'/></td>
  </c:forEach>
</tr>
</c:forEach>
</table>Cheers,
evnafets

Similar Messages

  • Include a JSP inside another JSP

    Hi SDN,
    I am stuck with a problem. There is a JSP file available. In this JSP I have to add some more fields. But when I try to ad new fields I am getting a Portal Runtime Error stating that "Code Too Large". So now I thought of putting the new code in another JSP and include that JSP inside my main JSP. Here I cannot use <@include file="..."> because this finally compiles both the JSPs as one.
    So I tried to use <JSP:include>. Some one please help me with how to include a JSP inside another using <JSP:include>. Here both the JSPs are having HBJ content inside.
    I know that <jsp:include page="relPathOfChild.jsp"/> will include the child.jsp into my main jsp. Problem is both the JSPs are having HBJ content, so If I dont declare <hbj:content> tag inside the child jsp, it is throwing an error. But If I declare a <hbj:content> tag inside my child jsp, only child content is coming and main jsp content is not coming.
    Please help me..
    Regards,
    SrinivaS

    Hi,
    This Problem is solved. Now I am able to include a child JSP inside the parent JSP. But now the problem is,
    This Parent JSP will have 8 tabs. Now my chils JSP should come inside 7th tab.  but it is coming above the parent JSP.
    Below is how I am including my child JSP.
    <% try{ if(isCAR){
         %>
                   <tr>
    <jsp:include page="/pagelet/CAREligibility.txt" />
                   </tr>
                <%} } catch(Exception e) {}%>
    Please help.
    Regards,
    SrinivaS

  • How to import ADF JS packages inside another javascript

    Hi,
    I need to import the ADF Faces javascript packages inside another javascript,
    to be able, inside this javascript, to access the page components.
    How can I do this ?

    You can't embed one jspx inside other, you need to use jsf page fragments for this.
    Approach 1:
    - Create a page fragment for the second page(second.jsff)
    - Include this in first.jspx page using jsp:inpclude tag as in sample below:
    <!-- first.jspx -->
        <af:document id="d1">
          <af:form id="f1">
            <af:outputText value="First Page"/>
            <af:commandLink text="Include Second" id="includeLink" partialSubmit="true">
              <af:setActionListener from="true" to="#{requestScope.includeSecond}"/>
            </af:commandLink>     
            <af:panelGroupLayout visible="#{requestScope.includeSecond eq true}"
                                 partialTriggers="includeLink">
              <jsp:include page="/second.jsff"/>
            </af:panelGroupLayout>  
          </af:form>
        </af:document>Approach 2:
    - Create a bounded taskflow with page fragments and drop a view and generate second.jsff for this view
    - Drop this taskflow as region inside first.jspx and set the visible property as given above in sample code to show only on clicking commandImageLink
    Sireesha

  • Scheduling one background job inside another

    Hi All,
    Is it possible to Scheduling one background job inside another.? i.e In my Z program I am calling job_open, job_submit, job_close and to execute one standard report in background. And after that I am executing my Z program itself  from SE38 as Program->Execute->Background->Execute Immediately. Is this logically correct? I am asking this because I am not getting the desired result
    Thanks & Regards,
    Neethu.

    HI,
    Check the job steps in SM36.
    First schedule the Standard job and in the job steps schedule the z report.
    Schedule job in chain

  • How to access a variable from inside another symbol

    So i did this tutorial, Leveraging Independent Symbol Timelines created by Eliane...it's rockin, btw.  ;-)
    All's well but now i have a symbol on the stage called mc-home.  inside of mc-home is a button called btn-go.
    On the stage in composition ready there's a variable sym.setVariable("current", "mc-home");
    This code works for a symbol that's on the stage but, how do i get this code to work on a button that's inside another symbol that's on the stage?
    var current = sym.getVariable("current");
    if (current != "") {
        sym.getSymbol(current).play("OUT");
    sym.getSymbol("mc-something").play("IN");
    sym.setVariable("current", "mc-something");

    sorry, i was kind of confused myself too, don't worry about it but thanks for your patience for reading it anyway

  • How can I insert a folder inside another folder

    is it possible to have sub folders
    I want to create 3 main folder
    MainFolder 1, mainfolder2, mainfolder3
    And I want to have 5 folders inside mainfolder 1
    so when the user click on mainfolder 1 , will see 5 folder in it , not next to it
    sincerely yours
    Riade Asleh

    So far I have not got any solution
    i want a folder inside another folder
    for example
    i have to main folders , folder 1 , folder2
    folder1.top =25
    folder1.left =10
    folder2.top =25
    folder2.left =115
    now, I wan a sub folders inside folder1
    subfolder1.top =50 not 25
    subfolder1.left =30
    I dont' want the subfolder1 to have the same top as folder1.top
    it's seems that all folders must have the same top value
    because when I changed the value of the subfolder1.top to 50, the value of folder1.top, and folder2.top  changed to 50, in which i don't want it to behave like that
    if you have a sample code,  please sent it to me
    sincerely yours
    Riade Asleh

  • How to use one hash table inside another hash table

    Hi everyone,
    Any example of hash table inside another hash table.
    Can one here help me how to write one hash table inside another with repeating keys for the first hash table.
    Thanks,
    kanty.

    Do you mean you want the 'value' entries in a hash table to themselves be hash tables? Easy but this often indicates a design flaw.
    Hashtable<String,<Hashtable<String,Value>> fred = new Hashtable<String,<Hashtable<String,Value>> ();But what do you mean by "with repeating keys for the first hash table"?
    Edited by: sabre150 on Jul 2, 2010 10:11 PM
    Looks like you have already handled the declaration side in your other thread. I suspect you should be writing your own beans that hold the information and these beans would then be stored in a Map. The problem I have is that your description is too vague so I can't be certain.

  • How to register one MBean inside another MBean

    Hi All,
    When i try to register one MBean(DynMBean1) inside another(DynMBean2) by passing object name of this MBean as attribute to the other MBean,iam getting the following error:
    Following shows the adapter interface
    List of MBean attributes:
    Name Type Access Value
    DynBean2 java.lang.ObjectName RW Type Not Supported: [                                                      [DynBean2:bean=sample]
    name java.lang.String RW
    if the above code works properly,in the ''value' column there should be ''view' button and only [DynBean2:bean=sample]' should be present in the value column.Also,if we click on Can any predict what the problem is......?
    Regards
    Ravi
    Mail Me:[email protected]

    I don't understand what you mean by register a bean inside another bean.

  • Retreiving the file names from directory inside another directory from application server

    Hi,
    I had a problem in retreiving the file names from a directory inside another directory.
    I tried using the FM's  SUBST_GET_FILE_LIST, RZL_READ_DIR_LOCAL and EPS_GET_DIRECTORY_LISTING
    But here I am getting only one directory details.
    Actually my file is located a directory inside one more directory and one more directory and inside the files are located.
    i.e total 3 directories inside the 3rd one my files are there.
    I need to read the latest file name in the directory.
    So that i can do some manipulation after getting the file name.
    Is there option like OPEN DATASET , READ DATASET and CLOSE DATASET?
    Can anyone please let me know How can i acheive this one.
    Regards
    Ram

    Hi Ram,
        Following thread can be helpful for you, were it shows in the tables structure rsfillst a field RSFILLST-TYPE whether its a directory or file..........
    http://scn.sap.com/thread/865272
    thanks and regards,
    narayan

  • Problem in reading an object inside another obj in C thru JNI

    Hi All,
    I am passing a java class object from Jave to C thru JNI.
    This object has many integer fields + one object of another class, which also has some fields.
    I am able to read integer fields from C but not able to read fields inside another object.
    Can anyone plz help me in reading the object inside another object from C.
    I m pasting class here for better understanding :
    public class ImageMergeInformation {
    public ImageInformation outputImageInfo;
    public ImageInformation[] inputImageInfo = new ImageInformation[8];
    public int topMargin;
    public int bottomMargin;
    I wanna read ImageInformation obj.
    Plz help me...
    Thanks in Advance,
    Regards,
    Sneha

    You have to get the field id (getFieldID) of the variable you want, e.g. outputImageInfo, then get the object (getObjectField) in that field. At this point, you can start over (get the class, get the field id, get the object).

  • How to put an MSO inside another MSO

    Hello all!
    An interesting question came up in the following post by Folobo:
    http://forums.adobe.com/message/4572897#4572897
    "Is it possible to use a slideshow embedded in a big overlay slideshow?"
    I'd like to rephrase this question:
    "Is it possible to put a MultiStateObject (MSO) inside another MultiStateObject?"
    And further: if the answer is "yes", could we put that to use with the DPS?
    @Folobo – this is an interesting question. A quick test is showing that you cannot do it in the UI (correct me if I'm wrong).
    Let's try it this way:
    If you have two objects:
    1. an MSO #1 (with two rectangles, rectangle #1, rectangle #2)
    2. Another rectangle on the page: rectangle #3
    Now select the two objects and make an MSO out of it (using the "Object States" panel).
    You would think, now I get an MSO with two states, state 1 with rectangle #3 together with state 2 with MSO #1.
    But not so:
    Result: One new MSO with three states (rectangle #1, rectangle #2, rectangle #3)
    Hm. I don't give up on that. Let's try it another way:
    Could we select at least two objects inside a state of an MSO and make that a new MSO?
    Sure, We could select two objects inside a state, but since we are *inside* an MSO the "Object States" panel does not show the possibility to make a new MSO. You can only add states or add objects to states…
    Frustrating. End of story? Maybe…
    Be forewarned. The following is highly experimental!
    Let's try it by scripting (ExtendScript/JavaScript).
    The scripting reference is showing that an MSO "MultiStateObject" object has an add()-method. And further on, that add()-method could be applied to:
    Document
    Spread
    MasterSpread
    Page
    Layer
    pageItem
    And that is the key to a possible solution. We could add a new MSO to a "pageItem" object.
    A simple rectangle should be qualify for a "pageItem" object; and that, of course, could reside in a state of an MSO.
    So, we could add a new MSO to a rectangle inside of a MSO!
    How can we access a rectangle inside a MSO? Easy: We could select it and work with that selection.
    So let's do that: select the rectangle in the first state of an MSO and run this one-line-script (be sure you did select the rectangle and not the MSO or one of its states:
    app.selection[0].multiStateObjects.add();
    We now have an MSO inside another MSO!
    Explanation:
    A "generic MSO" was added with the add()-function to a selection (the container object: in our case the selected rectangle).
    The "generic MSO" is a two state MSO consisting of one rectangle in each state of a very small size (10px x 10px).
    At first it is invisible, because it is very likely that it is positioned outside the geometric bounds of its container object (the rectangle).
    But we can customize this!
    Go to the layers palette and select the new MSO, move it inside the geometric bounds of its container object, readjust its size, add states as you wish, populate the states with images, and other objects etc.pp.
    So, what can we do with an MSO inside another MSO? (As I already said, this is highly experimental.)
    My experiments with that are very fresh. I did not try a lot. But it seems that we could at least autoplay this MSO.
    I have to test more thoroughly what is possible and what will work with buttons etc.pp…
    I really like to hear from you what you will find out and if you can put it to any use.
    Uwe
    Message was edited by: Laubender

    @Mobly – in case it did not work out for you, here some screen grabs for the different steps:
    1. Select an MSO:
    2. Select a "graphic frame" inside the MSO; in this case a "<square>"; you can see the big blue dot in the Layers panel behind the generic name "<square>":
    3. Open the Scripts Panel and select the script:
    4. Run the script by double-clicking the script; the generic name of your selected object has changed to "graphic frame", but trust me, it's still a square…
    5. Click the "Ok" button of the message and InDesign will select the new MSO ("Multi-state 2") as you can see here. It has two states with one rectangle each,  fill and stroke is "None":
    And: you can see that this new MSO is nested inside the MSO ("Multi-state 1").
    What you do with that construct is up to you:
    6. Color the "<square>" of state 1 of "Multi-state 2":
    7. Resize and change position of "Multi-state 2":
    8. But remember: "Multi-state 2" is nested in the graphic frame you selected before running the script:
    I hope you get the picture now…
    Uwe

  • Get the ID of a dynamically created symbol from library, INSIDE another symbol.

    Hi everyone,
    I'm trying to get the id from a dynamic created symbol from library.
    When dynamically creating the symbol directly on the stage (or composition level), there's no problem.
    But I just can't get it to work when creating the symbol inside another symbol. 
    Below some examples using both "getChildSymbols()" and "aSymbolInstances" 
    // USING "getChildSymbols()" ///////////////////////////////////////////////////////////////////////// 
    // ON THE STAGE 
    var m_item = sym.createChildSymbol("m_item","Stage");
    var symbolChildren = sym.getChildSymbols(); 
    console.log(symbolChildren[0].getSymbolElement().attr('id')); // ok eid_1391853893203
    // INSIDE ANOTHER SYMBOL
    var m_item = sym.createChildSymbol("m_item", sym.getSymbol("holder").getSymbolElement()); 
    var symbolChildren = sym.getSymbol("holder").getChildSymbols(); // Am i using this wrong maybe?
    console.log(symbolChildren.length) // returns 0 so can't get no ID either
    // USING "aSymbolInstances"" ////////////////////////////////////////////////////////////////////////// 
    // ON THE STAGE
    var m_item = sym.createChildSymbol("m_item","Stage"); 
    console.log(sym.aSymbolInstances[0]); // ok (i guess) x.fn.x.init[1] 0: div#eid_1391854141436
    // INSIDE ANOTHER SYMBOL
    var m_item = sym.createChildSymbol("m_item", sym.getSymbol("holder").getSymbolElement());
    console.log(sym.getSymbol("holder").aSymbolInstances[0]); // Javascript error in event handler! Event Type = element 
    In this post http://forums.adobe.com/message/5691824 is written: "mySym.aSymbolInstances will give you an array with all "names" when you create symbols"
    Could it be this only works on the stage/ composition level only and not inside a symbol? 
    The following methods to achieve the same are indeed possible, but i simply DON'T want to use them in this case:
    1) Storing a reference of the created symbol in an array and call it later by index.
    2) Giving the items an ID manually on creation and use document.getElementById() afterwards.
    I can't believe this isn't possible. I am probably missing something here.
    Forgive me I am a newbie using Adobe Edge!
    I really hope someone can help me out here.
    Anyway, thnx in advance people!
    Kind Regards,
    Lester.

    Hi,
    Thanks for the quick response!
    True this is also a possibility. But this method is almost the same of "Giving the items an ID manually on creation and use document.getElementById() afterwards".
    In this way (correct me if i'm wrong) you have to give it an unique ID yourself. In a (very) big project this isn't the most practical way.
    Although I know it is possible.
    Now when Edge creates a symbol dynamically on the Stage (or composition level) or inside another symbol it always gives the symbol an ID like "eid_1391853893203".
    I want to reuse this (unique) ID given by Edge after creation.
    If created on the stage directly you can get this ID very easy. Like this;
    var m_item = sym.createChildSymbol("m_item","Stage");
    var symbolChildren = sym.getChildSymbols(); 
    console.log(symbolChildren[0].getSymbolElement().attr('id')); // ok eid_1391853893203
    I want to do exactly the same when created INSIDE another symbol.
    var m_item = sym.createChildSymbol("m_item", sym.getSymbol("holder").getSymbolElement());
    Now how can I accomplish this? How can I get the Id of a dynamically created symbol INSIDE another symbol instead of created directly on the stage?
    This is what i'm after.
    Thnx in advance!

  • Loading a SWF inside another SWF question

    Hello friends,
    1. (IMPORTANT) As all we know when putting some Flash SWF
    inside an HTML page, normally it starts playing as soon as its
    first frame is loaded.
    Now in my case I have to load a SWF (let call it Flash A)
    inside another Flash, I used mx.controls.Loader control to do this.
    But this internal loaded SWF (Flash A) doesn't display untill it is
    completely loaded. Although what is interesting is that if it
    contains a sound track I can hear it while it is being loaded.
    I wana know is there any way that we can make this Flash
    display while being still loaded.
    2. Is there anyway to change a Flash playback FPS at runtime?
    Thank you so much for any note and help.
    - M

    damatrixhasu wrote:
    > i want to know how i can load a flash inside another
    flash container
    go to help - search for 'loadmovie'
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • I need help with searching for an image inside another image

    I need to write a program that checks for a specific image (a jpg) inside another, larger, image (a jpg). If so, it returns a value of true. Can anyone help me?
    Winner takes all. First person to solve this gets 10 dukes.
    Please help.

    Hi,
    I would use a full screen image Sequence made with png for transparency and put your article behind. no auto play, stop at first and last image. and information for swipe to display article.

  • Box inside another box in SMARTFORM for hierarchical item data printing

    Hi All,
    I need to put a <b>box inside another box</b> and <b>both the boxes need to be bordered</b>. There are 2 levels of main data to be printed in the 2 boxes. Header data will be printed in the outer box and corresponding to each header row a number of line items will be printed in the inner box.
    There will be multiple numbers of headers as per requirement. How can this feature be implemented in SMARTFORM / SAP-script?

    Hi ,
    You can try using a combination of variable window and main window to achieve what you are lookoing for.
    You will have to use Main window instances such a way similar to newspaper printing.
    Cheers
    VJ

Maybe you are looking for

  • Relation between Rollup and compression.

    Hi All, Is there a relation between rollup and compression ? i.e if i compress the cube, will the rollup job be faster ?

  • Form Bad Value  coz of UDO

    Hi all, I have a text Box that i have binded(UDO) to a database data source through xml. That text BOx is linked to a choose from list . Through coding When i try to fill the textbox (which is linked to choose from list)  from the choose from list am

  • SOD Violations at R/3 Backend

    Hi all, we are using GRC 5.2 version,and Backend R/3 is ECC6.0,wen i am changing at user level i.e in su01 if i add any role it is showing that Checking SOD Violations at Object Level with Time stamp at Status bar. But when i am changing any thing in

  • MT103 payment output

    I have ameded a couple of standard function modules used to produce the tags for this output.  But the actual output produces as header line HSBCSGSG - see below, and the bank have came back and said they don't want this line.  My problem is I can't

  • Apple symbol turns to block on boot screen and won't load past the screen

    -This new problem has occured when I boot my G4 MDD. -The Apple symbol appears on the screen and the loader at the bottom continues to spin. -Until a gray block appears in place of the Apple logo. I can hear the computer still reving up until a certa