Pls help me writing logic:iterate tag in jsp page

Hey guys , I am struck in retriving string p1,p2,p3 in the jsp page
Pls have a look ata the code
In DAO class:-
StdprdDAO.java
Public arrayList getPFP()
ArrayList a = new ArrayList();
While(rs.next())
     columnsVO colVO = new columnsVO;
     colVO.setProduct(rset.getString(1));//will store in String colProduct
     colVO.setFamily(rset.getString(2));//will store in String colFamily
colVO.setPrice(rset.getString(3));//will store in String colPrice
a.add(colVO);
return a;
In Action Class:-
ArrayList final = null;
StdprdDAO DAO = new stdprdDAO();
final = DAO.getPFP();
For(int i = 0; final !=null && i<final.size() ; i++)
     columnsVO VO = null;
     VO = (columnsVO)final.get(i);
     String p1 = (String) VO.getProduct();
     String p2 = (String) VO.getFamily();
     String p3 = (String) VO.getPrice();
     Request.setAttribute(“p1”,p1);
     Request.setAttribute(“p2”,p2);
     Request.setAttribute(“p3”,p3);
In JSP PAGE:-
id = “columnsVO”>
<bean:write name = “columnsVO” property=”final” id=”p1”>
but still I am doubting my above sentences in jsp page ,so pls correct them if possible.
Instead of l;ogic:iterate can I use directly getattribute(“p1”)? <logic:iterate
Still I m doubting I can not utilize columnsVO file in logic:iterate, I can utilize only formbean file.
So pls help me with this.

May I ask why have you done it?
If it is related to printing of the list then it is of no use.But it IS of use. The objects compEmployees is in scope.
It has the list we want to print out.
With logic:iterate:
<table>
     <tr>
       <th>Number</th>
       <th>Employee</th>
     </tr>
     <logic:iterate name="compEmployees" property="totalEmps" id="emp">
          <tr>
            <td>
              <bean:write name="emp" property="empNo"/>
            </td>
            <td>
              <bean:write name="emp" property="empName"/>
            </td>
          </tr>
     </logic:iterate>
</table>or alternatively with JSTL and c:forEach
<table>
     <tr>
       <th>Number</th>
       <th>Employee</th>
     </tr>
     <c:forEach items="${compEmployees.totalEmps}" var="emp">
          <tr>
            <td>
              <c:out value="${emp.empNo}"/>
            </td>
            <td>
              <c:out value="${emp.empName}"/>
            </td>
          </tr>
     </c:forEach>
</table>Cheers,
evnafets

Similar Messages

  • How can I write the analogous code to the logic:iterate tag functionality

    Hai This is Rayalu .And I am very new to the Java World. I have a doubt?.How can I write the analogous code to the<logic:iterate> tag functionality using the JSP Tag Libraries . Pleae Send me some examples .

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

  • Problem in Iterating using logic:iterate tag

    Hi ,
    I am using <logic:iterate> tag to iterate through a list of contents.
    When the List size is 1222, all the Contents in the List are displaying properly.
    When the size execdes 1223, the JSP is not displaying properly.
    I am not getting any exception also.
    I have added try and catch. Still it is not showing any exception.
    When the size is more than 1300, Some contents are not displaying in JSP.
    Can any one provide some inputs, so that I can crack my issue.
    The JSP code :
              <logic:iterate id="someXXXX" property="someXXX" name="someXXX" indexId="count" scope="request">
              <tr>
    <td><html:text name="someXXXX" property="someXXXX"
                             size="50" maxlength="50" onchange="setDirty()" indexed="true"/> </td>               
    <td height="15" align="center"><html:checkbox property="someXXXX" name="someXXXX" indexed="true" onclick="setCheckboxFlag(this)" />               
                   <td width="4"> </td>               
              </tr>
              <html:hidden property="someXXXX" name="someXXXX" indexed="true" />
              </logic:iterate>
    Thanks,
    RamaKrishna

    get the records and store them in a collection. Store the collection in session. take the first 10 records as a subset and pass it to the iterate tag. use the hidden field to keep the last record number in the jsp. So when you first see the jsp the first 10 records will be shown and when user clicks for next records send the hidden field value to the server and take next 10 records as subset and pass it to iterate tag. This is how you can do this. but if you have thousands of records storing them in the session is not recommended. you can pull them directly from the database.

  • C:forEach and logic:iterate tags repeating elements of a collection

    I have an issue that makes absolutely no sense to me. Basically I am using struts, and I am returning a form that contains a List of customers. I am simply trying to iterate that list into a simple table for each customer. The end result will have rows for each table, but I tried to simplify this example.
    The only filter is that I don't want to display customers that don't contain any data that I care to display. In my dataset, there is only one customer that has any data that I care about, and that has been verified in the database and in the backend action feeding the struts page.
    I first attempted this with the c:forEach JSTL tag. What I saw was that the customers were just getting repeated. Instead of showing one table for each customer, it was repeating the tables for each customer equal to the size of the Collection. For example, there were *5* customers in the List, only customer C should have been set into a table, but the table for customer C was being repeated *5* times. I went into the backend code, and made sure the object being sent back to struts contained the correct number of records.
    I then tried the same thing using the logic:iterate Struts EL tag. This did exactly the same thing. Instead of one table for customer C, I had 5 tables, all for customer C.
    Frustrated, I then went back to just writing a basic scriptlet in the JSP, to iterate over the object returned from the struts action. When I did this, everything came back as normal. Only customer C met my conditional statement, and only customer C had a table created in the generated HTML.
    Now I must be missing something with how the JSTL tags are handling the iteration, so I wanted to post the code to see if anyone had any idea what I am doing wrong here.
    The JSP page is found below. As you can see, the first part is done as a scriptlet, and the last part is done with JSTL tags. Unless I am mistaken, the 2 approaches should produce the same result. Please let me know if I am missing something here.
    <%@ include file="/common/customConfig.inc"%>
    <%@ page import="java.util.Iterator,
        com.pw.cemp.webapp.common.forms.CempDocumentsForm,
        com.pw.cemp.webapp.common.views.CustomerView"%>
    Write table with straight scriptlets...
    <br />
    <br />
    <%
        CempDocumentsForm cdForm =
            (CempDocumentsForm) session.getAttribute("cempDocsForm");
        Iterator itCustomers = cdForm.getCustomers().iterator();
        while (itCustomers.hasNext())
            int idx = 0;
            CustomerView customer = (CustomerView) itCustomers.next();
            if (customer.getCemps() != null && !customer.getCemps().isEmpty())
    %>
            <table>
                <% if (idx == 0) { %>
                    <caption>
                        Customer CEMP Listing
                    </caption>               
                <% } %>
                <tbody>
                    <tr>
                        <td class="level1">
                            <%=customer.getName() %> -
                            <%=customer.getSapCustomerId() %>
                        </td>
                    </tr>
                </tbody>
            </table>
    <%      
            idx ++;
    %>
    <br />
    <br />
    Now try using JSTL...
    <br />
    <br />
        <logic:iterate name="cempDocsForm" property="customers" id="customer" indexId="index">
        <!-- <c:forEach items="${cempDocsForm.customers}" var="customer" varStatus="status"> -->
            <c:if test="${not empty customer.cemps}">           
            <table>
                <c:if test="${index == 0}">
                    <caption>
                        Customer CEMP Listing
                    </caption>
                </c:if>
                <tbody>
                    <tr>
                        <td class="level1">
                            <c:out value="${customer.name}" /> -
                            <c:out value="${customer.sapCustomerId}" />
                        </td>
                    </tr>
                </tbody>
            </table>
            </c:if>
        <!-- </c:forEach> -->
        </logic:iterate>
        <br />
        <br />The code above produced the following HTML. As you can see, the scriptlet did exactly what I wanted, it produced 1 table for the only company that met the conditional statement. The JSTL section repeated the table for that one company, equal to the number of items in my List.
    Write table with straight scriptlets...
    <br />
    <br />
            <table>
                    <caption>
                        Customer CEMP Listing
                    </caption>                           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
    <br />
    <br />
    Now try using JSTL...
    <br />
    <br />
            <table>           
                    <caption>
                        Customer CEMP Listing
                    </caption>           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>       
            </table>
            <table>
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
            <table>           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
            <table>           
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
            <table>       
                <tbody>
                    <tr>
                        <td class="level1">
                            FMP Test Company -
                            5
                        </td>
                    </tr>
                </tbody>
            </table>
        <br />
        <br />Thanks in advance...
    Edited by: cdbyrd on Feb 28, 2008 4:22 PM
    Edited by: cdbyrd on Feb 28, 2008 5:12 PM

    Okay, it looks like I kept moving things around until I stumbled upon something. One thing to note is that I am using Tiles in my struts 1.2.9 application. I don't know if that has anything to do with it, but this is what I found.
    If you notice in my code, with the iteration tags, I had one active and one commented version of the tag. I kept flipping them around, thinking it was some kind of syntax problem or it was specific to either the logic:iterate or c:forEach tag.
    Well, as it turns out, when you comment something the way I did, I think the custom tag processor doesn't ignore the commented sections. I had things commented like the following.
        <logic:iterate name="cempDocsForm" property="customers" id="customer" indexId="index">
        <!-- <c:forEach items="${cempDocsForm.customers}" var="customer" varStatus="status"> -->Now I have done this many times in the past, and I have never noticed any adverse behavior. I guess it was just the correct situation here to make the problem come to the surface. As soon as I removed any comments on the JSP, the page started working as expected. I can't explain why it happens, I just know it happened.
    Does anyone out there have a good explanation for this, so I can put a reason to why I lost so much hair today? Also, does anyone have the proper way to comment out JSTL tags to keep them from being parsed?
    Thanks...

  • Using Strut Logic Iterate tag in JavaScript

    Has anyone tried this or experienced this problem.
    I have JSP pages with JavaScript imbedded. Not my web page but an out of the box portal we bought from a vendor. The JavaScript uses the Logic Iterate Strut tag but gives an error in Nitro:
    "feature is not resolved" on the lines where getLink() and getID() are called. I have put the code in other editors and it does not give me any error. Does any one have a clue to why this error occurs or is this something that NitroX can not handle?
    Thanks,
    Zim 8)
    Some of Code:
    function selectFolder(folderName,doExpandPath)
                        if (typeof(doExpandPath) == 'undefined')
                             doExpandPath = true;
                        var form = document.forms['TreeForm'];
                        // unselect old one
                        var cell = document.getElementById(selectedId);
                        if (null != cell)
                             cell.className = '';
                        // select new one
                        if ('/' == folderName.charAt(folderName.length-1))
                             folderName = folderName.substring(0,folderName.length-1);
                        var targetCellId = 'cellLabel./Documents'+folderName;
                        var isContentFolderBrowser = true;
                        try {
                             var sideBarSelected = top.frames['main'].window.sideBarSelected;
                             isContentFolderBrowser = '/getfolderitems.do' == sideBarSelected;
                             if (!isContentFolderBrowser) {
                             <logic:iterate id="feature" name="userinfobean" property="sideBarFeatures"
                                       type="com.actuate.activeportal.functionality.config.Feature">
                                       if (sideBarSelected == '<%= feature.getLink()%>' )
                                            targetCellId = 'cellLabel./<%= feature.getID()%>';
                                  </logic:iterate>
                        } catch (e) {
                        cell = document.getElementById(targetCellId);

    May I ask why have you done it?
    If it is related to printing of the list then it is of no use.But it IS of use. The objects compEmployees is in scope.
    It has the list we want to print out.
    With logic:iterate:
    <table>
         <tr>
           <th>Number</th>
           <th>Employee</th>
         </tr>
         <logic:iterate name="compEmployees" property="totalEmps" id="emp">
              <tr>
                <td>
                  <bean:write name="emp" property="empNo"/>
                </td>
                <td>
                  <bean:write name="emp" property="empName"/>
                </td>
              </tr>
         </logic:iterate>
    </table>or alternatively with JSTL and c:forEach
    <table>
         <tr>
           <th>Number</th>
           <th>Employee</th>
         </tr>
         <c:forEach items="${compEmployees.totalEmps}" var="emp">
              <tr>
                <td>
                  <c:out value="${emp.empNo}"/>
                </td>
                <td>
                  <c:out value="${emp.empName}"/>
                </td>
              </tr>
         </c:forEach>
    </table>Cheers,
    evnafets

  • Pls help me writing a view

    Hi All,
    We have few tables , per_jobs table gives the details of the all jobs defined,
    PAY_JOB_WC_CODE_USAGES table contains the all the compensation codes defined and PAY_STATE_RULES
    table contains the all the state codes.
    Now, SELECT WC.STATE_CODE,
    PJ.JOB_ID,
    PSR.NAME STATE_NAME,
    PJ.NAME JOB_NAME
    FROM per_jobs pj,
    PAY_JOB_WC_CODE_USAGES WC,
    PAY_STATE_RULES PSR
    WHERE PJ.JOB_ID(+) = WC.JOB_ID
    AND WC.STATE_CODE(+) = PSR.STATE_CODE
    This Query gives the job_names which are defined in a state..
    But, Now what I want is
    I want to get the Job Names which are not defined in each state for that I want to create a view
    So, Could u pls help me in writing this Query.
    Example,
    SELECT * FROM PER_JOBS
    where job_id not in (select job_id from PAY_JOB_WC_CODE_USAGES where STATE_CODE = 'VA')
    This will give the job details which are not defined in the State called "VA"..
    But, I want all the Jobs which are not defined in all the states..
    Thanks

    Hi Gaurav,
    I want to get the job names as well as State name for each state which jobs are not defined
    This query will give The jobs which are defined in each state
    SELECT PJ.JOB_ID,
    PJ.NAME,
    WC.STATE_CODE,
    PSR.NAME STATE_NAME
    FROM PER_JOBS PJ,
    PAY_JOB_WC_CODE_USAGES WC,
    PAY_STATE_RULES PSR
    WHERE PJ.JOB_ID = WC.JOB_ID
    AND WC.STATE_CODE = PSR.STATE_CODE
    But, i want those jobs which are not defined in each state , not only one state but also each state and unassociated jobs for that state
    Thanks

  • JavaBeans and Tags in JSP pages

    I have a java package and some code that already works but I need to "Webify" it. I have heard the words Tag Libraries and Beans to use with JSP pages instead of writing out the java code in the page. I have read the tutorial on Tag Libraries and it still makes no sense. I need some kind of beginners guide and instruction. I already have the java in the .jar file and have Tomcat setup. I know I need to make a tag library and stuff, but beyond that I'm a bit lost. I'm just not sure where to put what. Also, I did do a practice JSP page but it won't automatically find the jar file - they are in the WEB-INF/lib directory. I actually have to set the CLASSPATH separately by doing export CLASSPATH=.... which I know can't be right - is there a way to do this in the actual JSP program itself - like set the classpath just for that webpage?

    Here's a good basic tutorial that helped me when I was getting started with tags:
    http://www.theserverside.com/resources/article.jsp?l=JSP-XML3

  • Help! Using "Create" action in insert jsp page vs in submission page.

    This is regarding creating a new record using data TAGS:
    I'm in a dilemma as to whether I should use the data source tag <jbo:Row id="myrow" datasource="iss_vo1" action="Create">
    in my first jsp page ( which accepts input from a user) or in the 2nd jsp page (which does the actual commit).
    If I actually create the view record n the first page itself then I get into all kinds of problems if the user decides against saving the record and backs out.[because there is a null hanging record out there]
    But if I don't use it, then I am unable to use my LOVs in the html form.
    Can anyone help me resolve this issue?
    Currently I have used the data source tag
    <jbo:Row id="myrow" datasource="iss_vo1" action="Create">
    in my first JSP page.
    Below is my complete source code for both the JSP pages:
    Source Code for iss_add.jsp:
    ======================
    Please note that in this JSP , it creates a new record and then the user has to click on the "SAVE" button (which calls another jsp "iss_add_post.jsp") to save the changes. But what if the user does not click on the save BUTTON and instead click on the "back" tab. This is where all the problem occurs. How do I get rid of this problem?
    If I try to just use an HTML form without creating a record in this page then how will I use the LOVs?
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <HTML>
    <base target="contentsframe">
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    </TITLE>
    </HEAD>
    <BODY>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" />
    <jbo:DataSource id="pri_vo" appid="NewBC4J.NewBC4JModule" viewobject="PrioritiesView" />
    <jbo:DataSource id="app_vo" appid="NewBC4J.NewBC4JModule" viewobject="ApplicationsView" />
    <jbo:DataSource id="per_vo" appid="NewBC4J.NewBC4JModule" viewobject="PersonView" >
    <jbo:DataSource id="iss_vo1" appid="NewBC4J.NewBC4JModule" viewobject="IssuesView5" /></jbo:DataSource>
    <jbo:Row id="myrow" datasource="iss_vo1" action="Create">
    </jbo:Row>
    <table width="100%" bgcolor="skyblue" border="0" align="center">
    <tr>
    <td>
    <table width="100%" bgcolor="tan" border="0" align="center" cellpadding="3" cellspacing="0">
    <form NAME="iForm" action="iss_add_post.jsp">
    <tr>
    <th colspan="2">
    "Add New Issues"
    </th>
    </tr>
    <jsp:include page="Message.jsp" flush="true">
    <jsp:param name="colspan" value="2"/>
    </jsp:include>
    <tr>
    <td align="Right"><b><font color="red">Priority:</font></b></td>
    <td> <jbo:InputSelect datasource="iss_vo1" dataitem="PriCd"
    displaydatasource="pri_vo" displaydataitem="Descr" displayvaluedataitem="Cd" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Description:</font></b></td>
    <td> <jbo:InputTextArea datasource="iss_vo1" dataitem="IssDesc" rows="3" cols="50" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Application:</font></b></td>
    <td> <jbo:InputSelect datasource="iss_vo1" dataitem="AppCode"
    displaydatasource="app_vo" displaydataitem="Name" displayvaluedataitem="Code" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Assigned To: </font></b></td>
    <td> <jbo:InputSelect datasource="iss_vo1" dataitem="AssignedToPerId"
    displaydatasource="per_vo" displaydataitem="FirstName" displayvaluedataitem="PerId" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Raised By: </font></b></td>
    <td> <jbo:InputSelect dataso urce="iss_vo1" dataitem="RaisedByPerId"
    displaydatasource="per_vo" displaydataitem="FirstName" displayvaluedataitem="PerId" />
    </td>
    </tr>
    <tr>
    <td align="Right"><b><font color="red"> Resolution: </font></b></td>
    <td> <jbo:InputTextArea datasource="iss_vo1" dataitem="Resolution" cols="50" rows="3" />
    </td>
    </tr>
    </table>
    <!-- Create a table for the save Button -->
    <table width="100%" bgcolor="skyblue" align="center" cellpadding="10" cellspacing="0" >
    <tr>
    <input name="RowKeyValue" type="hidden" value="<jbo:ShowValue datasource="iss_vo1" dataitem="RowKey"/>" />
    <td>
    <input type = "submit" name="submit" value="Save">
    </td>
    </form>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources releasemode="Stateful" />
    Source Code for iss_add_post.jsp:
    ============================
    This is where the actual commit occurs. But user may decide not to come here at all by not clicking the save button. What happens to the record created ? How Can I rollback that information?
    <%@ page language="java" contentType="text/html;charset=WINDOWS-1252" %>
    <html xmlns:jbo="foo">
    <body>
    <center>
    <br>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <br>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" username="issue" password="issue"/>
    <br>
    <jbo:DataSource id="iss_vo1" appid="NewBC4J.NewBC4JModule" viewobject="IssuesView5"/>
    <jbo:Row id="row3" datasource="iss_vo1" action="Current" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <%
    try
    %>
    <jbo:Commit appid="NewBC4J.NewBC4JModule"/>
    <p><font face="Arial, Helvetica, sans-serif"><b><font color="006699">Issue Record Inserted Successfully! Issue# Assigned: <jbo:ShowValue datasource="iss_vo1" dataitem="Id" /></b></font></font> </p>
    <%
    catch(Exception exc)
    out.println("<pre>");
    exc.printStackTrace(new java.io.PrintWriter(out));
    out.println("</pre>");
    %>
    <br>
    <br>
    <form action="iss_ListIssues.jsp" method="post"><input type="submit" value="Click to Continue"></form>
    </center>
    </body>
    <jbo:ReleasePageResources releasemode="Stateful"/>
    </html>
    null

    [email protected]
    I can't actually see any LOV's on your first page so I am not completely sure that I understand your situation. However if you are talking about using the InputSelectLOV datatag, there is no reason why you cannot use that within a html form, without having to create a record in the RowSet.
    The Insert page is by default created without any datasources - just a standard HTML form. The form is submitted and the InsertSubmit page reads the values from the request object, matches the parameter names with your VO attribute names and does your create.
    Your LOV data will be coming from another table so doing a Row tag Create on your Insert page won't make any difference to it. Have I misunderstood something here? I have used LOV's on my Insert pages and I definitely have not created a row in the Rowset anywhere but the Submit pages.
    There is a problem on both Edit and Insert pages whereby if there are no rows in the table for which you have a datasource defined you can get problems, but it doesn't sound as though that is your problem. Maybe I need some more information from you?
    Simon

  • Writing XML file from a jsp page

    how can i write a xml file from my jsp and store the values and after sometime, for example when the user clicks on the submit button, i check the values from xml file and compare those values from the data base.
    it means both writing and reading xml file from a jsp page...
    urgent help needed......thanks

    You need some API like XSL or JDOM to read data from/to XML file
    you can get a best tutorial from
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html
    and
    http://www.javaworld.com/javaworld/jw-07-2000/jw-0728-jdom2.html
    after reading both articals you will be able to do both the tasks

  • How to use messagebar tag in jsp page

    i am working with "messagebar" control presents in the htmlb controls.
    my aim is to display the message after pressing some button. how to give link for that.
    if anybody have smple code for it please send me with component,jsp page and bean(if used)......
    ragards,
    ajoy

    Hi,
    If I understood you right, then you want to update the message shown in your messgebar, when user clicks on button.
    To achieve this, have a MessageBar with no message text. And when ever a button is clicked in the event handling method of your button set message text to your messagebar.
    public void showMessage(String message, MessageType type) {
            messageBar.setMessage(type, message);
    public void onClick(Event event) throws PageException {
          showMessage("Clicked Button", MessageType.INFO);
    Greetings,
    Praveen Gudapati
    [Points are always welcome for helpful answers]

  • Help!!! Display "null" in JSP page

    Hi,
    I use the code like <%=adress%> in jsp.
    When the adress is null, the jsp page in S1AS will show a string "null". But the same code is OK in weblogic ,the jsp will show empty for this part of code
    What is difference between them ?If I do not want to change the code (many places) ,is there any way to confirgue sun one or easy ways to solve this problem?
    Could evry expert to help me to firgure out how to solve this problem?
    Thanks in advance,
    FS

    You also might want to check JDK versions and J2EE versions being used. These might yield different results.

  • Help needed to create a master-detail JSP page using OAF.

    I like to create a master-detail JSP page using OAF. If any help or guide will be appreciate.
    - Kausik

    A Master Detail Page is a basically a game between two VOs(Master and Detail mostly connected through a View Link). You can also have a look at the View Link section in the Dev guide. Page Layouts is one thing which you can take a call yourself.
    Regards
    Sumit

  • Need help in countdowntimer in java bean for jsp page

    hi..im student..i need help with countdowntimer in jsp page..with java bean component..im use XHTML MP for my jsp page so i can use it in cellular phone with WAP 1..can anybody help me with this problem..thx

    hi..im student..i need help with countdowntimer in jsp page..with java bean component..im use XHTML MP for my jsp page so i can use it in cellular phone with WAP 1..can anybody help me with this problem..thx

  • Help in writing logic to abaper for printing contact details from partnr fn

    Hi friends,
    I have to give the logic to the abaper to print the contact details of one partner which is manually entered in the quotation at header level.
    i have a partner z1 with partner type PE which is manually entered in the partner fn field at the header level.  this z1 partner fn is an employee.  The name and contact details of this employee needs to be printed in the header of the output.
    What is the logic i need to give to abaper for this.
    Regards,
    Anand

    Hi Anand,
    In case you do not find an ADRNR for the respective partner funtion in VBPA table, then, it means that the employee number derived from customer master is correct. Then, I think you can take KUNNR number for the employee partner function thro' VBPA and put the same in KNA1 table to get the right ADRNR. (As explained by me in the first post).
    My question now is, are you maintaining the employee in XD01 (customer) or in VPE1 (Sales Rep)?
    You can try with tables PA0002 Personal Data and PA0006 Addresses only if you maintain employees thro' VPE1 Tcode.  PA0006 has PERNR field. But, what you have to make sure is that the table is getting updated. Else, you may not find the data here as well.
    Hope this helps...
    Thanks
    Mukund S

  • Pls. help me out..Accessing ejb through jsp

    hi all,
    I am running my ejb on the j2sdkee.1.2.1 and jdk1.3 on Windows 2000. I am facing a problem while accessing the ejb from the jsp page. Its running fine when accessing through a client application. The following is the error when I try to access it using:
    http://localhost:8000/first/FirstEJB.jsp
    Error: 500
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
         at org.apache.jasper.runtime.JspLoader.loadJSP(JspLoader.java:287)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:137)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:148)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:247)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:352)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
         at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:534)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
         at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
         at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
         at java.lang.Thread.run(Thread.java:484)
    Root cause:
    java.lang.NullPointerException
         at java.io.File.(File.java:181)
         at org.apache.jasper.compiler.JspCompiler.computeClassFileData(JspCompiler.java:285)
         at org.apache.jasper.compiler.JspCompiler.getClassName(JspCompiler.java:103)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:105)
         at org.apache.jasper.runtime.JspLoader$2.run(JspLoader.java:273)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.jasper.runtime.JspLoader.loadJSP(JspLoader.java:270)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:137)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:148)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:247)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:352)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
         at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:534)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
         at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
         at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:310)
         at java.lang.Thread.run(Thread.java:484)
    The name of the jsp file is FirstEJB.jsp
    The name of the ear file is FirstEJB - Stateless Session Bean
    The name of the WAR File is FirstWAR
    I have created a Web Component named first
    Can anyone tell me how to access the ejb using jsp?
    Thanks,
    ajit

    Hello all,
    Sorry for the trouble. I got the mistake..I had not given the context in the deploytool..
    Thanks,
    ajit

Maybe you are looking for

  • Profit center change in FB01

    Hi, when i do posting in FB01: For first line item for GL a/c - 'GX' profit centre 'PC1' and for second line item GL a/c - 'GY' profit center 'PC2'. After posting for GL account GY profit center automatically changing to 'PC1' of first line item. thi

  • Heartbeat failure monitor - how to adjust for specific agent

    hi guys, in our environment we put the default heartbeat settings to 10 samples and 60 seconds intervals.  i have a customer asking for different values on a specific machine hs is the owner of. i looked around and found this: http://technet.microsof

  • 5.0 GHz band on Q5?

    Hi, Does the BlackBerry Q5 can use the 5 GHz band of a Wi-Fi network? I found this page where it says "[...] your device tries to connect in the 5.0 GHz band unless the signal strength at the 2.4 GHz [...]" but I found multiple threads where people s

  • Is it possible to change the background color when publishing as EXE Full Screen?

    I often publish Captivate projects as EXE - FullScreen. I would l like to set the background color outside of the EXE frame. Is that possible. When running my Captivate published .EXEs at full screen at a resolution greater than the project, a tan co

  • How do I get (in c) a method return value from the java side?

    I have a class in the Java side, that I pass as object to the c side. in the Java class I have the following method: public String getPgmId() return pgmId; where pgmId is a private string. I nees to get the value of pgmId, hopefully by using the getP