Help !!!! Jms in Jsp

jsp code
<%@ page import="javax.naming.*" %>
<%@ page import="javax.jms.*" %>
<%
          String queueName = null;
Context jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
Queue queue = null;
QueueSender queueSender = null;
TextMessage message = null;
jndiContext = new InitialContext();
queueConnectionFactory =(QueueConnectionFactory)jndiContext.lookup("jms/QueueCon");
queue = (Queue) jndiContext.lookup("jms/Queue");
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue);
message = queueSession.createTextMessage();
message.setText("This is message ");
               queueSender.send(message);
               out.println("this is a test!");
%>
but
Warning : Illegal connection factory access to jms/QueueCon. J2EE Components sho
uld access JMS Connection Factories through a resource-ref in java:comp/env
Why??help

it may be you jsp are not in a web application.
you can modify the "jms/... " to "java:comp/env/jms ...";

Similar Messages

  • Help whit dinamyc jsp events ^^

    Hello:
    hummmm! need help in create jsp (xml, xsl, xslt or whatever) whit dinamic html components events like checkbox, i.e:
    When i click in a checkbox or radio button, the action (event) must make me generate dinamyc html code like show fields or forms (not hide forms or tables, just generate tables or forms whit the checkbox or radio button actions). But i wan�t use javascript just JSP, XML, XSL or whatever.
    Please give me help =P plz

    You can use AJAX for doing this. Or you can submit the page onchange event of the combo and get the required values from the DB and set the values in the text field.
    Please check the onchange attribute of the select tag.

  • JMS in JSP!!help!!

    jsp code
    <%@ page import="javax.naming.*" %>
    <%@ page import="javax.jms.*" %>
    <%
    String queueName = null;
    Context jndiContext = null;
    QueueConnectionFactory queueConnectionFactory = null;
    QueueConnection queueConnection = null;
    QueueSession queueSession = null;
    Queue queue = null;
    QueueSender queueSender = null;
    TextMessage message = null;
    jndiContext = new InitialContext();
    queueConnectionFactory =(QueueConnectionFactory)jndiContext.lookup("jms/QueueCon");
    queue = (Queue) jndiContext.lookup("jms/Queue");
    queueConnection = queueConnectionFactory.createQueueConnection();
    queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    queueSender = queueSession.createSender(queue);
    message = queueSession.createTextMessage();
    message.setText("This is message ");
    queueSender.send(message);
    out.println("this is a test!");
    %>
    but
    Warning : Illegal connection factory access to jms/QueueCon. J2EE Components sho
    uld access JMS Connection Factories through a resource-ref in java:comp/env
    Why??help

    It's in the specification.
    _sjz.                                                                                                                                                                                                                               

  • Need help on Modifying Jsp Code to establish relationships in iStore.

    I am currently working on iStore an internet enabled product
    from Oracle.
    In iStore one can establish relationships between products like
    cross sell , complimentary, substitute, conflict etc. However at
    the moment only one relationship works i.e: Related. This is
    because this is a bug in iStore. Only the relationship Related
    is defined in the jsp. We have been asked to modify the jsp
    ibeCCtdItemDetail.jsp
    Please find pasted below the jsp which only had the arrays for
    related i.e: relitems and service i.e service have added the
    array complimentary to establish such a relationship and pasted
    the relitems code once again and changed relitems to
    complimentary. I am stuck up on this since the past 2 weeks i
    would appreciate if anybody could help.
    <%@include file="jtfincl.jsp" %>
    <!-- $Header: ibeCCtdItemDetail.jsp 115.24 2001/06/16 15:21:05
    pkm ship $ -->
    <%--
    =================================================================
    ========
    | Copyright (c)2000 Oracle Corporation, Redwood Shores, CA
    | All rights reserved.
    +================================================================
    ===========
    |
    | FILE
    | ibeCCtdItemDetail.jsp - Item Detail display
    |
    | DESCRIPTION
    | Displays Item Detail page. Item's description, long
    description, large
    | image, flexfields, available services, and related items
    are displayed.
    | The list price and best price (selling price) for each of
    the Item's
    | available units of measure is displayed. Displays Add to
    Cart,
    | Express Checkout, Configure buttons (if appropriate).
    |
    | PARAMETERS (SOURCE)
    | party Id IN (RequestCtx) - user's party
    id
    | account Id IN (RequestCtx) - user's
    account id
    | currency code IN (RequestCtx) - currency code
    | item IN (URL) - Item ID
    | section IN (URL) - section ID of
    section we are
    | coming from
    (optional)
    | item IN (pageContext) - Item ID
    | section IN (pageContext) - Section ID
    | qty IN (pageContext) - Quantity
    entered by user
    | uom IN (pageContext) - UOM selected
    by user
    | errorMsg IN (pageContext) - error message
    from buy
    | routing page
    | * pageContext attributes for "item" and "section" are used
    when the URL
    | does not contain valid values for "item" and "section"
    (such as when an
    | error occurred in the buy routing page and the request is
    forwarded
    | back to this page)
    |
    | oneclick_obj OUT (pageContext) - OneClick
    object containing
    | user's
    Express Checkout
    | preferences
    | postingID OUT (pageContext) - Integer
    posting Id, for
    | iMarketing
    integration
    | itemIDs OUT (pageContext) - int[] itemIDs
    on the page
    | (for use by
    postings)
    | numRequested OUT (pageContext) - Integer
    number of postings,
    | for
    iMarketing integration
    | random OUT (pageContext) - Boolean
    whether to randomize
    | posting
    retrieved, for
    | iMarketing
    integration
    | type OUT (HTML form) - "single" (1
    item)
    | item OUT (HTML form) - Item ID
    | refpage OUT (HTML form) -
    "ibeCCtdItemDetail.jsp" plus any
    | parameters
    needed to return
    | to this page
    in case of error.
    | uom OUT (HTML form) - UOM code
    selected by user
    | qty OUT (HTML form) - quantity
    entered by user
    | Add to Cart.x OUT (HTML form) - user clicks
    Add to Cart
    | 1-Click.x OUT (HTML form) - user clicks
    Express Checkout
    | Configure.x OUT (HTML form) - user clicks
    Configure
    |
    | OBJECTS REFERENCED
    | oracle.apps.ibe.catalog.Item
    | oracle.apps.ibe.order.OneClick
    |
    | APIs REFERENCED
    | Item.getItemID() - get Item ID
    | Item.getDescription() - get item description
    | Item.getLongDescription() - get item long description
    | Item.isConfigurable() - whether item has
    configuration UI set up
    | Item.getFlexfields() - get Item flexfield
    prompts and values
    | Item.getRelatedItems() - get related items and
    service items
    | Item.getMediaFileName() - get media based on
    display context
    | OneClick.loadSettingFrDB() - load Express Checkout
    settings for
    | current user
    |
    | JSPs REFERENCED
    | ibeCCtpPostingI.jsp - set iMarketing
    parameters (include)
    | ibeCCtpSetItem.jsp - retreive and set item
    information (include)
    | ibeCCtpItmDspRte.jsp - Item display routing
    page (link)
    | ibeCCtpBuyRoute.jsp - Buy routing
    page (form POST)
    | ibeCCtdSctPath.jsp - Path Traversed
    Display (include)
    | ibeCXpdShowTag.jsp - Express Checkout Tag
    Area (include)
    | ibapstng.jsp - iMarketing integration
    page (include)
    |
    | ADDITIONAL NOTES
    | iMarketing posting ID can be changed by editing file
    ibeCCtpPostingI.jsp
    |
    | HISTORY
    | 08/01/2000 auyu Created.
    | 04/09/2001 auyu Added compile-time include for retrieving
    item
    | information
    |
    +================================================================
    =======--%>
    <%@page import="oracle.apps.ibe.order.*" %>
    <%@page import="oracle.apps.ibe.catalog.*" %>
    <%@page import="oracle.apps.ibe.store.*" %>
    <%@page import="oracle.apps.jtf.displaymanager.*" %>
    <%@page import="oracle.apps.jtf.base.Logger" %>
    <%@page import="oracle.apps.jtf.minisites.*" %>
    <%@include file="ibeCZzpHeader.jsp" %>
    <%@page import="oracle.jdbc.driver.*" %>
    <%@page import="java.sql.*" %>
    <%-- declaration --%>
    <%!
    /* Retrieve parent section ids for a given item.
    * int itemId - Item whose parent section ids will be retrieved
    int getParentSectionId(int itemId)
    int parentSectionId = -1;
    Connection conn = null;
    OraclePreparedStatement stmt = null;
    ResultSet rs = null;
    try {
    BigDecimal minisiteId = RequestCtx.getMinisiteId();
    conn = TransactionScope.getConnection();
    StringBuffer sql = new StringBuffer(400);
    sql.append("select jdsi.section_id ");
    sql.append("from jtf_dsp_section_items jdsi, ");
    sql.append("jtf_dsp_msite_sct_items jdmsi ");
    sql.append("where jdsi.inventory_item_id = ? ");
    sql.append("and jdsi.section_item_id =
    jdmsi.section_item_id ");
    sql.append("and jdmsi.mini_site_id = ? ");
    sql.append("and nvl(jdsi.start_date_active, sysdate) <=
    sysdate ");
    sql.append("and nvl(jdsi.end_date_active, sysdate) >=
    sysdate ");
    sql.append("and nvl(jdmsi.start_date_active, sysdate) <=
    sysdate ");
    sql.append("and nvl(jdmsi.end_date_active, sysdate) >=
    sysdate");
    stmt = (OraclePreparedStatement)conn.prepareStatement
    (sql.toString());
    stmt.setInt(1, itemId);
    stmt.setInt(2, minisiteId.intValue());
    stmt.defineColumnType(1, Types.INTEGER);
    rs = stmt.executeQuery();
    if (rs.next())
    parentSectionId = rs.getInt(1);
    } catch (Exception e1) {
    parentSectionId = -1;
    IBEUtil.log("ibeCCtdItemDetail.jsp",
    "Caught exception while retrieving parent
    section id");
    IBEUtil.log("ibeCCtdItemDetail.jsp", e1.getMessage());
    } finally
    try { if (rs != null) rs.close(); } catch (Exception e2) {}
    try { if (stmt != null) stmt.close(); } catch (Exception
    e2) {}
    try {
    if (conn != null) TransactionScope.releaseConnection
    (conn);
    } catch (Exception e2) {}
    return parentSectionId;
    %>
    <%-- end declaration --%>
    <%@include file="ibeCCtpSetItem.jsp"%>
    <%
    The compile-time inclusion of ibeCCtpSetItem.jsp will declare
    and set
    the following variables:
    boolean bItemLoaded - whether section was
    loaded
    Item lItem - Item
    boolean bItemCanBeOrdered - whether item can be
    ordered
    String[] uomCodes - Item's UOM Codes
    Vector itemSellPriceDisplayVec - vector containing
    item's selling
    prices in formatted
    strings
    Vector itemListPriceDisplayVec - vector containing
    item's list
    prices in formatted
    strings
    int nPriceDefined - number of prices
    defined for the item
    Perform the following actions:
    Set "itemIds" in the PageContext.REQUEST_SCOPE
    Set "item" in PageContext.REQUEST_SCOPE
    Set "section" in PageContext.REQUEST_SCOPE
    MessageManagerInter lMsgMgr =
    Architecture.getMessageManagerInstance();
    pageContext.setAttribute("_pageTitle",
    lMsgMgr.getMessage
    ("IBE_PRMT_CT_PRODUCT_DETAILS"),
    PageContext.REQUEST_SCOPE);
    %>
    <%@ include file="ibeCCtpPostingI.jsp" %>
    <%@ include file="ibeCZzdTop.jsp" %>
    <%@ include file="ibeCZzdMenu.jsp" %>
    <%
    if (bItemLoaded)
    OneClick lOneClickObj;
    String xprTagArea = "", confirmXpr = "";
    String lBuyRoutePage;
    String lSectionPathPage = "";
    int sectid = 0;
    Item[] services = new Item[0];
    Item[] relItems = new Item[0];
    Item[] complimentary = new Item[0];
    ItemFlexfield[] itemFlexfields = new ItemFlexfield[0];
    String lItemImage = "", lItemAddtlInfoFile = "";
    StringBuffer lRef = new StringBuffer("ibeCCtdItemDetail.jsp?
    item=");
    String qty = "", userSelUOM = "";
    String errorMsg = "";
    //--------------- load express checkout preferences ---------
    if (IBEUtil.useFeature("IBE_USE_ONE_CLICK"))
    xprTagArea = DisplayManager.getTemplate
    ("STORE_XPR_TAG_AREA").getFileName();
    if (xprTagArea == null)
    xprTagArea = "";
    confirmXpr = lMsgMgr.getMessage("IBE_PRMT_EXPR_CONFIRM");
    if (RequestCtx.userIsLoggedIn()) {
    //initialize OneClick if user is logged in
    BigDecimal partyId = RequestCtx.getPartyId();
    BigDecimal accountId = RequestCtx.getAccountId();
    lOneClickObj = new OneClick();
    lOneClickObj.loadSettingsFrDB(partyId, accountId);
    } // end user express checkout
    //------------ set "section", lSectionPathPage --------------
    String lSectionId = IBEUtil.nonNull(request.getParameter
    ("section"));
    if (lSectionId.equals(""))
    lSectionId =
    IBEUtil.nonNull((String)pageContext.getAttribute
    ("section", PageContext.REQUEST_SCOPE));
    if(IBEUtil.useFeature("IBE_USE_SECTION_PATH"))
    lSectionPathPage = DisplayManager.getTemplate
    ("STORE_CTLG_SCT_PATH").getFileName();
    try {
    sectid = Integer.parseInt(lSectionId);
    pageContext.setAttribute("section", String.valueOf
    (sectid), PageContext.REQUEST_SCOPE);
    } catch (NumberFormatException e) { }
    if(lSectionPathPage == null)
    lSectionPathPage = "";
    lBuyRoutePage = DisplayManager.getTemplate
    ("STORE_CTLG_BUY_PROCESS_ROUTE").getFileName();
    /* if error and forwarded back to this page, get values
    selected by user */
    qty = IBEUtil.nonNull((String)pageContext.getAttribute
    ("qty", PageContext.REQUEST_SCOPE));
    if (qty.equals(""))
    qty = "1";
    userSelUOM = IBEUtil.nonNull((String)pageContext.getAttribute
    ("uom", PageContext.REQUEST_SCOPE));
    errorMsg = IBEUtil.nonNull((String) pageContext.getAttribute
    ("errorMsg", PageContext.REQUEST_SCOPE));
    //set ref for returning to this page in case of error
    lRef.append(lItem.getItemID());
    if (sectid > 0)
    lRef.append("&section=");
    lRef.append(sectid);
    /* Get Bin Open and Bin Close Images */
    String binOpenImg = "", binCloseImg = "";
    try {
    Media binOpenMedia = DisplayManager.getMedia
    ("STORE_BIN_OPEN_IMAGE", true);
    if (binOpenMedia != null)
    binOpenImg = binOpenMedia.getFileName();
    } catch (MediaNotFoundException mnfe) {}
    if (binOpenImg == null)
    binOpenImg = "";
    try {
    Media binCloseMedia = DisplayManager.getMedia
    ("STORE_BIN_CLOSE_IMAGE", true);
    if (binCloseMedia != null)
    binCloseImg = binCloseMedia.getFileName();
    } catch (MediaNotFoundException mnfe) {}
    if (binCloseImg == null)
    binCloseImg = "";
    /* Get images, additional info, flexfields, related items,
    service items */
    lItemImage = lItem.getMediaFileName
    ("STORE_PRODUCT_LARGE_IMAGE");
    lItemAddtlInfoFile = lItem.getMediaFileName
    ("STORE_PRODUCT_ADDTL_INFO");
    // check for defaulting
    String defaultFromSection = "Y";
    if ("Y".equals(defaultFromSection))
    if (lItemImage == null || lItemAddtlInfoFile == null)
    try {
    int parentSectionId = getParentSectionId
    (lItem.getItemID());
    Section parentSection = Section.load(parentSectionId);
    if (lItemImage == null)
    lItemImage = parentSection.getMediaFileName
    ("STORE_SECTION_SMALL_IMAGE");
    if (lItemAddtlInfoFile == null)
    lItemAddtlInfoFile = parentSection.getMediaFileName
    ("STORE_SECTION_ADDTL_INFO");
    } catch (Exception e) {}
    itemFlexfields = lItem.getFlexfields();
    try {
    services = lItem.getRelatedItems("SERVICE");
    } catch (ItemNotFoundException e) {}
    try {
    relItems = lItem.getRelatedItems("RELATED");
    } catch (ItemNotFoundException e) {}
    try {
    complimentary = lItem.getRelatedItems("COMPLIMENTARY");
    } catch (ItemNotFoundException e) {}
    %>
    <!-- body section -----------------------------------------------
    ------------->
    <table border="0" width="100%">
    <%
    if (IBEUtil.showPosting()) {
    %>
    <!--------- iMarketing integration ----------------->
    <tr><td colspan="4" align="center">
    <% try {
    %>
    <jsp:include page="ibapstng.jsp" flush="true" />
    <% } catch (Throwable e) {
    IBEUtil.log("ibeCCtdItemDetail.jsp", "iMarketing error",
    Logger.ERROR);
    %>
    </td></tr>
    <% } //end iMarketing installed
    %>
    <tr><td> </td>
    <%
    if(!lSectionPathPage.equals(""))
    %>
    <td colspan="4" class="smallLink">
    <jsp:include page="<%=lSectionPathPage%>" flush="true" />
    </td>
    <% }
    %>
    </tr>
    <tr><td valign="top">   </td>
    <!-- center column ------------------------------------------
    ------------->
    <td valign="top" width="70%">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td colspan="3">
    <span class="pageTitle"><%=lItem.getDescription()%
    </span></td></tr>
    <tr>
    <% if (lItemImage != null) {
    %>
    <td valign="TOP"><img src="<%=lItemImage%>"></td>
    <td valign="TOP" colspan="2"><%
    =lItem.getLongDescription()%></td>
    <% } else {
    %>
    <td valign="TOP" colspan="3"><%
    =lItem.getLongDescription()%></td>
    <% }
    %>
    </tr>
    <% if (lItemAddtlInfoFile != null) {
    %>
    <tr><td colspan="3"><br>
    <jsp:include page="<%=lItemAddtlInfoFile%>"
    flush="true" />
    </td></tr>
    <% }
    %>
    <tr><td colspan="3"><br></td></tr>
    <%
    for (int i=0; i < itemFlexfields.length; i++)
    String prompt = itemFlexfields.getPrompt();
    String value = itemFlexfields[i].getValue();
    if (value != null && !value.equals(""))
    %>
    <tr>
    <td align="LEFT" width="20%">
    <span class="sectionHeader2"><%=prompt%
       </span></td>
    <td align="LEFT" colspan="2" width="80%"><%=value%
    </td></tr>
    <% }
    if (services.length > 0)
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr><td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_WARRANTIES")%>
    </td>
    <td colspan="2" align="left" class="sectionHeaderBlack"
    width="80%"><hr>
    </td></tr>
    <%
    for(int i=0; i < services.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td align="left" colspan="2" valign="TOP" width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    (STORE_CTLG_ITM_ROUTE", "item=" + services[i.getItemID()) %>">
    <%=services.getDescription()%></A>
    </span>
    <%=services[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" class="sectionHeaderBlack"> </td>
    </tr>
    <% } //end loop through services
    } // end if services.length > 0
    if (relItems.length > 0) {
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr>
    <td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
    </td>
    <td align="left" colspan="2" class="sectionHeaderBlack"
    width="80%"><hr></td>
    </tr>
    <%
    for(int i=0; i < relItems.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td colspan="2" align="left" valign="TOP"
    width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    ("STORE_CTLG_ITM_ROUTE", "item=" + relItems[i].getItemID()) %>">
    <%=relItems[i].getDescription()%></A>
    </span>
    <%=relItems[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" align="RIGHT"
    class="sectionHeaderBlack"> </td>
    </tr>
    <% } // end loop through related items
    } // end if relItems.length > 0
    %>
    </table>
    </td>
    <%if (complimentary.length > 0) {
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr>
    <td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
    </td>
    <td align="left" colspan="2" class="sectionHeaderBlack"
    width="80%"><hr></td>
    </tr>
    <%
    for(int i=0; i < complimentary.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td colspan="2" align="left" valign="TOP"
    width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    ("STORE_CTLG_ITM_ROUTE", "item=" + complimentary[i].getItemID())
    %>">
    <%=complimentary[i].getDescription()%></A>
    </span>
    <%=complimentary[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" align="RIGHT"
    class="sectionHeaderBlack"> </td>
    </tr>
    <% } // end loop through related items
    } // end if complimentary.length > 0
    %>
    </table>
    </td>
    <!-- right column -------------------------------------------
    ------------->
    <td valign="top" width="20%">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <% if (! binOpenImg.equals("")) {
    %>
    <td><img src="<%=binOpenImg%>"></td>
    <% }
    %>
    <td nowrap class="binHeaderCell" width="100%">
    <%
    if (!lItem.isConfigurable()) {
    %>
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_2_WAYS_TO_SHOP")%>
    <% } else {
    %>
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIG_PRODUCT")%>
    <% }
    %>
    </td>
    <% if (! binCloseImg.equals("")) {
    %>
    <td><img src="<%=binCloseImg%>"></td>
    <% }
    %>
    </tr>
    </table>
    </td></tr>
    <tr><td class="binColumnHeaderCell">
    <table border="0" cellspacing="1" width="100%">
    <tr><td class="binContentCell" align="CENTER">
    <% /////////////////////////////// error
    messages //////////////////////////////
    if (!errorMsg.equals("")) {
    %>
    <table><tr><td align="center" class="errorMessage">
    <%=errorMsg%>
    </td></tr></table>
    <% }
    /////////////////////////////// display
    form //////////////////////////////////%>
    <!--Javascript for express checkout confirmation-->
    <script language="JavaScript">
    function get_confirmation(form)
    if (confirm("<%=confirmXpr%>" ) ) {
    form.tmpx.name = '1-Click.x';
    form.tmpy.name = '1-Click.y';
    form.submit();
    return true;
    else
    return false;
    </script>
    <form method=POST action="<%=lBuyRoutePage%>">
    <input type=hidden name="type" value="single">
    <input type=hidden name="item" value="<%=lItem.getItemID()%
    "><input type=hidden name="refpage" value="<%=lRef.toString
    ()%>">
    <INPUT TYPE="HIDDEN" NAME="tmpx" VALUE="100">
    <INPUT TYPE="HIDDEN" NAME="tmpy" VALUE="100">
    <%= RequestCtx.getSessionInfoAsHiddenParam() %>
    <%
    if ( ! lItem.isConfigurable())
    { // display prices
    %>
    <table>
    <tr><td align ="left" nowrap>
    <span class="sectionHeaderBlack">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_LIST_PRICE_COLON")%>
    </span>
    </td>
    <%
    for (int i=0; i < uomCodes.length && i <
    itemListPriceDisplayVec.size(); i++)
    if (uomCodes[i] != null && uomCodes[i].equals
    (lItem.getPrimaryUOMCode()))
    if (itemListPriceDisplayVec.elementAt(i) != null &&
    !itemListPriceDisplayVec.elementAt(i).equals(""))
    %>
    <td align="right">
    <%=itemListPriceDisplayVec.elementAt(i)%
       <%=lItem.getPrimaryUOM()%></td>
    <% } else {
    %>
    <td>   </td>
    <% }
    break;
    } // end primary uomcode
    } // end loop through uoms and list price
    %>
    </tr>
    <tr><td align="left" nowrap>
    <span class="sectionHeaderBlack">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_YOUR_PRICE_COLON")%>
    </span>
    </td>
    <td>
    <% // display selling price for each uom
    if (nPriceDefined > 1) {
    //prices defined for multiple UOMs for the item
    %>
    <select name = "uom">
    <%
    //--------- loop through uoms and prices ------------------
    for (int i=0; i < itemSellPriceDisplayVec.size() && i <
    uomCodes.length; i++)
    if (itemSellPriceDisplayVec.elementAt(i) != null &&
    !itemSellPriceDisplayVec.elementAt(i).equals(""))
    boolean bSelectUom = false;
    if (uomCodes[i] != null && uomCodes[i].equals
    (lItem.getPrimaryUOMCode()))
    bSelectUom = true;
    if (bSelectUom)
    %>
    <option value="<%=uomCodes[i]%>" SELECTED>
    <% } else {
    %>
    <option value="<%=uomCodes[i]%>">
    <% }
    %>
    <%=itemSellPriceDisplayVec.elementAt(i)%
       <%=IBEUtil.nonNull(lItem.getUOM(uomCodes))%
    <%
    } // end current uom has price
    } //end loop i through uoms and prices
    %>
    </select>
    <% //end more than 1 UOM with price defined for the item
    } else {
    if (nPriceDefined == 0) { //multiple UOMs, none with
    price defined
    %>
    <input type=hidden name="uom" value="<%
    =lItem.getPrimaryUOMCode()%>">
    <% } else { // 1 UOM with price defined
    String formatSellPrice = "";
    String uomWithPrice = "";
    for (int i=0; i < uomCodes.length && i <
    itemSellPriceDisplayVec.size(); i++)
    if (itemSellPriceDisplayVec.elementAt(i) != null &&
    !itemSellPriceDisplayVec.elementAt(i).equals(""))
    formatSellPrice = (String)
    itemSellPriceDisplayVec.elementAt(i);
    uomWithPrice = uomCodes;
    break;
    %>
    <input type=hidden name="uom" value="<%=uomWithPrice%>">
    <%=formatSellPrice%>   <%=IBEUtil.nonNull
    (lItem.getUOM(uomWithPrice))%>
    <% } //end 1 UOM with price defined
    } // end display selling prices
    %>
    </td></tr></table> <%-- end table for the price --%>
    <% } // end non-configurable item
    if (bItemCanBeOrdered)
    // show quantity and buttons only if item can be ordered
    %>
    <p><%=lMsgMgr.getMessage("IBE_PRMT_CT_QUANTITY")%>
    <input type="TEXT" name="qty" size="3" maxlength="20"
    value="<%=qty%>">
    </p>
    <% if (lItem.isConfigurable()) {
    %>
    <p>
    <input type=hidden name="uom" value="<%
    =lItem.getPrimaryUOMCode()%>">
    <input type=submit name="Configure.x"
    value="<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIGURE")%
    "></p>
    <% } else {
    %>
    <p>
    <input type=submit name="Add to Cart.x"
    value="<%=lMsgMgr.getMessage
    ("IBE_PRMT_ADD_TO_CART_PRMT_G")%>">
    </p>
    <%
    if (!xprTagArea.equals(""))
    %>
    <p><%=lMsgMgr.getMessage("IBE_PRMT_CT_OR")%></p>
    <p><jsp:include page="<%=xprTagArea%>"
    flush="true" /></p>
    <% }
    } // end item can be ordered
    %>
    <br>
    </form>
    </td></tr></table> <%-- end table for bin content and
    header --%>
    </td></tr></table>
    <p> </p>
    <p> </p>
    </td></tr></table> <%-- end page table --%>
    <% } // end item loaded
    %>
    <%@ include file="ibeCZzdBottom.jsp" %>
    <!-- ibeCCtdItemDetail.jsp end -->

    my bad...didnt think anyone was gonna come in ...lol......nothing populates in the second drop down...I was thinking of making a separate page and just pass the parameter in, bu i never used jsp include.....any suggestions on how to get this thing working??

  • Need some help in a JSP

    Hi all
    i'm new to jsp technolohie and i'm writing a jsp that sends an email on red hat linux
    i keep having theses errors .
    ps the first jsp is fine but its in the second one i have problems
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred between lines: 33 and 38 in the jsp file: /sending.jsp
    Generated servlet error:
    /jakarta-tomcat-4.0.3/work/localhost/_/sending$jsp.java:103: '}' expected.
    out.write(" \r\n \r\n \r\n \r\n\t \r\n");
    ^
    An error occurred between lines: 38 and 75 in the jsp file: /sending.jsp
    Generated servlet error:
    /jakarta-tomcat-4.0.3/work/localhost/_/sending$jsp.java:109: Statement expected.
    public void postMail( String recipients[ ], String subject, String message , String from) throws MessagingException
    ^
    An error occurred between lines: 75 and 97 in the jsp file: /sending.jsp
    Generated servlet error:
    /jakarta-tomcat-4.0.3/work/localhost/_/sending$jsp.java:146: Type expected.
    out.write(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n<h1> \r\n \r\nMessage sent successfully \r\n \r\n</h1> \r\n\t \r\n</body> \r\n</html> \r\n \r\n \t\t\r\n");
    ^
    3 errors, 1 warning
    could u take a look at my codes please so i can know what to do
    this is the first jsp in wich a compose the message
    <%@ page language="java" %>
    <%@ page errorPage="errorpage.jsp" %>
    <html>
    <head>
         <title>JavaMail compose</title>
    </head>
    <body bgcolor="#ccccff">
    <form METHOD=POST ACTION="sending.jsp" >
    <input type="hidden" name="send" value="send">
    <p align="center">
    <b><font size="4" face="Verdana, Arial, Helvetica">
    JavaMail Compose Message</font></b>
    <p>
    <table border="0" width="100%">
    <tr>
    <td width="16%" height="22">     
    <p align="right">
    <b><font face="Verdana, Arial, Helvetica">To:</font></b></td>
    <td width="84%" height="22">
    <% if (request.getParameter("to") != null) { %>
    <input type="text" name="to" value="<%= request.getParameter("to") %>" size="30">
    <% } else { %>
    <input type="text" name="to" size="30">
    <% } %>
    <font size="1" face="Verdana, Arial, Helvetica">
    (separate addresses with commas)</font></td></tr>
    <tr>
    <td width="16%"><p align="right">
    <b><font face="Verdana, Arial, Helvetica">From:</font></b></td>
    <td width="84%">
    <input type="text" name="from" size="30">
    <font size="1" face="Verdana, Arial, Helvetica">
    (separate addresses with commas)</font></td></tr>
    <tr>
    <td width="16%"><p align="right">
    <b><font face="Verdana, Arial, Helvetica">Subject:</font></b></td>
    <td width="84%">
    <input type="text" name="subject" size="55"></td></tr>
    <tr>
    <td width="16%"> </td>
    <td width="84%"><textarea name="text" rows="15" cols="53"></textarea></td></tr>
    <tr>
    <td width="16%" height="32"> </td>
    <td width="84%" height="32">
    <input type="submit" name="Send" value="Send">
    <input type="reset" name="Reset" value="Reset"></td></tr>
    </table>
    </form>
    </body>
    </html>
    this is the send.jsp to wich the first jsp post its data
    <%@ page language="java" %>
    <%@ page import = "java.io.*" %>
    <%@ page import = "java.net.InetAddress" %>
    <%@ page import = "java.util.Properties" %>
    <%@ page import = "java.util.Date" %>
    <%-- @ page import = "javax.mail.* --%>
    <%-- @ page import = "javax.mail.internet.* --%>
    <%@ page errorPage="errorpage.jsp" %>
    <html>
    <head>
         <title>JavaMail send</title>
    </head>
    <body bgcolor="white">
    <%
    String to= request.getParameter("to");
    String from= request.getParameter("from") ;
    String subject= request.getParameter("subject") ;
    String emailBody= request.getParameter("text") ;
    %>
    <%
    public void postMail( String recipients[ ], String subject, String message , String from) throws MessagingException
    boolean debug = false;
         //Set the host smtp address
         Properties props = System.getProperties();
         props.put("mail.smtp.host", mailhost);
         // create some properties and get the default Session
         Session session = Session.getDefaultInstance(props, null);
         //session.setDebug(true);
         session.setDebug(debug) ;
         // create a message
         Message msg = new MimeMessage(session);
         msg=emailBody ;
         // set the from and to address
         InternetAddress addressFrom = new InternetAddress(from);
         addressFrom =From ;
         msg.setFrom(addressFrom);
         InternetAddress[] addressTo = new InternetAddress[recipients.length];
         addressTo = To ;
         for (int i = 0; i < recipients.length; i++)
         addressTo[i] = new InternetAddress(recipients);
         msg.setRecipients(Message.RecipientType.TO, addressTo);
         // Setting the Subject and Content Type
         msg.setSubject(subject);
         msg.setContent(message, "text/plain");
         Transport.send(msg);
         msg.setSentDate(new Date());
    %>
    <h1>
    Message sent successfully
    </h1>
    </body>
    </html>

    Hi,
    Take a look at this page. It has a MessageBoard that also links to a very simple mailing program. It's as basic as you can get, but should help.
    http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/Intro.html
    best,
    kev

  • Help needed in jsp tags

    I am trying to design a view page that retrieves records from database,as the data may contain tags like<p>,<b> I am using encodeHtmlTag function to display them as it is .but some text needs to be appeared in bold but if i give the same,b. as input while viewing it is displayed as",b>" since i am using encodeHtmlTag it encodes all the tags .How i can solve this issue.?
    as a way i tried using "[ " b " ]" as the tag for bold option ,but i am not able to write proper function to recognize that charater and change that tag to ",b>".
    can anyone please help me in this.

    Thanks a Lot.Since I am at my beginning phase of jsp i am not able to I will be more thankful to you if recode my following code so that the bold option works fine with Italics.
    with the following code it encodes all the"<" characters so that if i want to make some part of text as bold while retrieving from database its not working how i can achieve this with the following codes.(r34.jsp).
    j11.jsp is the index page from which it forwards to next page r34.jsp which is the display page i.e it retrieves data from database and displays them.i need help in this page only.
    j11.jsp:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <% 
    StringBuffer cname = new StringBuffer();
    StringBuffer pname = new StringBuffer();
    String nn ="\n\n";
    String body1="null";
    int cnamesize=0;
    int pnamesize=0;
    Vector nnn = new Vector();
    Vector nnp = new Vector();
    Vector nn1 = new Vector();
    String selectedclient="null";
    String prjname1,prjid;
    String xname = request.getParameter("client")!=null?request.getParameter("client"):"";
    //String xname1 = request.getParameter("pname1")!=null?request.getParameter("pname1"):"";
    String xname2 = request.getParameter("prjid")!=null?request.getParameter("prjid"):"";
    //session.setAttribute("prjnamerec", xname1);
    %>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
        <title>Select the Client</title>
        <script language="javascript">
          function calljsp(){
            document.forms[0].action='r34.jsp';
         </script>
      </head>
      <body background="rlogo1.bmp">
        <img src="rheader.bmp" width="990" height="150"></img>
      <center>
      <h2>Login Department</h2>
      </center>
        <form name="clientselection" method=post>
         <h2>Client Selection </h2>
         <table>
            <tr>
                  <marquee><%=xname%></marquee>
              <td>Client :
                <select name="client">
                  <option value="">SELECT</option>
                  <%  try{
                  Class.forName("com.mysql.jdbc.Driver");
                  Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3307/r", "root", "root");
                  Statement statement = connection.createStatement();
                  ResultSet rs = statement.executeQuery("select client from client");
                  while(rs.next())
                      String cname1 = rs.getString(1);
                      nnn.addElement(cname1);
                  int j1 = nnn.size();
                  for(int x = 0;x<j1;x++){
                  String clientName = nnn.elementAt(x)+"";
                  %>
                  <option value="<%= clientName %>">
                    <%=   clientName %>
                  </option>
                  <%  }%>
                </select>
                <input type="submit" value="View Projects"/>
              </td>
            </tr>
          </table>
          <% 
          if(request.getParameter("client")!=null){
                  ResultSet rs1 = statement.executeQuery("select distinct(proj_name),proj_id from projects where client='"+xname+"'");
                  while(rs1.next()){
                    nn1.addElement(rs1.getString(1));
                    nnp.addElement(rs1.getString(2));
          pnamesize=nn1.size();
          for(int p = 0;p<pnamesize;p++){
              prjname1=nn1.elementAt(p)+"";
              prjid=nnp.elementAt(p)+"";
          %>
          <table>
            <tr valign="top" colspan="2">
              <td>
                <br/>
                 <input type="radio" name="prjid"  value="<%=prjid%>"><%=prjid%> &nbsp&nbsp <b><%= prjname1%> </b>
                 <input type="submit" value="Go" onClick="calljsp()"/>
              <br/>
              </td>
            </tr>
          </table>
          <% if(request.getParameter("pname1")!=null){
               //ResultSet rs2 = statement.executeQuery("select * from csrmail where prjname='"+xname1+"'  ");
                 // while(rs2.next()){
            }%>
          <%}%>
         <%}%>
         <% connection.close();
          }catch(SQLException e){
            e.printStackTrace();
          %>
        </form>
      </body>
    </html>
    r34.jsp
    <%!String encodeHtmlTag(String ma){
                                int malength= ma.length();
                          StringBuffer mailbuffer=new StringBuffer();
                              for(int m=0;m<malength;m++)
                               char c=ma.charAt(m);
                                  if(c=='<')
                                      mailbuffer.append("<");
                                  else if(c=='>')
                                       mailbuffer.append(">");
                                   else if(c=='&')
                                       mailbuffer.append("&");
                                    else if(c=='"')
                                       mailbuffer.append(""");
                                    else if(c==' ')
                                       mailbuffer.append(" ");
                                      else if(c=='\n')
                                       mailbuffer.append("<br>");
                                        else if(c=='[')
                                                  c = ma.charAt(m+1);
                                               if(c=='/')
                                                  c=ma.charAt(m+2);
                                                  char d= ma.charAt(m+3);
                                                  if(c=='b'&& d==']')
                                                       mailbuffer.append("</b>");
                                                    m=m+4;
                                                  else if(c=='I'&& d==']')
                                                         mailbuffer.append("</I>");
                                                        m=m+4;
                                                      c = ma.charAt(m);
                                                       if(c=='[')
                                                       c = ma.charAt(m+1);
                                                       if(c=='/')
                                                             c=ma.charAt(m+2);
                                                           char d2= ma.charAt(m+3);
                                                          if(c=='b'&& d2==']')
                                                              mailbuffer.append("</b>");
                                                            m=m+4;
                                              else if(c=='b')
                                               if(ma.charAt(m+2)==']')
                                                    mailbuffer.append("<b>");
                                               m=m+3;
                                               else if(c=='I')
                                               if(ma.charAt(m+2)==']')
                                                    mailbuffer.append("<I>");
                                               m=m+3;
                                             c=ma.charAt(m);
                                              mailbuffer.append(c);
                                      else
                                       mailbuffer.append(c);
                                    return mailbuffer.toString();
                                  }%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*,import java.util.StringTokenizer"%>
    <%
    String xname = request.getParameter("client")!=null?request.getParameter("client"):"";
    //String xname1 = request.getParameter("pname1")!=null?request.getParameter("pname1"):"";
    String xname2= request.getParameter("prjid")!=null?request.getParameter("prjid"):"";
    Vector nnn = new Vector();
    Vector nn1 = new Vector();
    Vector nn2 = new Vector();
    Vector nn3 = new Vector();
    Vector nn4 = new Vector();
    Vector nn5 = new Vector();
    //Vector nn6 = new Vector();
    StringBuffer sb = new StringBuffer();
    StringBuffer redt=new StringBuffer();
    StringBuffer qudt=new StringBuffer();
    StringBuffer retime=new StringBuffer();
    StringBuffer qutime=new StringBuffer();
    //StringBuffer nn6=new StringBuffer();
    StringTokenizer stok1 ;
    String cquery="null";
    String creply="null";
    String cqdate="null";
    String mdate="null";
    String crdate="null";
    ResultSet rs=null;
    ResultSet rs1=null;
    %>  
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
        <title>Records Display</title>
          <script language="javascript">
             function calljsp1(){
                    document.forms[0].action='j11.jsp';
         </script>
      </head>
      <body background="rlogo1.bmp">
       <img src="rheader.bmp" width="990" height="150"></img>
        <form name="RecordsDiplay" method=post>
                  <%String thisclntname12 = xname;%>
                  <%//String thisprjname12 = xname1;%>
                  <%String thisprjid12 = xname2;%>
                    <%//out.println(thisprjname12);%>
                <b>ProjectID :</b>
                    <%out.println(thisprjid12);%>
                     <table bgcolor="rgb(206,206,255)">
            <tr>
              <td>
                      <br>
                         <br>
                  <%
                    try
                        //String thisprjname = xname1;
                         String thisclntname = xname;
                         String thisprjid = xname2;
                         Class.forName("com.mysql.jdbc.Driver");
                         Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3307/r", "root", "root");
                         /*Statement statement = connection.createStatement();
                         ResultSet rs = statement.executeQuery("select mails,mdate from csrmail where proj_id='"+thisprjid+"' ");*/
                   PreparedStatement ps=connection.prepareStatement("select mails,mdate from csrmail where proj_id=?");
                   ps.setString(1,thisprjid);
                   ps.executeQuery();
                   rs=ps.getResultSet();
                         while(rs.next())
                            String cname1 = rs.getString(1);
                            String mdatte = rs.getString(2);
                            nnn.addElement(cname1);
                            nn5.addElement(mdatte);
                           int j1 = nnn.size();
                           for(int x = 0;x<j1;x++)
                              StringBuffer mmdt=new StringBuffer();
                              StringBuffer mmtime=new StringBuffer();
                              String mdt1 =  nn5.elementAt(x)+"";
                              String mdt=mdt1.substring(8,10);
                              String mmonth=mdt1.substring(5,7);
                              String myear=mdt1.substring(0,4);
                              String mhh=mdt1.substring(11,13);
                              String mmm=mdt1.substring(14,16);
                              String mss=mdt1.substring(17,19);
                              mmdt.append(mdt+"-"+mmonth+"-"+myear);
                              mmtime.append(mhh+":"+mmm+":"+mss);
                              String mails1 = nnn.elementAt(x)+"";
                      %>
                            <b>Mail Posted Date</b>
                               <%out.println(mmdt);%>
                            <b>Mail Posted Time :</b>
                               <%out.println(mmtime);%>
                            <br>
                            <br>
                            <b>  <style="font-family:verdana;font-size:80%;color:EE82E">Mail :  </b>
                               <%out.println(encodeHtmlTag(mails1));%>
                            <br>
                      <br>
                       <%}%>
                        </table>
            </tr>
              </td>  
                       <br>
                        <%/*ResultSet rs1 = statement.executeQuery("select * from csrquery where proj_id='"+thisprjid+"' ");*/
            PreparedStatement ps1=connection.prepareStatement("select * from csrquery where proj_id=?");
                   ps1.setString(1,thisprjid);
                   ps1.executeQuery();
                   rs1=ps1.getResultSet();
               while(rs1.next())
                          cquery = rs1.getString(2);
                          cqdate = rs1.getString(4);
                          creply=rs1.getString(5);
                          String nd = "No Reply";
                          crdate = rs1.getString(7);
                            if(rs1.wasNull())
                               nn4.addElement(nd);
                             else
                                nn4.addElement(crdate);
                          nn1.addElement(cqdate);
                          nn2.addElement(cquery);
                          nn3.addElement(creply);
                          int q=nn1.size();
                            for(int j=0;j<q;j++)
                                {%>
                    <%//out.println(thisprjname12);%>
                   <b>ProjectID :</b>
                    <%out.println(thisprjid12);%>
                   <br>
                   <br>
                                 <% String qudt1 = nn1.elementAt(j)+"";
                                  String cqdtt=qudt1.substring(8,10);
                                  String cqmonth=qudt1.substring(5,7);
                                  String cqyear=qudt1.substring(0,4);
                                  String cqhh=qudt1.substring(11,13);
                                  String cqmm=qudt1.substring(14,16);
                                  String cqss=qudt1.substring(17,19);
                                  qudt.append(cqdtt+"-"+cqmonth+"-"+cqyear);
                                  qutime.append(cqhh+":"+cqmm+":"+cqss);
                                  String qu = nn2.elementAt(j)+"";
                                 String re = nn3.elementAt(j)+"\n\n";
                                  String b= qu;
                                 String b1 = re;
                              stok1 = new StringTokenizer (re,"\n");
                                //System.out.println(creply);
                                  String redt1 =  nn4.elementAt(j)+"";              
                                   if(redt1.equals("No Reply")){
                                      redt.append(redt1);
                                         retime.append(redt1);
                                   else
                                     String redtt=redt1.substring(8,10);
                                      String remonth=redt1.substring(5,7);
                                      String reyear=redt1.substring(0,4);
                                    String rehh=redt1.substring(11,13);
                                      String remm=redt1.substring(14,16);
                                      String ress=redt1.substring(17,19);
                                     redt.append(redtt+"-"+remonth+"-"+reyear);
                                     retime.append(rehh+":"+remm+":"+ress);
                                   } %>
                              <br>
                               <table>      
                                <tr>
                                 <td>
                                   <b>Query Posted Date</b>
                               <%out.println(qudt);%>
                                   <b>Query Posted Time :</b>
                               <%out.println(qutime);%>
                                   <br>
                               <b style="font-family:verdana;font-size:80%;color:green">Query :</b>
                               <%out.println(encodeHtmlTag(b));
                               %>
                         </td>
                       </tr>
                     </table>
                             <br>
                                <table>
                                <tr bgcolor="rgb(174,174,200)">
                                 <td>
                                   <b>Last Reply Posted Date</b>
                               <%out.println(redt);%>
                                   <b>Last Reply Posted Time :</b>
                               <%out.println(retime);%>
                                   <br>
                                 <%
           while(stok1.hasMoreTokens())
             out.println(encodeHtmlTag(stok1.nextToken()));%>
             <br>
         <% }
                                    int qudtsize = qudt.length();
                                    qudt.delete(0,qudtsize);
                                    int qutimesize = qutime.length();
                                    qutime.delete(0,qutimesize);
                                  int redtsize = redt.length();
                                   redt.delete(0,redtsize);
                                   int retimesize = retime.length();
                                    retime.delete(0,retimesize);
                                   %>
                              <br>
                    <br>
    </td>
                       </tr>
                     </table>
                  <% }
              connection.close();
            }catch(SQLException e)
            e.printStackTrace();
          %>
          <input type="submit"  value="Back" onClick="calljsp1()"/>
        </form>
      </body>
    </html>

  • Help needed in JSP Expression Language

    Hi all,
    I have been working for JSP Expression Language Sample execution since past 5 days. I am using the application server as "Jboss Server" and web server as "Tomcat".
    I have been included the jsp-api.jar file in my lib directory of application server as well as source folder's lib directory.
    When i am trying to build the source code, i am getting this build error.
    [javac] D:\eclipse\workspace\esolvProject\development\src\com\esolv\taglibs\
    web\classes\SetSupport.java:186: cannot resolve symbol
    [javac] symbol : method getExpressionEvaluator ()
    [javac] location: class javax.servlet.jsp.PageContext
    [javac] ExpressionEvaluator evaluator = pageContext.getExpressionEvaluator();
    In my jsp-api.jar , there are two classes called,
    PageContext and JspContext, Both are abstract classes.
    PageContext inherits JspContext class. JspContext class have the method getExpressionEvaluator() , returns ExpressionEvaluator.
    PageContextImpl - class . it has been called internally when we are trying to call PageContext class. In PageContextImpl class, there is one comment before, the method's definition. that is
    " Since JSP 2.0 "
    But we have the JSP 2.0 version. But it won't work.
    Please help me ont this.
    Thanks in Advance,
    Natraj

    >
    If the pblm was due to setting the classpath.
    The error should be showed for all files in the jar
    file.
    why i am getting the error for particular method ?
    it is accessing the other methods of same class
    'JspContext' . but it is not accessing that method.
    Thats my question.
    Just check that your .jar file is 2.0 compliant and that you do not have any other jars(for servlet or jsp api) in the classpath.
    Probably you have an older version of .jar file in your path. So the errors will appear only for those methods that have been added since 2.0, all other methods would compile fine.
    Please tell me the jar files to work out the
    expression language. so that i can cross check my
    list of jars.Hmmm...I dont use jboss. In tomcat the jar file name is jsp-api.jar. But it would have been the same even for jsp1.1, going by jar file names wouldnt help. Just look at your cp as if with a microscope to identify redundant jars.
    cheers,
    ram.

  • Urgent help is needed - JSP & Java beans

    Hi,
    I am getting the following problem when trying to interact with Javabeans from JSP (DB I use is Cloudscape) :
    An exception occurred while interacting with the guestbook database.
    The error message was:
    Cannot create bean of class proj.beans.UserDataBean
    Please try again later
    The problem probably occurs in following line:
    status = guestData.checkUser(userName,emailName);
    where guestData represents a Javabean class.
    The strangest thing is that sometimes, suddenly, the program is working OK without this Error Message but when it occurs I don't know the reason and how to solve it.
    Please advise...
    Thanks a lot.

    Can you copy the entire stack trace and post it? It would probably help.

  • Help pls ! JSP not working in tomcat

    Hi techies,
    I have a problem in executing jsp files thru tomcat on windows
    The problem is i have my jsp files in a directory, i use virtual directory concept by setting up context in server.xml file to access my jsp, servlets and html files and some jsp files are working properly, but certain jsp files are not working...
    It gives an error saying " jsp file not found.." even though the file is in the directory
    Can anyone help to come-out of this problem.
    Rgds
    sathish

    Hi,
    if you are trying to map a short name to a jsp page, you should do that in the web.xml file not in the server.xml i think...
    Hope this help...

  • Date selection and search help component in jsp

    Hi all:
        In sap portal jsp development enviorment, is it possible to easily program the date selection and search help ( just look like search help in webdynpro ) ?

    Hello Jianhong,
    the easiest way to set a value help is using HTMLB component in your JSP.
    To do it, use next code:
    <hbj:inputField
               id="DateInputField"
               type="date"
               showHelp="TRUE"
               ... other attributes
    />
    Before using HTMLB components in your JSP, don't forget to add this line to your page:
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    regards.
    mz

  • Urgent help, Tree Viewer JSP

    Has anyone gotten the tree viewer bean to work on a JSP? If so, please give tips on it, or an example of table would be appreciated. I keep getting an error message that my row-set browser is not self-refferencial.
    Thanks

    hi vidyut, thanks for the help. was juz wondering. The file contents tt im supposed to read in and print out contains around 200 similar entries, meaning :
    MEASURE Waist_Full=33.19
    MEASURE Waist_Front=16.06
    MEASURE Waist_Back=17.12
    MEASURE Waist_Height_Front=38.82
    MEASURE Waist_Height_Back=39.73
    MEASURE Waist_Height_Left=39.28
    MEASURE Waist_Height_Right=39.28
    MEASURE Waist_Front_X=43.98
    MEASURE Waist_Back_X=35.04
    MEASURE Waist_Width=11.85
    MEASURE Shirt_Collar=14.88
    MEASURE Neck2Waist_Front=19.64so is the properties object stil the best method to use? To extract the whole string except MEASURE and '='?

  • Help in using JSP: Urgent As Project dues soon

    Hello Guys, i am new here. I got some problems using jsp. My main project is about a webpage where there is login and password for users. But, I can GO to a certain JSP page without LOGINING in. For example, i got a jsp page for customer to buy and sell things, the page that process my buy & sell can be viewed without the customer logging in. Anyone can help me? Thanks Alot.

    Hello Guys, i am new here. I got some problems using jsp. My main project is about a webpage where there is login and password for users. But, I can GO to a certain JSP page without LOGINING in. For example, i got a jsp page for customer to buy and sell things, the page that process my buy & sell can be viewed without the customer logging in. Anyone can help me? Thanks Alot.

  • HELP! Beginning JSP with JavaBean Class

    First of all, I'm using jdk1.4 beta and Jakarta's tomcat version 4.0.1 release build.
    Hello. I desparately need help. I have a JavaBean class ("CarBean.class") saved in %catalina_home%\webapps\root\myapp\web-inf\classes\com\wrox\cars\CarBean.class
    I also have a jsp page saved as carpage.jsp in %catalina_home%\webapps\root\myapp\
    So when I point my browser to http://localhost:8080/myapp/carpage.jsp, I get an internal server error. It appears it can't find the JavaBean class for some reason. I'm pretty sure I have my envionment variables set up right. I can get it to work, if I save the JavaBean class in c:\jdk1.4\jre\class\com\wrox\cars
    Here's my JavaBean class source file:
    package com.wrox.cars;
    import java.io.Serializable;
    public class CarBean implements Serializable {
    public CarBean() {
    private String make = "Ford";
    public String getMake() {
    return make;
    public void setMake(String make) {
    this.make = make;
    and here's my jsp page:
    <html>
    <head>
    <title>Using a JavaBean</title>
    </head>
    <body>
    <h2>Using a JavaBean</h2>
    <% com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean(); %>
    I own a <%= myCar.getMake() %>
    <% myCar.setMake("Ferrari"); %>
    Now I own a <%= myCar.getMake() %>
    </body>
    </html>
    I'm not new to java, just JSP. I just don't know why I can't get the jsp to locate the JavaBean class. I remember I used to have an older version of Tomcat and I recall not having any problems. It seems the Tomcat 4.XX is somewhat significantly different than previous versions. Perhaps I configured my Tomcat wrong? Help would be greatly appreciated. Thanks.

    hi
    i am not using Tomcat server but as i worked in JWS you have to import the bean class from jsp files.
    so the first code in jsp file will be like this
    <%@ page import = "CarBean">
    becoz JWS cant automatically find the bean class we have to explicitly import bean.but i dont know if tomcat finds
    bean or one have to import.
    hope this will help u.
    regards
    manoj choudhury.

  • Urgent:JMS AND JSP

    I am working with an architecture which has JSP pages talking to JMS message bean and in turn message bean talks to EJB, which persists the user data.
    I am quite new to JMS. My understanding is that JMS is used for Asynchronous operations. The requirement is a user can enter some data using form and the jsp page is supposed invoke a message bean which goes through other layers to store the info in the DB and should display a user An ID from the DB. How do I implement a mechanism to get message back from the Message Bean? I am using WebLogic Appserver 6.1. Please help

    First of all, you need to realize that your client and users are not the same thing. All your web requests come thru the webserver and into a certain application space, and your message queue is associated with that application, not each web user. So you only have one client to the message queue.
    Clearly you need to identify each web user in a unique way.
    Generate a sequential and unique ID for each web user and keep this is a hashtable. Remove it from the hashtable once the web user has no longer used it after a certain timeout period. If you are using Servlets then use the Session ID which is sent and received in cookies and used to link the broken session of web browsing.
    Send this unique ID with your message. And then link it back up to the original web user, once you have received a response from the queue.
    It does'nt sound like you need message queues though, since you want to return an immediate response to your client. However, look into Session.CLIENT_ACKNOWLEDGE which provides a synchronous receiver. I doubt if it will solve your problem as this works on the session level and not the message level. But check it out.
    I dunno, your question is vague, you need to provide more info.

  • PLZ HELP ME PROBLEM :- JSP Pages is slow

    HI, i am using oracle 10g application server to deploy my jsp pages.
    When i am running the jsp page ie. default.jsp which consist of three combo box which are dependent on each other.
    Database :- oracle 10g.
    Logic : I am retrieving all the data from the database in to a nested structure and using that nested structure to fill up in the combo box,
    Problem : when i m refreshing or opening the page , it takes a lot of time to open. well the data are also not so much huge that it take some time. ]
    Plz help me

    Why have you declared your own interface Tag?
    The server knows nothing about your custom classes.
    You should be implementing the javax.servlet.jsp.tagext.Tag Interface.
    Actually the easier way is for your tag to extend SimpleTag, which implements the basic interface for you, leaving you to override the bit you want to.
    Check out the API: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/package-summary.html

Maybe you are looking for