Displaying a set of records using jstl

hi i am new to jstl.my requirement is i want to display a set of records from my database using jstl.for eg i want to display 50 records per page and i want to navigate to other records using next and prevoius buttons and i need to put view and edit buttons in that page.can anybody give me a solution for this.urgent

You may try the paging taglib ...
http://www.servletsuite.com/servlets/pagertag.htm

Similar Messages

  • Filtering a set of collections using JSTL

    Hi, i am currently facing a problem where i tried to query a set of collections in JSTL. My 1st query is using date for example,
    <sql:setDataSource var="ds" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://192.168.250.86:1223;DatabaseName=eleavedb;SelectMethod=cursor" user="sa" password="sapassword"/>
    <sql:query var="countLeave" dataSource="${ds}">
    SELECT * FROM VCST_EMPLOYEE_LEAVE WHERE leave_from LIKE 'May 31 2006%'
         <sql:param value="${dates}%" />
    </sql:query>
    After querying through date, i need to query these collection of data based on its type. But, my problem is....how to do it? This is because it's type is not unique.

    You may try the paging taglib ...
    http://www.servletsuite.com/servlets/pagertag.htm

  • Can you set pager attribute using jstl c:out tag?

    I am trying to use the pager tag library from jsptags.com. The pager tag has a maxPageItems attribute. I want maxPageItems to be variable. I also want to use the jstl instead of scriptlets and expressions. Instead of writing
    <pg:pager
        maxPageItems="<%= myPageItems %>" >I want to write
    <pg:pager
        maxPageItems="<c:out value='myPageItems'/>">When I do this I get a java.lang.NumberFormatException: for input string: ""
    I think this issue is documented on the jsptags website. So maybe I have no choice but to use the expression format. I guess I should also mention that I am using jstl 1.1 and jsp 1.2 (implemented in tomcat 4.1.27)
    Has anyone tried this and had success?
    Did I provide enough information?

    Sorry, but you can't use tags as attributes to other tags (where would it end?)
    You're stuck with using <%= %> syntax.

  • I am trying to display a set of records and each record contains 2-3 fields

    anyone pls help me

    for (int i = 0; i < records.size; i++) {
        out.println(records[ i ].getField(1), records[ i ].getField(2),records[ i ].getField(3));
    }

  • How to retain current set of records in advanced table in OAF

    I have an advanced table in a OAF page. Number of records displayed is set to 5. Now, when I have more than 5 records, we can view the next set of records using navigation buttons of the advanced table. One of its column is an image which has "Action Type" as "fireAction" and "Submit" set to "True", which when clicked displays further details about the selected record in a separate region. However, in this process the page is getting refreshed and the table is again displaying the first set of 5 records even if i chose to display details about record in the next set of 5 (i.e after navigating using "Next 5" button of the table).
    Is there any way to retain the current set of records displayed in the advanced table across the page refresh.?
    Thanks
    Nagamanoj

    Solved.
    Somewhere in our code, while populating one of the columns of the table, we were resetting the VO which was causing the issue. Modified that method call to add a parameter to mention from which row should the table be populated.
    Thanks
    Nagamanoj

  • HT204291 Using Azul media player app on my ipad  Apple tv will only display sound but not video from movies.  Any ideas on a fix.  I set mirroring to on but it still does not display video.  It will display photos and video recorded from my iphone.

    Using Azul media player app on my ipad  Apple tv will only display sound but not video from movies.  Any ideas on a fix.  I set mirroring to on but it still does not display video.  It will display photos and video recorded from my iphone.

    Here are the steps for AirPlay:
    Before starting Azul from your (running iOS 5.x/6.x) home screen where have have all your apps we need to turn on mirroring
    On your iPhone 4S/5 or iPad 2 or 3, double-click the Home  Button to view your recently-used apps.
    Swipe all the way to the right to until you see the  icon.
    Note: If the icon does not appear, go to the "If AirPlay Mirroring is not visible or available on your mobile iOS device" section.
    Tap the  icon to see the list of available AirPlay devices.
    Enable AirPlay Mirroring in this menu by tapping on an available Apple TV, then sliding the Mirroring slider to ON.
    Now you should be seeing your iPad/iPhone on your TV.
    Start up Azul now and using the settings icon on the top right corner go to the option that say "TV out" ON.
    When you do that you will see an Orange screen
    Now click "Done" and play the video you want to watch and it will AirPlay

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

  • How to send object arraylist from servlet to jsp and display using jstl

    Hi All....
    I have a simple application and problem with it.
    Once user logged in to system the user will redirect to LoginServlet.java controller.
    Then in LoginServlet I want to redirect user to another page called book_details.jsp.
    this is my login servlet.
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
              PrintWriter out = response.getWriter();
              ArrayList<BankAccountDTO> account_list = new ArrayList();
              ResultSet resultSet = null;
              LowFairAirDB airDB = null;
              try{
                   airDB = new LowFairAirDB();
                   String query = "SELECT account_id, type, description, balance, credit_line, begin_balance, begin_balance_time_stamp FROM bank_account";
                   airDB.sqlSelect(query);
                   resultSet = airDB.getResultSet();
                   while(resultSet.next()){
                        account_list.add(new BankAccountDTO(resultSet.getInt(1),
                                                                     resultSet.getInt(4),
                                                                     resultSet.getInt(5),
                                                                     resultSet.getInt(6),
                                                                     resultSet.getString(2),
                                                                     resultSet.getString(3),
                                                                     resultSet.getString(7)));
              }catch(Exception ex){
              }finally{
                   try{resultSet.close();}catch(Exception ex){}
                   airDB.sqlClose();
         }I set bank account values to BankAccountDTO.java objects and add them to the arrayList.
    Next I want to send this objects arrayList to books_details.jsp and wanna display each objects values using JSTL.
    I still finding a way to go through this.
    1. Can anyone say how can I do it?
    2. Is there any other method to do the same thing without using JSTL?
    thanks in advance,
    Dil.

    Naishe wrote:
    In your servlet,
    request.setAttribute("account_list", account_list);
    requestDispatcher.findForward("/your/display/jsp");
    Good. I would only follow the Java naming conventions. E.g. accountList or accounts instead of the ugly PHP/C conventions.
    In the JSP,
    lst = (List< BankAccountDTO >)request.setAttribute("account_list");
    for(BankAccountDTO b: lst){
    populate your HTML tags or whatever
    Wrong. 1) You need getAttribute() and 2) you should not use scriptlets. Use JSTL c:forEach, e.g.<table>
        <c:forEach items="${accounts}" var="account">
            <tr>
                <td>${account.id}</td>
                <td>${account.type}</td>
                <td>${account.description}</td>
            </tr>
        </c:forEach>
    </table>To the topicstarter: for future JSP/JSTL related questions please use JSP/JSTL forum.
    Here it is: [http://forums.sun.com/forum.jspa?forumID=45].

  • Displaying the selected multiple records from node using onleadselect event

    Hi all,
    How to display the selected multiple records from node to node using onleadselect event.
    i came to know tht to fulfill this requirement i need to use the method get_selected_elements,
    how to use this method in my event??
    sree

    Hi Sree,
    Try below code..
    DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,             // This is first node
                 lo_el_it_lips TYPE REF TO if_wd_context_element,
                 ls_it_lips TYPE wd_this->Element_it_lips,
                 lt_it_lips TYPE wd_this->Elements_it_lips.
               DATA: wa_temp TYPE REF TO if_wd_context_element,
                lt_temp TYPE wdr_context_element_set.
    * navigate from <CONTEXT> to <IT_LIPS> via lead selection
          lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).
          CALL METHOD lo_nd_it_lips->get_selected_elements
            EXPORTING
                INCLUDING_LEAD_SELECTION = ABAP_true
            RECEIVING
              set = lt_temp.
          DATA lo_nd_pack_mat TYPE REF TO if_wd_context_node.          //Second Node
          DATA lo_el_pack_mat TYPE REF TO if_wd_context_element.
          DATA ls_pack_mat TYPE wd_this->Element_pack_mat.
          DATA lt_pack_mat TYPE wd_this->Elements_pack_mat.
    * navigate from <CONTEXT> to <PACK_MAT> via lead selection
          lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
          lo_nd_pack_mat->get_static_attributes_table( importing table = lt_pack_mat ).
          LOOP AT lt_temp INTO wa_temp.
            CALL METHOD wa_temp->get_static_attributes
              IMPORTING
                static_attributes = ls_it_lips.
                  ls_pack_mat-vbeln = ls_it_lips-vbeln.
                  ls_pack_mat-material = ls_it_lips-matnr.
                  ls_pack_mat-vgbel = ls_it_lips-vgbel.
                    append ls_it_lips to lt_unpack.
                  CLEAR ls_pack_mat.
           ENDLOOP.
    Cheers,
    Kris.

  • Using JSTL to display space conditionally

    Hi,
    I need to use JSTL to insert a space when the value of a particular variable is null.
    The obvious approach would be to use the following code:
    <c:choose>
    <c:when test="${var} != null">${var}</c:when>
    <c:otherwise> </c:otherwise>
    </c:choose>
    OR
    ${var} <c:if test="$var== null}">  </c:if>
    However, i need to do this in a lot of places ( a number of table cells to be precise) and the above code looks bulky to be inserted everywhere.
    I read the JSTL documentation and found that the following code can also be used:
    <c:out value='${var}' default=" " />
    As per JSTL documetation, the default will be used if the variable has a null value and hence the above code should work theoretically.
    My problem is that whenever the value of the variable is null, the output is   and not a space. i.e. actually the text   is displayed. Is there some way of getting the space to display?
    Or is there any other alternative to condinally insert a space without having to write the bulky <c:choose> OR <c:if> code?
    Thanks in advance.

    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <c:set var="myDb"  value="${sessionScope.testDataBean}" />
    <html>
    <head></head>
    <body>
          <c:choose>
           <c:when test="${myDb != null}" >
              <c:forEach var="hashMapAsRow" items="${myDb}" varStatus="lineInfo">
               <tr>
                   <td><c:out value="${hashMapAsRow['column1']}" /></td>
                 <td><c:out value="${hashMapAsRow['column2']}" /></td>
                </tr>
         </c:forEach>
          </c:when>
          <c:otherwise>
         <tr><td colspan="100%">No Data Exists</td></tr>
          </c:otherwise>
        </c:choose>
    </body>
    </html> or the one below
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head></head>
    <body>
          <c:choose>
           <c:when test="${sessionScope.testDataBean != null}" >
              <c:forEach var="hashMapAsRow" items="${sessionScope.testDataBean}" varStatus="lineInfo">
               <tr>
                   <td><c:out value="${hashMapAsRow['column1']}" /></td>
                 <td><c:out value="${hashMapAsRow['column2']}" /></td>
                </tr>
         </c:forEach>
          </c:when>
          <c:otherwise>
         <tr><td colspan="100%">No Data Exists</td></tr>
          </c:otherwise>
        </c:choose>
    </body>
    </html> is this the one which you are looking for ??
    REGARDS,
    RaHuL

  • HT204291 My iPad 4 does not show up on my TV screen when in AirPlay mirroring mode using WiFi.  The iPad displays AirPlay set to TV with the Mirroring On (green).  My iPad IOS software is 8.2 and my Apple TV software is at 7.1.  The TV displays the Apple

    My iPad 4 does not show up on my TV screen when in AirPlay mirroring mode using WiFi.  The iPad displays AirPlay set to TV with the Mirroring On (green).
    My iPad IOS software is 8.2 and my Apple TV software is at 7.1.  The TV displays the Apple Menu.  The “Settings” does however displays the General menu allowing me to see:
    Apple software:          7.1 (7003)
    Apple TV:                   Model No. A1464, Part No. MD199B/A
    Signal Strength shows 5 circles.
    It does not display the iPad screen but when I use the BT Sport App I can hear the sound but there is no video.  I have searched the internet for a solution to no avail. The problem first arose when the IOS was at 8.1+ but it worked correctly briefly when I updated to IOS 8.2.  Can you help please?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router. (Also try removing it’s power cord for at least 30 seconds)
    Restart your mobile device.
    If you are still having problems, the following article(s) may help you.
    Troubleshooting AirPlay
    Troubleshooting Wi-Fi networks and connections
    Recommended Wi-Fi settings
    Wifi Diagnostic Software (for Mac users)
    You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.
    When making adjustments to your network for better optimisation, you may find some of the points mentioned on this page helpful.

  • How can i display the values in the vector in a jsp using jstl

    in a task i am recieving a vector in a jsp... how can i display those vector values in the jsp using jstl.... plz help me
    thanks in advance

    <%
    here you got vector say; v
    pagecontext.setAttribute("varname",v);
    %>
    <c:forEach var="i" items="${varname}">
    <c:out value="${i}">
    </c:forEach>

  • Set Property to javaBean using JSTL

    Hi all,
    I have a custom object variable that I read from the session using JSTL.
    <c:set var="someObj" value="${sessionScope.myObj}" scope="page"/>
    Now i wan to set the obj into my JavaBean.
    <jsp:useBean id="myBean" scope="request" class"ObjectA">
         <jsp:setProperty name="myBean" property="objA" value='????' />     
    </jsp:useBean>
    How may I achieve this?
    I've tried the following ways:
    value = ${someObj}
    value = '<c:out value=$"someObj">'
    value = 'someObj'
    But none of them works. Any suggestion? I do not wish to have any scriplets.
    Thank you.

    Here is an example of how to do it:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
    First Bean :
        <!-- create the first bean in the request scope-->
         <jsp:useBean id="firstBean" scope="request" class="com.test.testBean"/>
         <!-- output the default name -->
        <c:out value="${firstBean.name}" />
        <!-- set the name to a new value an output the new value -->
        <c:set   value="newName" target="${firstBean}" property="name" />
        <BR><c:out value="${firstBean.name}" />
        <P>
    Second bean : 
        <!-- create the first bean in the request scope-->
        <jsp:useBean id="secondBean" scope="request" class="com.test.testBean"/>
         <!-- output the default name -->
        <c:out value="${secondBean.name}" />
         <!-- set the name to a new value an output the new value -->
        <c:set   value="secondbeanName" target="${secondBean}" property="name" />
        <BR><c:out value="${secondBean.name}" />
    <P>
    Bean reference:
        <!-- set the first bean beanRef to the second bean --> 
        <c:set   value="${secondBean}" target="${firstBean}" property="beanRef" />
         <!-- output the name property of the first bean bean ref -->
            <c:out value="${firstBean.beanRef.name}" />     
            <!-- change the name property of the second bean and the output the name property of the first bean bean ref -->
            <c:set   value="A completely new name" target="${secondBean}" property="name" />
         <br><c:out value="${firstBean.beanRef.name}" />     
        </body>
    </html>where com.test.testBean is:
    package com.test;
    public class testBean {
         private String name = "My Name";
         private int value = 11;
         private boolean exists = true;
         private testBean beanRef;
         public boolean isExists() {
              return exists;
         public void setExists(boolean exists) {
              this.exists = exists;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public int getValue() {
              return value;
         public void setValue(int value) {
              this.value = value;
         public testBean getBeanRef() {
              return beanRef;
         public void setBeanRef(testBean beanRef) {
              this.beanRef = beanRef;
    }

  • How to to display entire records using PL/SQL(anoyomous block)

    Hi All,
    I have created a region of type PL/SQL by using rownum, and it wil display few records due to rownum.
    But the end user is asking to display the rest of records also using some pagination concept or any other way.
    How can we achieve this?
    In mean time i have tried to execute the by removing the rownum, then it is throwing the below Query
    Error- ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
    Thanks,
    Ano.
    Edited by: Anoo on Mar 19, 2012 12:18 AM

    Hi,
    Here is the query we are using to dsipaly the records, but the limit we are dsiplaying is only 300.
    So the concern is how we can display all records.
    DECLARE
    list_arr2 htmldb_application_global.vc_arr2;
    p VARCHAR2(4000);
    v_default_start_date DATE;
    j NUMBER :=0;
    occurrencies NUMBER(10);
    CODESELECT VARCHAR2(7);
    BEGIN
    IF :P2_SYMBOL_CODE_HIDDEN IS NOT NULL THEN
    CODESELECT:=:P2_SYMBOL_CODE_HIDDEN;
    ELSE
    CODESELECT:='';
    END IF;
    Select TO_char(SYSDATE-1,'MM/DD/YYYY') into v_default_start_date from Dual;
    :P2_START_DATE := v_default_start_date; */
    list_arr2 := htmldb_util.string_to_table (:P2_SYMBOL_NAME, ',');
    p := 'SELECT SYMB_SARUS_DESCRIPTION,SYMB_CODE FROM ( '
    || 'SELECT '''' SYMB_SARUS_DESCRIPTION,''NA'' SYMB_CODE FROM DUAL ';
    p := p
    || ' UNION all SELECT sym.SYMB_SARUS_DESCRIPTION || ''- '' '
    || ' || sym.SYMB_CODE SYMB_SARUS_DESCRIPTION , sym.SYMB_CODE '
    || ' from T_SYM sym ';
    IF :P2_ACTIVESYMBOL='ACTIVE ONLY' THEN
    p := p || ', ( SELECT distinct DSPS_SYMB_CODE FROM t_dispatch_symbol ' ||
    ' WHERE dsps_dsp_code IN ( SELECT adsp_dsp_code ' ||
    ' FROM t_aut ' ||
    ' WHERE adsp_vend_code=''FTP'' ' ||
    ')) act_symb ' ||
    ' WHERE sym.SYMB_CODE=act_symb.DSPS_SYMB_CODE AND ';
    ELSIF :P2_ACTIVESYMBOL='INACTIVE' THEN
    p := p || ', ( SELECT distinct DSPS_SYMB_CODE FROM t_dis ' ||
    ' WHERE dsps_dsp_code NOT IN ( SELECT adsp_dsp_code ' ||
    ' FROM t_aut ' ||
    ' WHERE adsp_vend_code=''FTP'' ' ||
    ')) act_symb ' ||
    ' WHERE sym.SYMB_CODE=act_symb.DSPS_SYMB_CODE AND ';
    ELSE
    p := p || ' WHERE ';
    END IF;
    p := p || 'UPPER(sym.SYMB_SARUS_DESCRIPTION) LIKE ';
    FOR i IN 1 .. list_arr2.COUNT
    LOOP
    IF i = 1
    THEN
    p := p || ' UPPER(''%' || TRIM(list_arr2 (i)) || '%'') ';
    ELSE
    p :=
    p
    || ' AND UPPER(SYMB_SARUS_DESCRIPTION) LIKE '
    || ' UPPER(''%'
    || TRIM(list_arr2 (i))
    || '%'') ';
    END IF;
    END LOOP;
    p := p || ' order by 1 ) where rownum < 310 ';
    p := REPLACE(p, '''||''', '||');
    IF LENGTH(:P2_SYMBOL_NAME) > 2 AND :P2_HIDD = 'cdf' THEN
    htp.p('<table>');
    htp.p('<tr bgcolor=white><td width=20% align="left">');
    htp.p('<font color="#094991" size="1">     Search By Name</font>');
    htp.p('</td>');
    htp.p('<td align="left">');
    htp.p(APEX_ITEM.SELECT_LIST_FROM_QUERY(3,CODESELECT,p,'onChange="setSymbolCode(this.value);" size=10','NO','','','P2_SEARCHNAME','','Select'));
    htp.p('</td>');
    htp.p('</tr>');
    htp.p('</table>');
    END IF;
    IF LENGTH(p)<=0 THEN
    :P2_SYMBOL_CODE_HIDDEN:='';
    END IF;
    END;
    Thanks,
    Anoo.
    Edited by: Anoo on Mar 19, 2012 1:10 AM

  • How to devide the set of records into groups in SQL itself.

    Hi , i am using 10.2.4.0 of oracle.
    I am having one requirement, in which i have to devide the set of records into certain groups , so that they can be executed partly but not in one run.
    So in the 'SELECT' clause itself i want to asssign particular value (may be 1 )to first 50000 records then another value(may be 2) to next 10000, like wise. And again the total count of records will also varry time to time , if the total count of record set is less than 10000 , then it should only assign '1' to all the records. i will set the group values (1,2,3...) as another column itself.
    Can you please let me know if this can be done in SQL without going for PLSQL?

    Hi,
    That's called a Pagination Query , and here's one way to do it:
    WITH     got_grp          AS
         SELECT     x.*
         ,     CEIL ( ROW_NUMBER () OVER (ORDER BY  x_id) 
                   / 50000
                   )          AS grp
         FROM     table_x  x
    --     WHERE     ...          -- If you need any filtering, put it here
    SELECT     *               -- Or list the columns you want
    FROM     got_grp
    WHERE     grp     = 1
    ;ROW_NUMBER () OVER (ORDER BY x_id)     assigns unique integers 1, 2, 3, ... to all all rows, in the same order as x_id (even if x_id is not unique).
    CEIL (ROW_NUMBER () OVER (ORDER BY x_id) / 50000)     maps the 1st 50,000 of those numbers to 1, the 2nd 50,000 to 2, and so on.
    Analytic functions (like ROW_NUMBER) as computed after the WHERE clause is applied, so, to use the results in a WHERE clause, then you need to compute them in a sub-query. If you just want to display the number, and not use it in a WHERE clause, then you don't need a sub-query.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

Maybe you are looking for