JSP, JSTL and XML Exception

Hi,
I'm using tomcat 5.0.28 with J2SE5, JSP and JSTL. I tried to execute the following example about JSTL and XML.
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
<c:import url="book.xml" var="url" />
<x:parse xml="${url}" var="book" scope="session" />
<x:choose>
</x:choose>
<P>
<B><x:out select="$book/book/title"/></B><BR>
<x:out select="$book/book/author"/><BR>
<x:out select="$book/book/url"/><BR>When I execute the jsp file, the container produces following exception:
javax.servlet.ServletException: org/apache/xpath/XPathException
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
     org.apache.jsp.xml.xml_005fchoose_jsp._jspService(xml_005fchoose_jsp.java:104)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
     java.lang.ClassLoader.defineClass1(Native Method)
     java.lang.ClassLoader.defineClass(ClassLoader.java:620)
     java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
     org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
     org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
     org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
     org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
     java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
     org.apache.taglibs.standard.tag.common.xml.WhenTag.condition(WhenTag.java:51)
     org.apache.taglibs.standard.tag.common.core.WhenTagSupport.doStartTag(WhenTagSupport.java:65)
     org.apache.jsp.xml.xml_005fchoose_jsp._jspx_meth_x_when_0(xml_005fchoose_jsp.java:203)
     org.apache.jsp.xml.xml_005fchoose_jsp._jspx_meth_x_choose_0(xml_005fchoose_jsp.java:169)
     org.apache.jsp.xml.xml_005fchoose_jsp._jspService(xml_005fchoose_jsp.java:84)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Due to the fact, that org/apache/xpath/XPathException belongs to xalan, i copied the xalan 2.7.0 to the web-inf/lib directory. But this doesn't solve the problem. I'm tried it also with xalan, xerces and jaxp. Again, it doesn't work.
Can anybody help me with this problem?
bye

Couple of things, possibly unrelated, but not sure.
You are using JSTL1.0 uris.
With Tomcat5 you can use JSTL1.1, and the Servlet2.4 spec.
You would use the URI: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
and also update your web.xml file to declare itself as version 2.4
You shouldn't need any of the xalan xerces or jaxp classes in web-inf/lib.
xerces is by default found in the [TOMCAT]/common/endorsed directory.
The others should be provided with the standard java API.
I would try with minimal jar files in web-inf/lib
Occasionally if you include files twice in the classpath it will create ClassNotFoundExceptions like this.
Hope this helps,
evnafets

Similar Messages

  • Problem in the jsp, jstl and java script.

    Hi Friends,
    I am having one jsp which allows user(Could you please refer to code which is written in my jsp) to enter his username and password i want to get the password in the same jsp and want it to be passed to the custom tag without sending request to the server.Please give me an idea.Thanks in advance.
    This is the text field which allows a password.
    <INPUT type="password" name="password" size="10" maxlength="29" onblur="chkpwd()" onfocus="this.autocomplete=false" >
    and this is the anchor tag which refers as LOGIN BUTTON
    <IMG height=19 src="images/submit1.gif" width=106 border=0>
    when user clicks on LOGIN BUTTON i am calling one javascript function LOGIN(PASSWORD:) to check the validation if the validation is success then i want to get the password in the same function which is entered .
    This is ok i can get the password by "document.formName.password.value" then i need to pass this value to the jstl tag which is our own tag as shown below.
    <prefix:tagname value="PASSWORD which is having in the javascript variable".
    Please help me .
    Quick reply is thankfull.
    Edited by: bharathpolanki on Apr 20, 2008 1:55 AM
    Edited by: bharathpolanki on Apr 20, 2008 2:55 AM

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • JSP/JSTL & XML

    I am trying to have JSP pages parse and read an XML file and then return some data in an HTML table. I'm using the JSTL libraries and have a basic understanding of them, but I apparently need help.
    My first page just gets the value and passes it to the second page. The second page handles all of the processing. Here is my JSP page:
    <%@page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
    <%@include file="index.jsp" %>
    <% String clientID = request.getParameter("enteredID"); %>
    <c:import url="npiXMLTest5.xml" var="doc" />
    <x:parse varDom="dom" doc="${doc}"/>
    <x:set var="srcCID" select="string($dom/npiNumbers/client/clientNum)" />
    <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>NPI XJTL Test</title></head>
    <body>
    <c:set var="CID" value="<%= clientID %>" />
    <h2>NPI XJTL Test Page</h2>
    <table border="1">
    <tr><th>NPI Number</th><th>Description</th></tr>
    <c:choose>
    <c:when test="${CID}=${srcCID}">
    <x:forEach select="$dom/npiNumbers/client/npiNum" var="$n">
    <tr><td><x:out select="$n/npi" /></td><td><x:out select="$n/desc" /></td></tr>
    </x:forEach>
    </c:when>
    <c:otherwise>
    There is an error with your coding
    </c:otherwise>
    </c:choose>
    </table></body></html>My XML structure is as follows:
    <npiNumbers xsi:schemaLocation="http://localhost/namespace NPI_XSD5.xsd" xmlns="http://localhost/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <client>
    <clientNum/>
    <clientName/>
    <npiNum>
    <npi/>
    <desc/>
    </npiNum>
    </client>
    </npiNumbers>I am trying to return the results of the <npiNum> element (which can have multiple values) - <npi> and <desc> - in a table based on the <clientNum> element. I try to evaluate the page variable with the xml element. If it matches, I will return a table. A client can have multiple <npiNum> elements, so the construction of the table is in the x:forEach loop.
    I think my problem is getting the variable from JSP to compare against the <clientNum> element in the XML file.
    Any ideas?

    I think your problem is less JSP/JSTL and more querying the XML.
    You are trying to "select all <npinum> elements from a client based on clientnum"
    I am far from an expert on XPath, but I think the following query is what you are after: "/npinumbers/client[clientNum=????]/npiNum"
    To do that with JSTL you would replace ???? with $param:enteredId or $CID (equivalent in your example)
    Here is the resulting JSP page.
    <%@page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
    <c:import url="npiXMLTest5.xml" var="doc" />
    <x:parse varDom="dom" doc="${doc}"/>
    <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>NPI XJTL Test</title></head>
    <body>
    <c:set var="CID" value="${param.enteredId}" />
    <h2>NPI XJTL Test Page</h2>
    <table border="1">
    <tr><th>NPI Number</th><th>Description</th></tr>
    <x:forEach select="$dom/npiNumbers/client[clientNum=$CID]/npiNum" var="n">
      <tr><td><x:out select="npi" /></td><td><x:out select="desc" /></td></tr>
    </x:forEach>
    </table>
    <hr>
    <form>
    <input type="text" name="enteredId"/>
    <input type="submit">
    </form>
    </body></html>I made up the following test file to use with it. I don't know if it was exactly what your requirements are, but it was a best guess based on your info.
    <npiNumbers>
         <client>
              <clientNum>42</clientNum>
              <clientName>Ford Prefect</clientName>
              <npiNum>
                   <npi>123</npi>
                   <desc>life</desc>
              </npiNum>
              <npiNum>
                   <npi>234</npi>
                   <desc>universe</desc>
              </npiNum>
              <npiNum>
                   <npi>456</npi>
                   <desc>everything</desc>
              </npiNum>          
         </client>
         <client>
              <clientNum>666</clientNum>
              <clientName>Satan</clientName>
              <npiNum>
                   <npi>333</npi>
                   <desc>Baby Devil</desc>
              </npiNum>
         </client>
    </npiNumbers>Cheers,
    evnafets

  • Servlets , JSP, JSTL ,etc

    Hello
    In my Web project , I have used servlets, JSP , JSTL and JDBC to develop a Website, and now I am preparing a report about it.
    Please forgive me if this question sounds "not very smart" , but kindly help. Is it correct to mention in my report I have used J2EE techologies and then briefly explain about JSP, Servlets, etc?
    Thank you
    Vajra

    Well this really depends on what purpose your report serves and what the person/organization you're submitting your report to requires.
    What have you been told to do? Do you have any template that you need to follow?
    If you don't have any, then I guess you could add a section on the technology used and add a brief description covering this.
    But really, this totally depends on your situation and requirements. No one can tell you what to do. And you wouldn't blindly follow advice given by anonymous strangers on an Internet forum for an important project report now would you? :D

  • Oracle Report vs JSP efficiency and Excel XML in Web Source Questions

    I have used Oracle Reports in the past 6i, but haven't used them in about 4 years. We are now using 9.0.4 reports and I am trying to generate Excel XML from an Oracle report by manipulating the web source of the report. Basically copying and pasting the Excel XML into the web source of the Oracle Report instead of html as suggested by this Metalink Doc ID 240819.1. I do have a JSP working example that generates Excel XML created in JDeveloper and successfully spawns off a very nice looking Excel spreadsheet.
    However, a statement was made here by our app sever guy that an Oracle Report is more efficient at getting data from the database than a JSP. The app sever section does not want anyone using JSPs to generate a report of any kind. I guess small web pages are OK since our java guys use them all the time. This rule for a Reports only environment seems a little restrictive to me. Is there any truth to the statement that Oracle Reports bulk collects data in one chunk as opposed to a JSP making multiple trips to the database from the middle tier?
    Secondly, if an Oracle Report is more efficient in the way that it collects large record sets from the db, and if I save an Oracle Report as a JSP not an rdf, and use the reports_tld.jar with the rw tags instead of the typical jsp jstl tags, will I still get the same improvement from using an Oracle report? I guess the improvement is in the library used correct?
    Thirdly, although not part of this forum, I also am assuming that if we have single sign on that when I call a JSP from an Oracle Form I will not have to log in again correct?
    Thanks...
    Message was edited by:
    Mark Reichman

    It could be the configuration issue. Reconfigure the engine.

  • Example JSP and XML code inside that allows update of attributes

    <?xml version="1.0" encoding="UTF-8"?>
    <MATT_DOCUMENT>
    <NAME>Test MATT Document</NAME>
    <DESCRIPTION>An example MATT Document</DESCRIPTION>
    <TITLE>Matt Australia</TITLE>
    <INCLUDEME>TRUE</INCLUDEME>
    <KEYWORDS>Australia Brisbane Sydney</KEYWORDS>
    <content><![CDATA[<HTML><BODY>Example Document Content</BODY></HTML>]]></content>
    </MATT_DOCUMENT>
    <?xml version="1.0" standalone="yes"?>
    <ClassObject>
    <Name>MATT_Document</Name>
    <Description>A MATT Document.</Description>
    <Superclass RefType="name">Document</Superclass>
    <BeanClassPath>qut.MATT.MATT_Document</BeanClassPath>
    <Attributes>
    <Attribute>
    <Name>TITLE</Name>
    <DataType>STRING</DataType>
    <DataLength>100</DataLength>
    <Required>true</Required>
    </Attribute>
    <Attribute>
    <Name>INCLUDEME</Name>
    <DataType>BOOLEAN</DataType>
    <Required>true</Required>
    </Attribute>
    <Attribute>
    <Name>KEYWORDS</Name>
    <DataType>STRING</DataType>
    <DataLength>500</DataLength>
    <Required>false</Required>
    </Attribute>
    </Attributes>
    </ClassObject>
    /* For information on deploying an instance class bean see iFS Developer's Guide 1.1 Section 4-14 */
    package qut.MATT;
    import oracle.ifs.server.S_LibraryObjectData;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.TieDocument;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.common.AttributeValue;
    public class MATT_Document extends TieDocument
    private static final boolean DEBUG = true;
    public static final String CLASS_NAME = "MATT_DOCUMENT";
    public static final String TITLE_ATTRIBUTE = "TITLE";
    public static final String INCLUDEME_ATTRIBUTE = "INCLUDEME";
    public static final String KEYWORDS_ATTRIBUTE = "KEYWORDS";
    public MATT_Document(LibrarySession ifsSession, java.lang.Long id, java.lang.Long classId, S_LibraryObjectData data)
    throws IfsException
    // Construct a Document object - standard variant.
    super(ifsSession,id,classId,data);
    public void setTitle(String newValue)
    throws IfsException
    AttributeValue av = AttributeValue.newAttributeValue(newValue);
    setAttribute(TITLE_ATTRIBUTE,av);
    public String getTitle()
    throws IfsException
    AttributeValue av = getAttribute(TITLE_ATTRIBUTE);
    return av.getString(getSession());
    public void setIncludeMe(boolean newValue)
    throws IfsException
    AttributeValue av = AttributeValue.newAttributeValue(newValue);
    setAttribute(INCLUDEME_ATTRIBUTE,av);
    public boolean getIncludeMe()
    throws IfsException
    AttributeValue av = getAttribute(INCLUDEME_ATTRIBUTE);
    return av.getBoolean(getSession());
    public void setKeywords(String newValue)
    throws IfsException
    AttributeValue av = AttributeValue.newAttributeValue(newValue);
    setAttribute(KEYWORDS_ATTRIBUTE,av);
    public String getKeywords()
    throws IfsException
    AttributeValue av = getAttribute(KEYWORDS_ATTRIBUTE);
    return av.getString(getSession());
    <%-- Copyright 2000 Matt Shannon / Oracle Corporation --%>
    <%-- This page is used for the modification of MATT Document Properties --%>
    <%-- Page Directives --%>
    <%@ page language = "java"
    errorPage=""
    import = "java.util.*, java.text.SimpleDateFormat"
    contentType="text/html;charset=UTF-8"
    info="MATT Document Properties Screen"%>
    <%@ page import = "oracle.ifs.clients.webui.WebUILogin"%>
    <%@ page import = "oracle.ifs.clients.webui.WebUIUtils"%>
    <%@ page import = "oracle.ifs.clients.webui.resources.WebUIResources"%>
    <%@ page import = "oracle.ifs.clients.webui.resources.JspResourcesID"%>
    <%@ page import = "oracle.ifs.clients.webui.FileUtils"%>
    <%@ page i mport = "oracle.ifs.beans.LibrarySession"%>
    <%@ page import = "oracle.ifs.beans.PublicObject"%>
    <%@ page import = "oracle.ifs.beans.Attribute"%>
    <%@ page import = "oracle.ifs.common.AttributeValue"%>
    <%@ page import = "qut.MATT.MATT_Document"%>
    <HEAD>
    <META http-equiv="pragma" content="no-cache">
    <META http-equiv="expires" content="0">
    <%-- Declarations --%>
    <%! final String headingTitle = "MATT Document Properties";
    %>
    <%-- Scriptlet --%>
    <%
    WebUILogin login = WebUILogin.getWebUILogin(request);
    if (login.isTimedOut())
    String msg = "" + WebUIUtils.getResourceString(WebUIResources.WEBUI_SESSION_TIMEOUT_ERROR_CODE);
    msg = msg.replace('\"','\'');
    %>
    <script language="JavaScript">
    alert("<%=msg%>");
    top.close();
    </script>
    <%
    else // if logged in
    String path = WebUIUtils.getBasePathFromServletPath(request,
    WebUIUtils.getUTF8Parameter(request,"path"));
    String container = WebUIUtils.getUTF8Parameter(request,"container");
    String Title = WebUIUtils.getUTF8Parameter(request,"Title");
    String IncludeMe = WebUIUtils.getUTF8Parameter(request,"IncludeMe");
    String Keywords = WebUIUtils.getUTF8Parameter(request,"Keywords");
    String actn = WebUIUtils.getUTF8Parameter(request,"actn");
    LibrarySession sess = login.getSession();
    if (actn == null)
    actn = "";
    if (Title == null)
    Title = "";
    if (IncludeMe == null)
    IncludeMe = "";
    if (Keywords == null)
    Keywords = "";
    if (path.indexOf(":") != -1)
    // path is fine no change
    else if (container.equals("null"))
    path = ":" + path;
    else if (container.endsWith("/"))
    path = container + path;
    else if (path.indexOf(container) == 0)
    // leave path alone
    else
    path = container + "/" + path;
    path = FileUtils.convertPath(path, sess);
    PublicObject pObject = null;
    String displayName = path;
    pObject = WebUIUtils.findPublicObjectByPathOrId(login.getResolver(), login.getSession(),path);
    if (pObject != null)
    pObject = pObject.getResolvedPublicObject();
    if (pObject != null)
    String name = pObject.getName();
    if (name != null && !name.equals(""))
    displayName = name;
    %>
    <title>
    <%= "QUT - " + displayName + " - " + headingTitle%>
    </title>
    <link rel=STYLESHEET type="text/css" href="../webui/css/NewStyles.css">
    </head>
    <body bgcolor="#FFFFFF" link="#FF0000" vlink="#FF0000" alink="#FF0000" onload="store_initial_values()">
    <%
    if (pObject == null)
    %>
    <h3><%=login.getJspResourceString(JspResourcesID.SHOWDOCPROPS_NOT_FOUND_TEXT)%></h3>
    <table>
    <tr>
    <td width="31" height="10" align=left>
    <form>
    <input type="button" name="Button"
    value="<%=login.getJspResourceString(JspResourcesID.WEBUI_OK_BUTTON)%>"
    onclick="top.close();">
    </form>
    </td>
    </tr>
    </table>
    <%
    else // pObject != null
    try
    if (!(pObject instanceof MATT_Document))
    %>
    <h3>Error - Object not an instance of MATT_Document</h3>
    <table>
    <tr>
    <td width="31" height="10" align=left>
    <form>
    <input type="button" name="Button"
    value="<%=login.getJspResourceString(JspResourcesID.WEBUI_OK_BUTTON)%>"
    onclick="top.close();">
    </form>
    </td>
    </tr>
    </table>
    <%
    else
    %>
    <script language="JavaScript1.2">
    var success = true;
    var oldTitle = "";
    var oldIncludeMe = "";
    var oldKeywords = "";
    function store_initial_values()
    oldTitle = document.forms.docPropertiesForm.Title.value;
    oldIncludeMe = document.forms.docPropertiesForm.IncludeMe.selectedIndex;
    oldKeywords = document.forms.docPropertiesForm.Keywords.value;
    function validate_form()
    if (hasChanges())
    document.forms.docPropertiesForm.submit();
    else
    top.close();
    function hasChanges()
    var hasChanged = false;
    var newTitle = " ";
    var newIncludeMe = "";
    var newKeywords = "";
    newTitle = document.forms.docPropertiesForm.Title.value;
    newIncludeMe = document.forms.docPropertiesForm.IncludeMe.selectedIndex;
    newKeywords = document.forms.docPropertiesForm.Keywords.value;
    if (oldTitle != newTitle)
    hasChanged = true;
    else if (oldIncludeMe != newIncludeMe)
    hasChanged = true;
    else if (oldKeywords != newKeywords)
    hasChanged = true;
    return hasChanged;
    </script>
    <%
    if (actn.equals("save_values"))
    try
    // set Title if changed
    if (Title != null && !Title.equals(((MATT_Document)pObject).getTitle()))
    ((MATT_Document)pObject).setTitle(Title);
    // set Keywords if changed
    if (Keywords != null && !Keywords.equals(((MATT_Document)pObject).getKeywords()))
    ((MATT_Document)pObject).setKeywords(Keywords);
    // set IncludeMe if changed
    if (IncludeMe != null)
    boolean l_includeMe = IncludeMe.equals("1");
    if ( ((MATT_Document)pObject).getIncludeMe() != l_includeMe )
    ((MATT_Document)pObject).setIncludeMe(l_includeMe);
    catch (Exception e)
    String msg = "" + login.getErrorResolver().getMessage(e);
    msg = msg.replace('\"','\'');
    %>
    <script language="JavaScript">
    alert("<%=msg%>");
    var success = false;
    history.back();
    </script>
    <%
    } // end catch block
    %>
    <script language="JavaScript">
    if (success)
    document.write("<h2><%=login.getJspResourceString(JspResourcesID.SHOWDOCPROPS_PROPERTIES_SAVED_TEXT)%></h2><form><input type=button value='<%=login.getJspResourceString(JspResourcesID.WEBUI_OK_BUTTON)%>' onclick='top.close();'></form>");
    </script>
    <%
    else // if !actn.equals("save_values")
    %>
    <center>
    <form name="docPropertiesForm" method="POST" action="MATTproperties.jsp">
    <table border="1" width="90%">
    <tr>
    <td width="100%" colspan="3" class="DH">
    MATT Document Class Properties <br>
    </td>
    </tr>
    <tr>
    <td width="20%" class="required" align="left">
    Class Name:
    </td>
    <td width="80%">
    <%=pObject.getClassObject().getName()%>
    </td>
    </tr>
    <tr>
    <td width="20%" class="required" align="left">
    Bean Path:
    </td>
    <td width="80%">
    <%=pObject.getClassObject().getBeanClasspath()%>
    </td>
    </tr>
    <tr>
    <td width="20%" class="required" align="left">
    Description:
    </td>
    <td width="80%">
    <%=pObject.getClassObject().getDescription()%>
    </td>
    </tr>
    <tr>
    <td width="100%" colspan="3" class="DH">
    MATT Document Properties <br>
    </td>
    </tr>
    <tr>
    <td width="15%" class="required">
    Path:
    </td>
    <td width="85%" colspan="2">
    <%=path%>
    </td>
    </tr>
    <tr>
    <td width="20%" class="required" align="left">
    Title:
    </td>
    <td width="80%">
    <input type=text name="Title" value="<%=((MATT_Document)pObject).getTitle()%>" size=100>
    </td>
    </tr>
    <tr>
    <td width="20%" class="required" align="left">
    Keywords:
    </td>
    <td width="80%">
    <input type=text name="Keywords" value="<%=pObject.getAttribute("Keywords").getString(sess)%>" size=100>
    </td>
    </tr>
    <tr>
    <td width="20%" class="required" align="left">
    IncludeMe:
    </td>
    <td width="80%">
    <select class="listbox" size="1" name="IncludeMe">
    <%
    if (((MATT_Document)pObject).getIncludeMe())
    %>
    <option value="1" selected>true</option>
    <option value="0" selected>false</option>
    <%
    else
    %>
    <option value="1">true</option>
    <option value="0" selected>false</option>
    <%
    %>
    </SELECT>
    </td>
    </tr>
    </table>
    <table width="80%">
    <tr>
    <td width="58" height="10" align =left>
    <input type="button" name="Button" value="<%=login.getJspResourceString(JspResourcesID.WEBUI_OK_BUTTON)%>" onclick="validate_form();">
    </td>
    <td width="62" height="10" align=right>
    <input type="hidden" name="actn" value="save_values">
    <input type="hidden" name="path" value="<%=WebUIUtils.getServletPathFromBasePath(request,path)%>">
    <input type="hidden" name="container" value="<%=container%>">
    <input type="button" name="Button" value="<%=login.getJspResourceString(JspResourcesID.WEBUI_CANCEL_BUTTON)%>" onclick="top.close();">
    </td>
    </tr>
    </table>
    </form>
    <%
    } // end - if actn.equals
    %>
    <%
    } // end - if pObject instance of
    %>
    <%
    catch (Exception e)
    String msg = "" + login.getErrorResolver().getMessage(e);
    msg = msg.replace('\"','\'');
    %>
    <script language="JavaScript">
    alert("<%=msg%>");
    var success = false;
    history.back();
    </script>
    <%
    } // end catch block
    finally
    out.flush();
    } // if pObject
    %>
    <%
    } // if logged in
    %>
    </BODY>
    </HTML>
    There is probably lots of better ways of doing the above. The iFS 1.1 Developer guide confused me alot particularly sections 4-10 and 4-11 where it talks about an instance class bean that extends the Tie classes, then the example shown on 4-12 is completely different!
    note.. also i got most of the above code using JAD having decompiled webui.jar. Seems these JARS are not obfuscated.
    webui.jar in $ORACLE_HOME/ifs1.1/lib
    matt.

    Thanks. I have ifs 1.1 now and have modified this example to use my custom type. However, when the jsp runs and hits the code at the beginning that checks "if login.isTimedOut()", it always thinks I have timed out, even though I have just logged in via the webui.
    Any ideas would be appreciated.

  • JSP Servlet and convert the result set of an SQL Query To XML file

    Hi all
    I have a problem to export my SQL query is resulty into an XML file I had fixed my servlet and JSP so that i can display all the records into my database and that the goal .Now I want to get the result set into JSP so that i can create an XML file from that result set from the jsp code.
    thisis my servlet which will call the jsp page and the jsp just behind it.
    //this is the servlet
    import java.io.*;
    import java.lang.reflect.Array;
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.naming.*;
    import javax.sql.*;
    public *class *Campaign *extends *HttpServlet
    *private* *final* *static* Logger +log+ = Logger.+getLogger+(Campaign.*class*.getName());
    *private* *final* *static* String +DATASOURCE_NAME+ = "jdbc/SampleDB";
    *private* DataSource _dataSource;
    *public* *void* setDataSource(DataSource dataSource)
    _dataSource = dataSource;
    *public* DataSource getDataSource()
    *return* _dataSource;
    *public* *void* init()
    *throws* ServletException
    *if* (_dataSource == *null*) {
    *try* {
    Context env = (Context) *new* InitialContext().lookup("java:comp/env");
    _dataSource = (DataSource) env.lookup(+DATASOURCE_NAME+);
    *if* (_dataSource == *null*)
    *throw* *new* ServletException("`" + +DATASOURCE_NAME+ + "' is an unknown DataSource");
    } *catch* (NamingException e) {
    *throw* *new* ServletException(e);
    protected *void *doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    Connection conn = *null*;
    *try* {
    conn = getDataSource().getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select post_id,comments,postname from app.posts");
    // out.println("Le r&eacute;sultat :<br>");
    ArrayList <String> Lescomments= *new* ArrayList<String>();
    ArrayList <String> Lesidentifiant = *new* ArrayList<String>();
    ArrayList <String> Lesnoms = *new* ArrayList <String>();
    *while* (rs.next()) {
    Lescomments.add(rs.getString("comments"));
    request.setAttribute("comments",Lescomments);
    Lesidentifiant.add(rs.getString("post_id"));
    request.setAttribute("id",Lesidentifiant);
    Lesnoms.add(rs.getString("postname"));
    request.setAttribute("nom",Lesnoms);
    rs.close();
    stmt.close();
    *catch* (SQLException e) {
    *finally* {
    *try* {
    *if* (conn != *null*)
    conn.close();
    *catch* (SQLException e) {
    // les param&egrave;tres sont corrects - on envoie la page r&eacute;ponse
    getServletContext().getRequestDispatcher("/Campaign.jsp").forward(request,response);
    }///end of servlet
    }///this is the jsp page called
    <%@ page import="java.util.ArrayList" %>
    <%
    // on r&eacute;cup&egrave;re les donn&eacute;es
    ArrayList nom=(ArrayList)request.getAttribute("nom");
    ArrayList id=(ArrayList)request.getAttribute("id");
    ArrayList comments=(ArrayList) request.getAttribute("comments");
    %>
    <html>
    <head>
    <title></title>
    </head>
    <body>
    Liste des campagnes here i will create the xml file the problem is to display all rows
    <hr>
    <table>
    <tr>
    </tr>
    <tr>
    <td>Comment</td>
    <td>
    <%
    for( int i=0;i<comments.size();i++){
    out.print("<li>" + (String) comments.get(i) + "</li>\n");
    }//for
    %>
    </tr>
    <tr>
    <td>nom</td>
    <td>
    <%
    for( int i=0;i<nom.size();i++){
    out.print("<li>" + (String) nom.get(i) + "</li>\n");
    }//for
    %>
    </tr>
    <tr>
    <td>id</td>
    <td>
    <%
    for( int i=0;i<id.size();i++){
    out.print("<li>" + (String) id.get(i) + "</li>\n");
    }//for
    %>
    </tr>
    </table>
    </body>
    </html>
    This is how i used to create an XML file in a JSP page only without JSP/SERVLET concept:
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%
    // Identify a carriage return character for each output line
    int iLf = 10;
    char cLf = (*char*)iLf;
    // Create a new empty binary file, which will content XML output
    File outputFile = *new* File("C:\\Users\\user\\workspace1\\demo\\WebContent\\YourFileName.xml");
    //outputFile.createNewFile();
    FileWriter outfile = *new* FileWriter(outputFile);
    // the header for XML file
    outfile.write("<?xml version='1.0' encoding='ISO-8859-1'?>"+cLf);
    try {
    // Define connection string and make a connection to database
    Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/SAMPLE","app","app");
    Statement stat = conn.createStatement();
    // Create a recordset
    ResultSet rset = stat.executeQuery("Select * From posts");
    // Expecting at least one record
    *if*( !rset.next() ) {
    *throw* *new* IllegalArgumentException("No data found for the posts table");
    outfile.write("<Table>"+cLf);
    // Parse our recordset
    // Parse our recordset
    *while*(rset.next()) {
    outfile.write("<posts>"+cLf);
    outfile.write("<postname>" + rset.getString("postname") +"</postname>"+cLf);
    outfile.write("<comments>" + rset.getString("comments") +"</comments>"+cLf);
    outfile.write("</posts>"+cLf);
    outfile.write("</Table>"+cLf);
    // Everything must be closed
    rset.close();
    stat.close();
    conn.close();
    outfile.close();
    catch( Exception er ) {
    %>

    Please state your problem that you are having more clearly so we can help.
    I looked at your code I here are a few things you might consider:
    It looks like you are putting freely typed-in comments from end-users into an xml document.
    The problem with this is that the user may enter characters in his text that have special meaning
    to xml and will have to be escaped correctly. Some of these characters are less than character, greater than character and ampersand character.
    You may also have a similiar problem displaying them on your JSP page since there may be special characters that JSP has.
    You will have to read up on how to deal with these special characters (I dont remember what the rules are). I seem to recall
    if you use CDATA in your xml, you dont have to deal with those characters (I may be wrong).
    When you finish writing your code, test it by entering all keyboard characters to make sure they are processed, stored in the database,
    and re-displayed correctly.
    Also, it looks like you are putting business logic in your JSP page (creating an xml file).
    The JSP page is for displaying data ONLY and submitting back to a servlet. Put all your business logic in the servlet. Putting business logic in JSP is considered bad coding and will cause you many hours of headache trying to debug it. Also note: java scriptlets in a JSP page are only run when the JSP page is compiled into a servlet by java. It does not run after its compiled and therefore you cant call java functions after the JSP page is displayed to the client.

  • Juggle between jstl and jsp!

    I have a list of items and whose size is obtained by jstl as follows:
    <c:set var="num" value="${fn:length(form.namesList)}"/>I have to find the number of blocks using jsp and I am trying as follows which is giving jspException.
    <%int numCols = (int)Math.ceil( num / 10.0);%>Can anyone tell me the problem over here?
    I need to use numCols to display my results using jstl as follows:
    <c:forEach var="y" begin="${1}" end="${numCols }">
    </c:forEach>Can juggle between jstl and jsp like this?

    This depends on the version of JSP you are using:
    If you are using JSP 2.0 (like Tomcat 5), make sure you have downloaded and installed JSTL 1.1 and set the web.xml up to use the Servlet 2.4 specs. Then the code you wrote should work.
    If you are using JSP 1.x (like Tomcat 4 and below), make sure you have JSTL 1.0. Then you can only use EL (the Expression Language used to translate ${...} expressions) inside JSTL.
    If you want to use EL inside your custome tags, look through the Apache Jakarta sight. Somewhere they have an ELExpression translator (a couple of classes actually - whose full names I forget). These classes will let you take the ${...} expressions in as strings, pass them through the translators and get the correct objects back out.
    Or you could go a simpler root:
    <mob:whatever object="test" name="newname" />
    then in your custom tag:
      MyType test = (MyType)pageContext.findAttribute(object);
      test.setName(name);

  • Philisophical Question:  Tools for synchronizing JSPs, Java Beans and XML?

    This is a "best practices" question...
    The JSTL and JSF tags provide a lot of support for minimizing the amount of text that must be included in a JSP page. For example:
    <c:out value="${customer.firstName}"/>This snippet will find an object named "customer" in any of the JSP scopes, extract the value of the property named "firstName", and output it as part of the page.
    Here are my questions:
    (1) Is there a recommended method to communicate to the page designer what objects are in scope for a particular page, and what the properties of those objects are?
    (2) Is there any programmatic way to determine from the program's source code that an object with the specified name and of the expected type will be in scope at run time?
    I would love to have an IDE that would be able to help the page designer by providing a list of the objects that are expected to be in scope, along with the name of their properties. What conventions exist to make this possible?

    Maybe you like this, it's one of dozens of tools for Struts and in version 3.0
    http://www.scioworks.com/scioworks_camino.html
    hth,
    .V

  • Javax.servlet.jsp.jstl.sql.Result and arraylist

    Hi,
    I try to explain my problem, I have posted in another section of forum, but perhaps this is a better place:
    I'm trying to use MVC model, so I call an EJB from a servlet which returns me a javax.servlet.jsp.jstl.sql.Result object (this derive from a resultset of a query) and then I make this available to a jsp page.
    I've choosen to return an javax.servlet.jsp.jstl.sql.Result object because I'd like to use this syntax:
    <c:forEach var="profiloString" items="${listaProfili}" >
              ${profiloString.anything}
    </c:forEach>Now I need to put my listaProfili object in session and permit users of my application to add and delete items from it. Finally I will update my database with the new data from listaProfili object.
    If listaProfili is an arraylist I can easily add or delete item from it, but if it is a javax.servlet.jsp.jstl.sql.Result I don't know how I can do this.
    If I return an arraylist object instead of an javax.servlet.jsp.jstl.sql.Result object, I can't use "<c:forEach ..." syntax.
    Can anyone help me?
    Thanks.

    So why didn't you think that the JSP forum here wasn't a good place to ask JSP questions like this one?
    You can use <c:for-each> with a List. That's how it's designed. I don't understand why you say you can't. Perhaps you were confused by the SQL tags in JSTL. But anyway, you should just return a List from your EJB and forget about using obscure internal JSP classes.

  • JSTL 1.1 : Exception uri can not be resolved.

    Hi buddy,
    I'm getting the below excpetion message when i try to use JSTL 1.1
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)
         org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
         org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
    The below is my configuration,
    1. I'm using Tomcat 5.0 web container
    2. I had used servlet and jsp without any problem
    3. I think to use JSTL 1.1 at first time in my small web application
    4. I have copied jstl.jar which comes up with tomcat jsp-exmaples to my jspel/WEB-INF/lib directory (jspel is my aplication name)
    5. I have wrriten the below servlet
    JstlTestServlet.java
    ===============
    package com.el;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class JstlTestServlet extends HttpServlet
         public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
                   String [] names={"Sachin","Dravid","Dhony","Jaffer"};
                   request.setAttribute("cricketers",names);
                   RequestDispatcher disp=request.getRequestDispatcher("jstlview.jsp");
                   disp.forward(request,response);
    6. I have written the below jsp and its been placed in jspel directory (my application home directory)
    jstlview.jsp
    =========
    <html>
    <head>
    <title>JSTL View</title>
    </head>
    <%@ page isELIgnored="false" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <body>
    <center> <u> <h2> JSTL Practice </h2> </u>
    <br><p>
    <table>
         <c:forEach var="names" items="${cricketers}" >
         <tr>     
                   <td> ${names} </td>
         </tr>
         </c:forEach>
    </table>
    </body>
    </html>
    ========================================
    7. The below is my web.xml
    ===================
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
         <servlet-name>jstlprocessor</servlet-name>
    <servlet-class>com.el.JstlTestServlet</servlet-class>
         </servlet>
         <servlet-mapping>
    <servlet-name>jstlprocessor</servlet-name>
    <url-pattern>/jstl.do</url-pattern>
    </servlet-mapping>
    </web-app>
    =========================================
    8. I load the url in my browser: http://localhost:8085/jspel/jstl.do
    9. I get the exception as mentioned in the top of the notes : "org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application"
    Can you please tell me should i do any more configurayion any where, i believed taglib will be taken from WEB-INF/jstl.jar file ?
    Cheers,
    Saravvij.

    Well there goes the theory that you had JSTL1.0 installed.
    It was a nice theory while it lasted.
    The interesting thing is when I open the .jar I doesn't see a Manifest directory there is just the .mf file.Depending on the zip tool you are using, the screen shows up differently. It should be in a PATH of "META-INF" though, which amounts to the same thing.
    If the tld files are NOT in the META-INF path, that would be the cause of the issue.
    There are jstl.jar and standard.jar in the webapps\examples\WEB-INF\lib directory, but this should not affect my webapp since it is in a different
    context root right?You are correct. They won't affect your web app as they are a different context.
    Just as an experiment, try copying those versions into your webapp and see if it makes any difference. Its just an alternative source of the JSTL libraries.
    You don't have other copies of jstl lying around do you? In the [TOMCAT]/lib directory for instance?
    One other thing that might be the cause. According to [Tomcat context configuration|http://tomcat.apache.org/tomcat-6.0-doc/config/context.html] you can set the processTlds attribute to "false" and it won't process tlds. Check the server.xml and the relevant context.xml files to see if this option has been set. The default is "true" so it would have to have been explicitly disabled- something unlikely to have happened, but possible.
    Cheers,
    evnafets

  • JSTL and TOMCAT what files go where?

    I have just started to learn JSP, and sofar everything is going ok except that I need to use the JSTL file and the book I'm using says do this and it don't work!! Can anyone give me a difinative answer as I am now stuck not able to move on any more.
    When I run my JSP id can't find the uri="http://java.sun.com/jstl/core_rt"
    The book says move the files from the C:\java2\jakarta-taglibs-src\standard-1.0.2\lib directory to the lib directory within the WEB-INF folder of my app but no luck.
    Can anyone tell me what needs to go where please!
    Jon

    steps for jstl to work.
    1. copy the jar files to \WEB-INF\lib.
    2. copy the tld file to \WEB-INF
    3. add the following content to your \WEB-INF\web.xml file.
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
    add similar contents for all the jstl libraries. (c, x, fmt, sql, etc...)
    4. on the jsp page, add this at the start.
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    add similar entries for all the taglibs u want to use.
    5. restart tomcat.
    ur done....
    hope it helps.
    siddharth.

  • Class not found javax.servlet.jsp.jstl.sql.Result in Richfaces

    When I try to run the richfaces application using Weblogic 10.3 AS and Netbean IDE 6.9.1, I found ClassNotFoundException on javax.servlet.jsp.jstl.sql.Result class.
    I class path the following libs.
    commons-beanutils-core-1.8.0.jar
    commons-digester-1.8.jar
    commons-fileupload-1.2.1.jar
    commons-io-1.2.jar
    commons-logging-1.1.1.jar
    glassfish.el_2.1.1.jar
    glassfish.jsf_1.2.9.0.jar
    javassist-3.8.0.GA.jar
    jhighlight-1.0.jar
    jsf-facelets.jar
    jsf-api.jar
    log4j-1.2.14.jar
    richfaces-api-3.3.0.GA.jar
    richfaces-impl-3.3.0.GA.jar
    richfaces-ui-3.3.0.GA.jar
    glassfish.jstl_1.2.0.1.jar
    Also I try to deploy without using some jar files already exists in application server.
    My web.xml configuration is-
    <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>#{skinSelector.skin}</param-value>
    </context-param>
    <context-param>
    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
    <param-value>enable</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.SKIN</param-name>
    <param-value>skin_name</param-value>
    </context-param>
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    I also try to configure <library-ref>....</libray-ref> configuration in weblogic.xml and weblogic-application.xml and I also deploy JSF-2.0.war as library in application.
    Please
    h5.MUTU

    So why didn't you think that the JSP forum here wasn't a good place to ask JSP questions like this one?
    You can use <c:for-each> with a List. That's how it's designed. I don't understand why you say you can't. Perhaps you were confused by the SQL tags in JSTL. But anyway, you should just return a List from your EJB and forget about using obscure internal JSP classes.

  • Problem using jstl and displaytags

    Hi all,
    I am using display tags taglib for generation of table. One of the columns has to be shown with the hyperlink attached to it. In order to acheive this i am using jstl taglib together with displaytags
    <display:table name="reportList" id="row" requestURI="viewengagementstatus.do" style="width: 100%;">
    <display:column  title="Period"  sortable="true" style="text-align:  center;" >
    <a href="/jsps/reportsummary.do?eid=<c:out value="${row.eid}" />&reportId=<c:out value="${row.ReportID}" />&reportPeriod=<c:out value="${row.targetDate}"/> " target="_blank"><font size="1"><c:out value="${row.targetDate}"/></font></a>
    </display:column>I am using jstl1.1.2.jar for jstl.
    When i run this on Weblogic10 and windows OS i am able to view the results. On performing the view source on the IE window, i get the following:
    <td style="text-align:  center;">
                   <a href="/jsps/reportsummary.do?eid=78004&reportId=104093&reportPeriod=Nov-2008 " target="_blank"><font size="1">Nov-2008</font></a>
    </td>but when the same code is run on the Weblogic deployed on the Linux machine, i am not getting the links and the name:
    the view-source of the application deployed on the linux machine shows:
    td style="text-align:  center;">
                   <a href="/jsps/reportsummary.do?eid=&reportId=&reportPeriod=" target="_blank"><font size="1"></font></a>
    </td>Any Ideas why this is occuring?
    Any help would be appreciated

    You should be using the one or the other, not both. Since your actual code shows that you don't need the jstl/core_rt taglib (you're using the JSP EL ${ } in JSTL tags rather than scriptlets <%= %> ), just remove that taglib declaration and continue using the jstl/core taglib.
    You should also rather place both the JSTL and standard JAR in the classpath of the application server. In case of Tomcat, put it in its /lib directory. Then remove all unnecessary JSTL and Standard JAR and TLD files from your whole webapplication project and also remove any related entries from the web.xml of your webapplication project. To use JSTL you only need to put the JAR files in the classpath of the application server and define the taglib in your JSP. Nothing less and nothing more. If you're using JSTL 1.2 rather than JSTL 1.1, then you need to remove the standard.jar file too since it is already merged in the jstl-1.2.jar file.
    Oh, the web.xml should also be declared that way that the application server uses at least servlet 2.4.

  • JSTL unicode xml does not display after x:parse call

    I am trying to display an xml file on the web using JSTL xml tags. The file is encoded in utf-8 containing ancient Greek characters (x1f92, etc.). The file displays properly from a servlet + xslt (http://163.1.169.41/testapp), but I want to use JSTL.
    The JSTL produces intricate spaghetti on the screen (e.g. ��������������� ). I have seen this before --it would seem that unicode is indeed being directed at the screen but is not being interpreted properly. (Not strings of question marks mind you; the unicode seems to be there in this case).
    The code producing the spaghetti is below. I am just dumping in on the screen for now and will use xpath calls later for more precise extraction.
    Does the JSTL want character entities for the x arse call? I would not think so: parsing a utf-8 file would be a very common operation. How can I get the xml unicode file to display properly using the JSTL below?
    [headers]
    <%@ page contentType="text/html; charset=utf-8"pageEncoding="utf-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <c:import var="papyrus" url="blabula.xml" />
    <x:parse var="doc" xml="${papyrus}" />
    <x:out select="$doc" />
    ....

    Is it the parse or the import tag that is at fault?
    Try just printing the results of the <c:import> and see what it produces.
    you might try <c:import var="papyrus" url="blabula.xml" charEncoding="utf-8" />

Maybe you are looking for