For each help in JSP ?

Hi all
Does JSP support for each statement ??
Actually i need to cycle through each post variable like this in ASP
for each tempvarname in request.form
value1 = request.form(tempvarname)
pass=pass&value1
next
I am unable to do this JSP...
Can somebody help ?

Use JSTL's c:forEach tag.
<c:forEach items="${param}" var="item">
    ${item.key} = ${item.value}<br/>
</c:forEach>That said, the need for this is a smell. Rethink your approach.

Similar Messages

  • How can I keep the name of the user around for each JSP without asking user

    I have a number of JSP pages that I give the user access to once they login successfully. I want to be able to keep the name of the user present on every page without having to ask them for it each time.
    How can I do this? Currently I have a user object that is access through use of a request bean in my JSP's.
    Any suggestions???

    Thanks for the help. A few questions though...
    Can you just clarify how the 2 different SessionTest2.jsp's differ. I am right in thinking that the second one will instantiate a new bean object which if I do every time I go to the page, I will be getting the same name but in a different session each time. In the first SessionTest.jsp, I get the same name but from the same session object each time??
    Please clarify???
    SessionTest1.jsp
    <%@ page language="java" import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <jsp:setProperty name="testBean" property="name"
    value="ZZZZZ" />
    <jsp:setProperty name="testBean" property="status"
    value="Married" />
    <%
         response.sendRedirect("SessionTest2.jsp");
         return;
    %>
    SessionTest2.jsp
    <%@ page import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <%
    out.println("User Name is : "+testBean.getName());
    %>or SessionTest2.jsp
    <%@ page import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <%
    TestBean testBean =
    (TestBean)session.getAttribute("testBean");
         out.println("Name is : "+testBean.getName());
    %>Hope this helps.
    Sudha

  • Help with Jsp: logic:iterate  Cannot create iterator for this collection

    Hello,
    I am developing a jsp with struts. This is the snap of the code:
            <logic:iterate id="prod" collection="productList" >
              <tr align="center">
                   <td><html:text property="prodDesc" size="50" indexed="true"/></td>
                   <td>
                        <html:select property="prodUnit" indexed="true">
                             <option selected>-</option>
                            <OPTION VALUE='NMB'>NMB
                             <OPTION VALUE='TEN'>TEN
                             <OPTION VALUE='TPR'>TPR
                             <OPTION VALUE='GWH'>GWH
                        </html:select>
                   </td>
                   <td><html:text property="prodQty" size="20" indexed="true"/></td>
                   <td><html:text property="prodVal" size="20" indexed="true"/></td>               
              </tr>
            </logic:iterate>"productList" is defined as an array of Product[], "prod" is defined as a single Product object in the form. But when i run the page, it gives me this errors:
    "javax.servlet.jsp.JspException: Cannot create iterator for this collection".
    I also tried to make "productList" an ArrayList type, but it game me this same error.
    We are using Websphere 4.0 with Struts 1.1.
    Anyone can help?
    Thanks a lot.
    All the best,
    warren

    Hi , I have similar problem. wonder anyone can help me. I have a datastructure. ArrayList contains list of Hashtable; each Hashtable has two key-value sets ; for each key-value set , value is a ValueObject.
    My jsp works ok. but when I click on the radio butten for one radio group, it sets not only the porperty on that row, but the rows belows ,which suppose to be another radio group , because I am using indexed="true". each row should be a individual group seperated by the name poDisplayVO[i] , as show in the html generated .
    <!-- JSP -->
    <logic:iterate id="poDisplayVO"
    name="testForm"
    property="poDisplayVOList"
    type="java.util.Hashtable">
    <tr>
    <td>
    <bean:write name="poDisplayVO" property="name"/>
    </td>
    <td>          
    <% String val = ((java.util.Hashtable)poDisplayVO).get("subjAreaName").toString();%>
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="<%=val %>" />
    <bean:write name="poDisplayVO" property="subjAreaName"/>
    </td>
    <td>           
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="no" /> NO
    </td>
    <td>           
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="yes" /> YES
    </td>
    </tr>
    </logic:iterate>
    <! ------------------------ html genterated ------------------------------------------------>
    the HTML generated as folllows:
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="Accounting">
              Accounting
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="no"> NO
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="Bookkeeping">
              Bookkeeping
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="no"> NO
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[2].fosVO.select" value="Computerized Accounting(Duplicate)">
              Computerized Accounting(Duplicate)
    </td>
    <td>           
    <input type="radio" name="poDisplayVO[2].fosVO.select" value="no"> NO
    </td>
    <td>           
    <input type="radio" name="poDisplayVO[2].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <! ------------------------ action form-----------------------------------------------
    public ArrayList getPoDisplayVOList() {
         return poDisplayVOList;
    public void setPoDisplayVOList(ArrayList list) {
         poDisplayVOList = list;
    public Hashtable getPoDisplayVO(int i) {
         Object obj = poDisplayVOList.get(i);
         if (obj == null)
              obj = new Hashtable();
              poDisplayVOList.add(obj);
         return (Hashtable)poDisplayVOList.get(i);
    public void setPoDisplayVO(Hashtable programDisplayVO, int i) {
              poDisplayVOList.add(i, programDisplayVO);
         }

  • New To Iplanet app server.Can some one help me getting started by delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with iplanet docs..didnt quite get it. thanx

     

    Hi,
    What is that you are trying to accomplish ? Is it deployment or
    trying to develop applications ? Are you getting any errors ? If so,
    please post them to help you. I think the documentation is the best place
    for you to begin with.
    Regards & Happy New Year
    Raj
    Arif Khan wrote:
    New To Iplanet app server.Can some one help me getting started by
    delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with
    iplanet docs..didnt quite get it. thanx
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Pls help : How To select fields and data from user_table for each tablename

    Please help with the query to generate a output which selects the code,meaning,inuse for each table in the user_table that has "CODED" as a part of table name.
    User table has some 800 table that contains CODED in the tablename.
    Desc of the table:
    DESCPTION:
    Name Null? Type
    SHORT_NAME NOT NULL VARCHAR2(20)
    CODE NOT NULL VARCHAR2(4)
    MEANING NOT NULL VARCHAR2(240)
    IN_USE VARCHAR2(1)
    NOTES VARCHAR2(2000
    UNITS NOT NULL VARCHAR2(1)
    AMOUNT NOT NULL VARCHAR2(3)
    CONVERTED VARCHAR2(1)
    RUN_NAME VARCHAR2(30)
    But all the table have code, meaning,in_use fields.
    O/P format :
    TABLE_NAME CODE MEANING IN_USE
    Help me pls.

    Not 100% sure what you want. If you want to see all the tables that have all three of those columns, then you could do something like:
    SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
    FROM user_tab_columns
    WHERE column_name = 'CODE' and
          table_name like '%CODED%'
    INTERSECT
    SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
    FROM user_tab_columns
    WHERE column_name = 'MEANING' and
          table_name like '%CODED%'
    INTERSECT
    SELECT table_name, 'CODE', 'MEANING', 'IN_USE'
    FROM user_tab_columns
    WHERE column_name = 'INUSE' and
          table_name like '%CODED%'If you want to select those three columns from each of the tables, then you could do something like this.
    Create a command file called, for example, makesel.sql that looks like:
    SET PAGES 0 lines 500 trimspool on feedback off;
    spool sel.sql;
    prompt spool selout.txt;
    SELECT 'SELECT '''||table_name||''', code, meaning, in_use FROM '||
           table_name||';'
    FROM (SELECT table_name
          FROM user_tab_columns
          WHERE column_name = 'CODE' and
                table_name like '%CODED%'
          INTERSECT
          SELECT table_name
          FROM user_tab_columns
          WHERE column_name = 'MEANING' and
                table_name like '%CODED%'
          INTERSECT
          SELECT table_name
          FROM user_tab_columns
          WHERE column_name = 'INUSE' and
                table_name like '%CODED%')
    prompt 'spool off;'
    spool off;
    @sel.sqlAt the sqlplus prompt run the file using @makesel.sql. This will create another file called sel.sql containing the commands to select those three columns from each table that has all three columns, then after the new file is created, it runs the file (@sel.sql). The output will be spooled to a file called selout.txt.
    HTH
    John

  • SQL help: return number of records for each day of last month.

    Hi: I have records in the database with a field in the table which contains the Unix epoch time for each record. Letz say the Table name is ED and the field utime contains the Unix epoch time.
    Is there a way to get a count of number of records for each day of the last one month? Essentially I want a query which returns a list of count (number of records for each day) with the utime field containing the Unix epoch time. If a particular day does not have any records I want the query to return 0 for that day. I have no clue where to start. Would I need another table which has the list of days?
    Thanks
    Ray

    Peter: thanks. That helps but not completely.
    When I run the query to include only records for July using a statement such as following
    ============
    SELECT /*+ FIRST_ROWS */ COUNT(ED.UTIMESTAMP), TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD') AS DATA
    FROM EVENT_DATA ED
    WHERE AGENT_ID = 160
    AND (TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY')+(ED.UTIMESTAMP/86400)), 'MM/YYYY') = TO_CHAR(SYSDATE-15, 'MM/YYYY'))
    GROUP BY TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD')
    ORDER BY TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD');
    =============
    I get the following
    COUNT(ED.UTIMESTAMP) DATA
    1 07/20
    1 07/21
    1 07/24
    2 07/25
    2 07/27
    2 07/28
    2 07/29
    1 07/30
    2 07/31
    Some dates donot have any records and so no output. Is there a way to show the missing dates with a COUNT value = 0?
    Thanks
    Ray

  • Can any one help.  I have put music on my phone and its showing lots of the same covers for each song on the album, how do i make it into one album?

    Hi Can anyone help? I have put music on my i-phone but its showing lots of the same album cover for each individual song, how can I create one cover for the album?

    Do you have Sidebar ON?
    iTunes > View > Show Sidebar.
    Connect and select iPhone in iTunes Sidebar under DEVICES, choose the Music tab on the right, select Sync Music and whatever music you the on iPhone. Click Apply (bottom right)

  • My wife and I share an Ipad.   We each have our own email address and calendar.   What is the best way for us to backup both accounts (we currently only have 1 ICloud account)?   Thanks for any help!    Alan

    My wife and I each have our own email address and calendar.  These are on one IPad.   The Ipad has a single ICloud account.
    What's the best way to backup both Calendars, etc?   Does ICloud automatically back up every account on the same IPad?  (I checked ICloud, but I could only find my stuff.)
    Thanks for any help!
    Alan

    First, you need to understand that there's a difference between "syncing" and "backup".  Backup is the saving of content and settings, where syncing is the bidirectional transfer of content for an account to a web-based server (like iCloud, Gmail, Yahoo, etc.)
    If you see your calendar in your iCloud account, that implies that you have set up your iCloud account to host (sync) your calendar, and perhaps contacts, email, and notes.  An iCloud account can only sync one user's information at a time so it is intended to support a single user.  You can have more than one iCloud account, and you can even have more than one iCloud account on the same device (but one has to be primary, and the secondary iCloud has limited capabilities), but a single iCloud account only supports a single user's content.
    Backup is the saving of your device's content and settings to use in case you need to recover these things, but you can't see the contents of your backup (just the size and device name).  You can backup more than one device to iCloud and you can backup to iCloud or you can backup to your computer, or both (one at a time though, you have to choose). 
    So, if your wife has her own email and calendar she can certainly do that in parallel to whatever account(s) you have for email and calendar.  But if you have only one iCloud account then only one of you can use it for email, calendar, etc.  But the backup of these accounts is really just a backup of the device's settings that link the device to these accounts. For example, if she uses Gmail then the backup of the iPad only backs up the fact that your iPad is set up to use her account, it does not backup the account itself (the content of her account is saved and preserved on Google's servers, not your device's backup).
    Does that make better sense?

  • Two separate iPhones got merged into one iTunes account. How to separate them. We are sharing all of each other's contacts at this time. Thanks for your help.

    Two separate iPhones got merged into one iTunes account. How can I separate them in iTunes???????. We are sharing all of each other's contacts at this time. Thanks for your help.

    The reason you are receiving each other's text messages is because you are both using the same Apple ID for iMessage.  To prevent this you need to use different IDs.  (Note: you can still share the same ID for iTunes.)  On one of the phones, go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with a separate ID.
    To migrate your 3GS to a new iCloud account, start by saving any photo stream photos that you want to keep on the phone to your camera roll.  To do this, open the my photo stream album, tap Edit, tap the photos, tap Share, tap Save to Camera Roll.  Next, if you have any notes that you are syncing with iCloud that you want to keep, you'll need to email these to yourself so they can be recreated after moving to the new account.
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, choose Keep On My iPhone.  Next, sign back in with a different Apple ID to create the new account, turn iCloud data syncing preferences and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.
    Finally, if you have merged data in the two accounts that you want to separate you will have to go to icloud.com from your computer, sign into each iCloud account separately and manually delete the data you don't want from each account.

  • Safari 5.1 now is garbled with many of the sites having lines on top of each other. Is any one else having that issue? If so, how did you resolve it? Thanks in advance for any help.

    Safari 5.1 now is garbled with many of the sites having lines on top of each other. Is any one else having that issue? If so, how did you resolve it? Thanks in advance for any help.

    "Did you make the .psd file with a transparent background (checkerboard) in Photoshop? And when you placed it in AI did you choose the top option Convert Photoshop Layers to Objects?"
    Yep, and it still didn't work.
    But I figured what I did wrong: I was selecting both the text and the heart, and then I was doing the whole Object>Wrap Text>Make thing, as opposed to just selecting the heart and doing it. Once I did it, I moved the heart around on top of the text, and it "made room" for the pic, wrapping itself around the heart.
    Thanks so much, and thanks A MILLION for being so patient.
    Jeez, when can I get some textbook to learn all the intricacies of Illustrator?

  • Help Please.  I am setting up my macbook pro for a second user but office didn't transfer over.  Is there a way to have additional users on the same comp have office available without having to re-install it for each user?

    Help Please.  I am setting up my macbook pro for a second user but office didn't transfer over.  Is there a way to have additional users on the same comp have office available without having to re-install it for each user?

    mpr130 wrote:
    Help Please.  I am setting up my macbook pro for a second user but office didn't transfer over. Is there a way to have additional users on the same comp have office available without having to re-install it for each user?
    How did you attemp to transfer Office?
    OS X Lion: Set up a guest account

  • Please help with an sql to show more than one records into single row for each student

    From the following data I would like to create an sql to get the information  as the following layout
    studentid,  firstTerm,  EnglishMark1,ScienceMark1,MathsMark1, Secondterm,EnglishMark2,ScienceMark2,MathsMark2,
    ThirdTerm,EnglishMark3,ScienceMark3,MathsMark3 // As single rows for each student
    Example
    1 First, 30,40,20,Sec,30,40,20,  simillarly next row for next row for another sudent. Please help to generate the sql for the same.
    Please help it would be very appreciate.
    With Thanks
    Pol
    polachan

    create table yourdata (studentid int, term varchar(10), section varchar(50), Mark int)
    insert into yourdata values
    (1,'First','Math',20),(1,'First','English',30),(1,'First','Science',40),
    (2,'First','Math',20),(2,'First','English',30),(2,'First','Science',40),
    (3,'First','Math',20),(3,'First','English',30),(3,'First','Science',40),
    (1,'Sec','Math',20),(1,'Sec','English',30),(1,'Sec','Science',40),
    (2,'Sec','Math',20),(2,'Sec','English',30),(2,'Sec','Science',40),
    (3,'Sec','Math',20),(3,'Sec','English',30),(3,'Sec','Science',40)
    Select studentid
    ,max(case when term='First' and section='English' Then Mark End) as EnglishMark1
    ,max(case when term='First' and section='Science' Then Mark End) as ScienceMark1
    ,max(case when term='First' and section='Math' Then Mark End) as MathMark1
    ,max(case when term='Sec' and section='English' Then Mark End) as EnglishMark2
    ,max(case when term='Sec' and section='Science' Then Mark End) as ScienceMark2
    ,max(case when term='Sec' and section='Math' Then Mark End) as MathMark2
    ,max(case when term='Third' and section='English' Then Mark End) as EnglishMark3
    ,max(case when term='Third' and section='Science' Then Mark End) as ScienceMark3
    ,max(case when term='Third' and section='Math' Then Mark End) as MathMark3
    From yourdata
    Group by studentid
    drop table yourdata

  • Hi, dear friends,   I have a big problem:   Since I installed OS 10.9.3 MAV (Maverick), I am unable to use Adobe CS6. Each opening Photoshop attempt, the system tells me an error of type 6 or 16.   Thank you for your help, Guys,   Marius SANNA

    Hi, dear friends,
    I have a big problem:
    Since I installed OS 10.9.3 MAV (Maverick), I am unable to use Adobe CS6. Each opening Photoshop attempt, the system tells me an error of type 6 or 16.
    Thank you for your help, Guys,
    Marius SANNA

    Which version of Photoshop do you have? The current version is 13.0.6.

  • For Each Loop: Enumerator Configuration In the For each loop Editor Help needed

    Hi All,
    I have a package that runs and updates a table with everytime someone adds a flat file in the source folder. One of the requirement is to upload files with the following
    ACA Flat files will have a naming convention of “ACA_ccyy_<julian date>”  : How can I add this?
    Under Files this is how I have setup the qualifies "ACA_*.*"
    Is there anyway to pass the entire naming convention in the file section? If so how can I ?
    Please help?
    FM

    As you have ACA_*.* set in Files Filter, it will return all the files from the folder which start with ACA_.
    You can have one dummy Sequence Container inside FE Loop Container. Connect it to your starting task and do right click on Precedence Constraint and write the expression the way you want by using SSIS functions. If the expression is evaluated to True only
    then it will go to the next task.
    In this way you can skip Non-ACA files.
    Please refer:
    SSIS Skip Certain Files in a For Each Loop
    - Vaibhav

  • How can i see cost centre wise employee level salary breakdown for each month ? can anybody help me.

    plz anyone help me.

    thanks, Nguyen. can i get a employee salary breakdown for each month with this tcode.

Maybe you are looking for

  • HT201250 Circle and cross through iTunes icon afte the seagate hard drive replaced and restored data from time machine backup.

    Circle and cross through iTunes icon: had the seagate hard drive replaced and restored data from time machine backup. Why does the iTunes icon have a circle and cross through it? As though incomplete? tried everything and still Circle and cross throu

  • Video play - Iphone 4s to IPad new

    Hi i bought Ipad 4 16 GB last week. Already i have iphone 4s 32 GB. For the memory concern i want to store all of my videos and movies to Iphone and want to play it through the Ipad. Is it possible to stream the iphone video to Ipad without the physi

  • SQL Developer - Failure I/O Exception

    Hi I am new to Oracle. I have installed oracle on my system. SQL Plus is working fine. But When I tried to use SQL Developer with the same Username & Password, It is giving an error message: Status: -Io Failure Exception: The Network Adaptor could no

  • Error msg "unable to load" from Office2HD

    Converted pdf to DOC. Went to open within my Office2HD word processor. Get error msg "Load failed an error occurred while opening document". Original pdf document resident on my Google drive. How to open and subsequent edit?

  • All sql is working fine except for the COUNT statement ... ?

    This piece of code using taglib <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> <sql:query var="aantalantw" scope="session">           SELECT COUNT(*) FROM antwoorden </sql:query> <c:out value="${aantalantw}"/> This result should be som