Jstl c:if test

I have put a string in my request:
pageContext.getRequest().setAttribute("photoAccountmanager", "SUCCESS");
How can I retrieve the string in jstl? The next statement doesn't work:
<c:if test="${request.photoAccountmanager == 'SUCCESS'}" >
</c:if>

The proper EL way of retrieving from a particular scope is to use the Scope's map (requestScope for requests, sessionScope for sessions, applicationScope for application).
<c:if test="${requestScope.photoAccountmanager == \"SUCCESS\"}">
Note, that as long as there is no fear of having a variable of the same name in a different scope, specifying the scope is not necessary:
<c:if test="${photoAccountmanager == \"SUCCESS\"}">
Also not the escaped double quotes rather than single quotes. Not positive this is necessary, but I think it is the correct way to do it.
Finally, if trouble still persists, try using
<c:if test="${requestScope.photoAccountmanager eq \"SUCCESS\"}">

Similar Messages

  • JSTL tags for testing OR conditions

    Suppose I want to display a table in my JSP if either of two conditions exists. Obviously I don't want to display the table twice. I could do it this way.
    <logic:equal name="condition1"      property="prop1" value="12">
    [[construct my table here]]
    </logic:equal>
    <logic:notEqual name="condition1"      property="prop1" value="12">
         <logic:equal name="condition2"      property="prop2" value="1">
    [[construct my table a second time here]]
    </logic:equal>
    </logic:notEqual>
    The problem here is that I am constructing my table twice....I have to repeat all of the logic to construct the table two times w/in the JSP.
    Any way to do this other than
    1) doing the table in an include and including it from multiple locations--I want to do this type thing many times w/in a JSP, but don't really want many includes....that's not very manageable.
    2) Creating a single condition representing (condition1||condition2) in the code and passing it to the JSP. Same reasoning applies---seems complicated to create a bunch of conditions in the code, especially if I want to do this several times in one JSP, for several different sets of conditions.
    Thanks for any thoughts on this.

    njmarbaugh wrote:
    Suppose I want to display a table in my JSP if either of two conditions exists. Obviously I don't want to display the table twice. I could do it this way.
    <logic:equal name="condition1"      property="prop1" value="12">
    [[construct my table here]]
    </logic:equal>
    <logic:notEqual name="condition1"      property="prop1" value="12">
         <logic:equal name="condition2"      property="prop2" value="1">
    [[construct my table a second time here]]
    </logic:equal>
    </logic:notEqual>
    The problem here is that I am constructing my table twice....I have to repeat all of the logic to construct the table two times w/in the JSP.
    Any way to do this other than
    1) doing the table in an include and including it from multiple locations--I want to do this type thing many times w/in a JSP, but don't really want many includes....that's not very manageable.
    2) Creating a single condition representing (condition1||condition2) in the code and passing it to the JSP. Same reasoning applies---seems complicated to create a bunch of conditions in the code, especially if I want to do this several times in one JSP, for several different sets of conditions.
    Thanks for any thoughts on this.well in JSTL it would be much simple by using EL in place.
    <c:choose>
       <c:when test="${requestScope.condition1.prop1 != '12' ||  requestScope.condition1.prop2 == '1' }">
       </c:when>
       <c:otherwise>
       </c:otherwise>
    </c:choose>Hope that might help :)
    REGARDS,
    RaHuL

  • JSP 2.0 JSLT not processing defined context - Tomcat 5.0.19

    Hi,
    I am using tomcat 5 for my development. If I define the context in server.xml JSLT tag is not processing. I added jslt.jar and standard.jar file in common/lib direcotry.
    I have a simple jsp file p.jsp
    ======================
    p.jsp
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    JSLT Test
    <br>
    <c:out value="${order.amount + 5}"/>
    Test 1.
    I copied p.jsp into webapps/ROOT directory and started tomcat. Using webbrowser I accessed p.jsp.
    http://localhost:8080/p.jsp
    output:
    ======
    JSLT Test
    ${order.amount + 5}
    Test 2:
    I created new context in server.xml file like this:
    <Context path="/test" docBase="test"
    debug="5" reloadable="true" crossContext="true"/>
    copied p.jsp file into webapps/test direcotry.
    I got the following ouput:
    http://localhost:8080/test/p.jsp
    output:
    ======
    JSLT Test
    ${order.amount + 5}
    Test 3.
    Now I didn't define any context. created directory under webapp/nocontext and copied p.jsp file.
    JSLT Test
    ${order.amount + 5}
    Any idea why this page isnot processing. I looking ouput
    JSLT Test 5.
    SR

    Hi all,
    Just I found the problem. My web.xml file header is worng. The following web.xml is working.
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
    version="2.4">
    <display-name>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    </web-app>
    http://localhost:8080/test/p.jsp
    output:
    ======
    JSLT Test
    5

  • Printing Message

    I have Windows XP. I updated to Adobe Reader 9.0 and now cannot print any pdf files. I uninstalled and then reinstalled 8.13 version. Still doesn't print. I never had a problem until I instated the 9.0. I keep getting the following message:
    Before you can perform print-related tasks such as page setup or printing a document, you need to install a printer.
    I have uninstalled and reinstalled my printer too. I can print in Word and everything else but I cannot print pdf files.
    Any help would be greatly appreciated. Thank you in advance.

    It's simple, use a JSTL+Servlet approach as shown as following article:
    http://avatar21.superihost.com/index.php?entry=entry070114-070222
    here's how you do it in the JSTL:
    <c:if test="${not empty sessionScope['messageQ']}">
    <c:forEach var="customMessage" items="${sessionScope['messageQ']}">
      <c:out value="${customMessage}"/>
    </c:forEach>
    </c:if>Hope this help!
    Regards,
    Avatar Ng
    Message was edited by:
    Avatar_Ng

  • EL issues... again!!

    Hello everybody,
    First of all excuse me if I post another help request regarding this "problem", but there is something that still I don't understand... :(
    I have to write a custom tag that, at the moment, does exactly what the <c:out> tag does.
    Here what I did:
    web.xml
    <?xml version="1.0"?>
    <!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 id="TestTLD">
         <display-name>TLD Test Application</display-name>
         <taglib>
              <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
              <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
         </taglib>
         <taglib>
              <taglib-uri>http://www.test.it/jstl/test</taglib-uri>
              <taglib-location>/WEB-INF/tld/test.tld</taglib-location>
         </taglib>
    </web-app>
    test.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>test</short-name>
    <uri>http://www.test.it/jstl/test</uri>
    <display-name>JSTL test</display-name>
    <description>JSTL 1.0 test core library</description>
    <tag>
    <name>test</name>
    <tag-class>it.test.TestTag</tag-class>
    <attribute>
    <name>value</name>
    <required>true</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    TestTag.java
    package it.test;
    import javax.servlet.jsp.tagext.*;
    import java.io.IOException;
    public class TestTag extends TagSupport {
    private String value;
    public void setValue(String value) {
    this.value=value;
    public String getValue() {
    return this.value;
    public int doStartTag() {
    try {
    pageContext.getOut().write(this.value);
    } catch (IOException e) {
    System.err.println(e.toString());
    return SKIP_BODY;
    Ok, I packaged everything in a war file and deployed it.
    Then I added a jsp, just to test what would happen with this experiment:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://www.test.it/jstl/test" prefix="test" %>
    <html><body>
    <c:set var="x" value="Foo" />
    <c:out value="${x}" />
    <test:test value="${x}" />
    </body></html>
    Obviously, the <c:out> tag prints out Foo, and mine prints out ${x}
    I read previous advices about changing dtd version and so on, but I don't understand why there are two differents behaviours with equals configuration files (my web.xml and test.tld were copied by the <c:out> tag ones).
    I'm trying the code above on tomcat version 5.0.28, with jdk 1.5.0_06
    Thank you in advance.
    Ale

    You are using JSTL1.0.
    In JSTL1.0, the responsibility for evaluating the tag is in the Java Tag class. It parses the String value, and evaluates the EL expression. If you take a look at the JSTL source code, it calls an Expression evaluator.
    Your code is not - it is just printing the attribute straight out.
    That is why the JSTL tag is working, and your one is not.
    See this page on someone else doing a similar thing:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=50&t=012689
    However if you have a JSP2.0 container, and can program to JSP2.0 standards, then you shouldn't have to do this at all.
    The container (Tomcat) can evaluate the expression for you, and pass it to the tag. Effectively you can use ${expr} anywhere that you could previously use <%= expr %> - they are both runtime expressions.
    That is the fundamental change between JSTL1.0 and JSTL1.1 - JSTL1.1 allowed rtexprvalues where JSTL1.0 didn't.
    To use the JSP2.0 functionality of Tomcat
    - upgrade your web.xml to declare it is version 2.4 (otherwise EL is disabled by default for backwards compatibility)
    - make the <rtexprvalue> in your tld "true" for this tag.
    Thats it.
    Hope this helps,
    evnafets

  • My "JSTL" test file can't run ,help.

    I copy all the jar file to %TOMCAT_HOME%/webapps/jstl/WEB_INF/lib/
    copy all the tld file to %TOMCAT_HOME%/webapps/jstl/WEB_INF/tlds/
    set the web.xml as below:
    <?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>
      <taglib>
         <taglib-uri>http://jakarta.apache.org/taglibs/core</taglib-uri>
         <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
      </taglib>
    </web-app>set the jsp file as below:
    <%@taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
    <c:out value="CORE" default="null"/>
    <br>
    <c:out default="null"/>when running, it has errors below:
    javax.servlet.ServletException: fRecognizedFeatures
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    java.lang.NoSuchFieldError: fRecognizedFeatures
         at org.apache.xerces.parsers.XML11Configuration.(Unknown Source)
    What does these errors mean?
    How can i handle them?

    Thank u and i'll try it when i back to office, but do
    u mean I should copy the META-INF to my website?No.
    >
    What's the use of META-INF ?The META-INF is part of a JAR file. It is where 'meta-information' is stored. To learn more about JARs then go to the Tutorial section of this website and find the one on JARs.
    >
    There is another strange problem. In JSTL source,
    there is an example called "Standard-examples.war".
    I copy to the webapps. Run tomcat to unzip it, I have
    a look at the Standard-examples folder, all the
    jar,tld,class,WEB-INF are in it and all the think are
    configed correctly.
    But when i test it
    "http://localhost/Standard-examples/index.jsp".
    It give the same err-messge as I gave at this thread
    first.
    Why? The downloade examples should not be configed
    wrong, but it gave the same error, I think is there
    any problem with my website.
    I'm confused with itThat does sound like ether there is a problem with your server, or with the JSTL you downloaded. First I would delete all JSTL refernces and re-install JSTL the correct way. Then restart the server.
    This error may not be related to JSTL, though. It may be that your server.xml, or your web.xml is not configured correctly.

  • JSTL test if checkbox is checked

    Hello all,
    I hope this question isn't too amateurish to answer, but it is something that has been troubling me.
    I have a table with two columns. In the first column i've got a form checkbox with id="myCheckbox" and in the second column I have a bit of text that I only want displayed if the checkbox is checked. I mostly had this working through a combination of a small javascript function that was set to the onclick parameter of the checkbox to toggle between hiding and displaying the text while having the text initialize to not be displayed (with style="display:none")...
    ...but the problem was that if there was an error being returned in the form, the page would reload with the text hidden, but the checkbox checked. Now I could get around this by re-initializing the checkbox to being unchecked... but that's not the solution i'm looking for. Ideally, if an error were returned and the page reloaded I would like the checkbox to be checked and the text to be displayed.
    I was hoping that perhaps I could use some JSTL magic to form a statement around the text... something to the effect of <c:if test="${myCheckbox.checked}"> display text </c:if> . But that isn't working for me. Am I close in my thinking? I think my thinking is mostly good, it's the implementation that is not good. Is there any way to perform such a test?
    Let me know if anyone can help... thanks,
    Skylar

    Hmm, that is helpful, but it doesn't get me quite there.
    I was unfamiliar with the "not empty param" test, so thank you. As I suspected after reading your post, however, the parameter is not set until the form is submitted. I think I may have to either use a combo of your suggestion along with my previous javascript function... or add additional functionality to my script to maintain state between page reloads.
    Does this make sense? Again, thanks evnafets.Let me know if you (or anyone else!) have any other ideas.

  • Need to test for a Hashtable key in JSTL

    What I am trying to accomplish is to test a Hashtable for a specific key and if it is there run some HTML.
    This is my code but it obviously wrong since JSTL yells at me when I try to execute it.
    <c:set var="hash" scope="page" value="${UpdateStatusData}"/>
         <c:if test="${hash.containsKey('success')}">
              success
         </c:if>UpdateStatusData is a Hashtable. How can I modify this "code" in oder to test for a key?
    Thanks

    EL != java
    Luckily EL handles Maps quite well:
    <c:set var="hash" scope="page" value="${UpdateStatusData}"/>
    // one way
    <c:if test="${not empty hash.success}">
         success
    </c:if>
    // an alternative syntax
    <c:if test="${not empty hash['success']}">
         success
    </c:if>Cheers,
    evnafets

  • JSTL Core - How to test for null?

    How do I test an attribute for null using JSLT's if statement? The below code does not work (the JSTL if statement does not return true). The scriptlet however does work and displays the statement.
    - Chris
    index.jsp
    <%@ taglib uri="c.tld" prefix="c"%>
    <%@ taglib uri="fmt.tld" prefix="fmt"%>
    <%@page import="java.util.*"%>
    <%
       request.setAttribute("null", null);
    %>
    <html>
    <head>
      <title>JSTL Test Page</title>
    </head>
    <body>
    <c:if test="${null}==null">
    The value was null (JSTL)
    </c:if>
    <%
      if (request.getAttribute("null")==null) out.print("The value was null (Scriptlet)");
    %>
    </body>
    </html>
    <%out.flush();%>

    Well, I figured out. If anyone is interested, here is the code:
    <c:if test="${empty varName}">
      Its null
    </c:if>

  • If statement in jstl

    I am new to jstl and I wrote the code for editing the information and i want the visible checkbox is checked if in the database it is visible or not checked in the checkbox if it is invisible but not working help me guys
    <div>
    <span class="label">Visible:</span>
    <input type="checkbox" name="visible"
    <c:if test="${ad.visible}">value="checked" </c:if>>
    </div>

    http://www.w3schools.com/tags/tag_input.asp
      <input type="checkbox" name="visible"
        <c:if test="${ad.visible}">checked="checked" </c:if>>

  • Hw can i get arabic support in oracleAS using jstl: showing '?????' symbols

    Hello All,
    I am using OracleAS for portal deployment and portlets UI constructed by using jstl.
    i have used spring portlet jstl for the jsp pages.
    when i am trying to change the language, it is showing '?????' symbols.
    I have used correct unicode. i tested in pluto portal server. when i deployed in oracleAS,
    for english not a problem. for arabic it is showing as '????'.
    i have used this code to get arabic in pluto. same code i used. i am getting error.
    <c:set target="${pageContext.response}" property="characterEncoding" value="UTF-8" />
    <fmt:setLocale value="ar" />
    <fmt:requestEncoding value="UTF-8" />
    i know it is not setting charector encoding.
    i tried some other too like:
    <head>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    </head>
    and
    <%@ page pageEncoding="UTF-8" %>
    No improvement. please help me out of this.
    how can i get arabic support in oracle AS by using jstl?
    Thanks,
    Arun

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • Is there a logic:match equivalent for JSTL?

    In a search page I execute a query which returns an array of objects (All objects are of the same object type and are cast to Object[]) and each object has many attributes. I tried using <logic:iterate>, but I was never successful in having it display any results. I believe this had something to do with the entire array being passed via session scope instead of just one record and me not specifying it properly with <logic:iterate>. I was able to successfully use <c:forEach> and it worked right away. I stuck with using that because of its "just works" ability in addition to using a lot of other JSTL code. However, one of the attributes that is being printed out needs to be parsed and is of the form "Yxxx". <logic:match> covers this very nicely, but when I specify it in the below code it is not able to find my variable in any scope.
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match parameter='${myResults}' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>I have done several google searches, but I haven't found a JSTL equivalent for <logic:match>. If there is one could someone please tell me what it is? In addition, although <logic:match> is great I still need to print out a substring of that attribute. Could someone tell me how to do that? If this is not possible could someone please tell me if its possible to use <logic:iterate> with an array of objects like I was attempting to do initially so that I could use <logic:match> at least?
    Thanks to all of you for your time.

    Yes you can use the logic:iterate tag. I think you have to specify the type of the exposed variable though. I prefer the forEach loop.
    I think you are using the wrong attribute in the logic:match tag. You should be using the "name" attribute rather than "parameter"
    Parameter attribute refers you to a request parameter, and I pretty sure you don't want that.
    So given the collection of objects in the session attribute "result"
    This should loop through them all, and see if they start with the letter 'Y'
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
        <logic:match name='myResults' property='pin' value='Y'>
            <c:out value="Preeti"/>
        </logic:match>
    </c:forEach>As for the latter bit, are you using a JSP2 container and JSTL1.1? It would appear so seeing as you are trying to use EL expressions in the logic:match tag.
    If so, you could make use of the JSTL function library:
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
       <c:if test='${fn:startsWith(myResults.pin, "Y")}'>
          <c:out value="${fn:substring(myResults.pin, 1, -1)}"/>
        </c:if>
    </c:forEach>And I've just spotted a very cool function in there: substringAfter
    <c:forEach var="myResults" items="${sessionScope.result}" varStatus="status">
          <c:out value='${fn:substringAfter(myResults.pin, 'Y')}'/>
    </c:forEach>Cheers,
    evnafets

  • Using HashMap's ContainsKey() in JSTL

    Can we use HashMap's containsKey() in JSTL <c:if > statement
    I tried with the sample
    <html:select property="Type" multiple = "true" size = "3">
    <option value='<c:out value="${key}"/>'
    <c:if test="${requestScope.test.containsKey(key)}">
    selected
    </c:if>     
    <c:out value="${value}"/></option>
    </html:select >
    When i executed the above code i encountered JSP Error
    Can any one please let me know the correct code

    You can't call java methods from JSTL. It uses the EL - not java.
    However there is a solution.
    You access maps using the square brackets [ ] notation.
    ie ${test[key]}
    is the same as test.get(key)
    try
    <c:if test="${ not empty test[key] }"/>
    However seeing as you are using the struts tags, doesn't that automatically take care of this for you? Why don't you use the struts tags for the options list as well as the select? Just a thought :-)
    Cheers,
    evnafets

  • Two if condition in JSTL

    can I use and in if statement in JSTL, I f I want to change the following code to JSTL , what should I do
    if (!(Tassistant.equals("on"))&&         (!TassistantStart.equals("dd/mm/yyyy"))&&         (!TassistantUntill.equals("dd/mm/yyyy")))
    do I have to use ? can I use and to connection then I don't need that much close </c:if>
    <c:if test="${found.tassistant!='on'}"> }<c:if test="${found.tassistant!='dd/mm/yyyy'}"> </c:if>               </c:if>
    Thnak you!

    You can just use the same operators in EL.
    And in the future, please choose forum carefully. Posting a very simple question at a wrong forum doesn't let you overcome as smart.

  • Help needed to run JSTL 1.1 in Tomcat 6.0.16

    Hi All,Help needed to run JSTL 1.1 in Tomcat 6.0.16. I am trying to run the example given in http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html The example tries to connect to MySQL database from JSP using JSTL and JNDI Datasource.I am running the example using Eclipse 3.4.2 using Sysdeo plugin to start and stop Tomcat server from Eclipse IDE.
    My web.xml file has <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    </web-app>
    and test.jsp has proper taglib directives
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    I have placed the jstl.jar and standard.jarof the jakarta-taglibs-standard-1.1.2.zip under E:\Deepa\workspace\DBTest\WebContent\WEB-INF\lib directory also placedcontext.xml file under E:\Deepa\workspace\DBTest\WebContent\META-INF and the content of context.xml is as below
    <Context path="/DBTest" docBase="DBTest"
    debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
    </Context>
    Now while running the example, Eclipse creates one DBTest.xml file under C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost
    which has the following line:
    <Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest" workDir="E:\Deepa\workspace\DBTest\work" />
    I am getting the following error when running http://localhost/DBTest/WebContent/test.jsp
    in Browser:
    <HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:494)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    In the Tomcat Server console, I am getting the following error:
    INFO: Server startup in 7295 ms
    May 20, 2009 6:36:48 AM org.apache.jasper.compiler.TldLocationsCache processWebDotXml
    WARNING: Internal Error: File /WEB-INF/web.xml not found
    May 20, 2009 6:36:48 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application
    what is the problem with my code?
    When running the same example, by creating a local server in Eclipse(creating new Server connection pointing to same Tomcat 6.0 installation) it runs fine without any error.

    Hi evnafets,
    Wow, very helpful information, great insight into working of Eclipse. Thanks a lot.
    I have one more question. I have a context.xml file under {color:#0000ff}E:\Deepa\workspace\DBTest\WebContent\META-INF{color} folder and that has the Resource element to connect to MySQL database:
    {code{color:#000000}}{color}<Context path="/DBTest" docBase="DBTest" debug="5" reloadable="true" crossContext="true">
    <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="deepa" password="mysql" driverClassName="com.mysql.jdbc.Driver"
    {color:#0000ff}url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>{color}
    {color:#0000ff}</Context>{color}As usual when running application in local Tomcat server of Eclipse, this data source works fine. But when I run the application on Tomcat, by starting Sysdeo plugin from Eclipse, the DBTest.xml file created in C:\Tomcat 6.0\conf\Catalina\localhost has the context entry as<Context path="/DBTest" reloadable="true" docBase="E:\Deepa\workspace\DBTest\WebContent" workDir="E:\Deepa\workspace\DBTest\work">
    </Context>The<Resource> element I have specified in the context.xml of \WebContent\META-INF folder is not taken into account by Tomcat and it gives the following error:May 21, 2009 5:20:04 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException_: Cannot create JDBC driver of class '' for connect URL 'null'"
    _at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(_QueryTagSupport.java:276_)
    at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(_QueryTagSupport.java:159_)
    at org.apache.jsp.test_jsp._jspx_meth_sql_005fquery_005f0(_test_jsp.java:113_)
    at org.apache.jsp.test_jsp._jspService(_test_jsp.java:66_)
    at org.apache.jasper.runtime.HttpJspBase.service(_HttpJspBase.java:70_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.jasper.servlet.JspServletWrapper.service(_JspServletWrapper.java:374_)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(_JspServlet.java:342_)
    at org.apache.jasper.servlet.JspServlet.service(_JspServlet.java:267_)
    at javax.servlet.http.HttpServlet.service(_HttpServlet.java:717_)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:290_)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:206_)
    at org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:233_)
    at org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.java:191_)
    at org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.java:128_)
    at org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.java:102_)
    at org.apache.catalina.core.StandardEngineValve.invoke(_StandardEngineValve.java:109_)
    at org.apache.catalina.connector.CoyoteAdapter.service(_CoyoteAdapter.java:286_)
    at org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:845_)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(_Http11Protocol.java:583_)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(_JIoEndpoint.java:447_)
    at java.lang.Thread.run(_Thread.java:619_)
    {code}
    So to overcome this error I had to place the <Resource> element in DBTest.xml under C:\Tomcat 6.0\conf\Catalina\localhost {color:#000000}and then it works fine. {color}{color:#ff0000}*Why is the context.xml file in META-INF not considered by Tomcat server using Sysdeo Plugin?*
    *Thanks,*
    *Deepa*{color}
    {color}
    Edited by: Deepa76 on May 26, 2009 9:32 PM

Maybe you are looking for

  • Error generating while adding PO through DI

    Hi All, I got an error while creating Purchase Order through DI API by taking an Excisable Item and non-excisable Whs and non CENVAT TAX The error is  ' There are Excisable Item(s) with non-CENVAT tax code' But if we are creating PO as same through U

  • Referencing a custom component file as a parameter in PopUpManager.createPopUp()

    Hello ! I'm trying to open a custom mxml file in a popUp window. The custom TitleWindow component (myPopUpComponent.mxml) is located in a folder "view" which is located aside my main file. When I try to compile the following line (in the main file),

  • SSRS 2012 Session Expired Error..

    We have reporting environment with SSRS 2012 configured with forms authentication- When users taking reports we are getting following errors randomly. We increased the valued of Query Timeout and Session Timeout in WebConfig. But still the error is p

  • HT201263 i did this however it says error every time i restore my iphone...

    Whenever i try and restore and update my iphone it says error. so my iphone is stuck on the black screen with the itunes sign on it.. help me please!!

  • Hanging on boot after upgrading server.app

    After upgrading to 10.9 Server.App my boot hangs at "/etc/rc.server: line 14: /etc/rc.server.firewall: No such file or directory" and won't boot into safe mode either. Anyone know how I can fix this without restoring from a backup?