Jakarta taglibs
hi all,
Is it true that by using the jakarta i18n taglibs, the properties files are preloded into the memory. How exactly do they work.
Is the working different from using
ResourceBundle.getBundle().
please help
thanka in advance
Yes, it is perloaded in memory, That is why when you make some changes in property file then you have to restart the application
Similar Messages
-
Integrating Jakarta taglibs in Jdev 9.0.4 (other than JSTL)
Hello --
I'm having difficulty getting the magic spell for proper integration of Jakarta taglibs other than the JSTL taglibs to work.
I've gone into Tools->Manage Libraries->Jsp Libraries and created a new Jsp library based on the .tld file / archive file / and uri, and assigned a prefix, but I can't use it.
If I create a workspace from a WAR for something like 'application-examples.war' from the Jakarta site, when I try and compile the example page, I get a "Attribute 'xmlns:xalan' is used but not declared."
and Jdev is unable to load the taghandler class.
Has anyone had any luck getting these taglibs to integrate properly?
Thanks,
DonnOk, now I'm going nuts. I can't get JSTL working either -- have tried with the <taglib> directive in web.xml, and without, have tried with registering the libraries in the JSP tab and not registering, and with the .tld files in the lib directory and not.
Any successes out there? -
What is the condition of the jakarta taglibs project?
I have downloaded the most recent build of the jakarta taglib and have
found more bugs than I expected. Is this application in bad condition
or am I missing something?
Thanks
Main purpose is data persistence. If you don't need that, then EJB isn't that important.
-
Hi all,
I'm working on a JSF 1.2 project and need some functionality that I have found in a project called "jakarta taglibs IO": http://jakarta.apache.org/taglibs/doc/io-doc/intro.html
I did however notice that the download links aren't working anymore and the project is marked as deprecated.
Can anyone help me where to get this taglib or otherwise if there is an alternative for its functionality?
Thank you,
StevenThanks for the help.
The problem I must solve is a pain in the ass for quite a while now. Basically what we have is under tomcat 2 web applications, a dynamic and a static one (for the images and static html files).
What I am trying to do is to include a static html file from the static context into a jsp file in the dynamic context. I have failed to do that by jsp:include and it also didn't work out properly with <%@ include file="" %>.
Any ideas? -
I am currently downloading everything I need to know to learn JSP. I came across jakarta taglibs which also mentions jstl. They are in the sameplace everywhere. Are these two technologies the same or different? Do they work on all web containers?
JSTL is the standard.
The Jakarta taglibs build on JSTL and go above and beyond.
These taglibs should work in all servlet/JSP engines that support the 2.3/1.2 servlet/JSP standards.
You have to be a bit careful, because the 1.0 JSTL only works with Tomcat 4.0.x. The 1.1 JSTL is intended for Tomcat 5.x.
% -
Jakarta taglibs and iWS4.1
Is it possible to use the Jakarta custom tag libraries with iWS4.1 SP11?
I am able to make the custom tag samples work (http://docs.sun.com/source/816-5680-10/2-examp.htm#21044). But I can't figure out how to plug in the pre-built custom tag libraries from Jakarta.
My goal is to use XSLT to dynamically display XML documents. It runs on Tomcat, but it needs to run on iWS4.1
Any input is greatly appreciated.
ThanksThis is not an Apache site. It is not even the Oracle JSP forum.
I suggest you try the JDeveloper site, which you will find JDeveloper and ADF, where at least they all speak Java. There is also the J2EE forum, although that seems somewhat less OC4J. And of course there is a designated Java Server Pages (JSP).
Cheers, APC -
How to have dynamic parameters with nonstandard taglib with JSTL
Hello, I am using webwork 2.2.7, tomcat 4.1 (I have a java 1.4 requirement unfortunately), and jakarta-taglibs-standard-1.0.6 and some nonstandard taglibs and need to pass dynamic parameters to the nonstandard taglibs.
I can see that the standard taglibs handle the ${foo} syntax for attributes but the nonstandard taglib is just getting set with "${foo}". I really need to set attributes of the nonstandard taglib with dynamic parameters. Is there some combination of c:set and the <%= syntax that can work?
I have tried the following which does not work:
<input:selectBox options="${accounts}"/> <!-- the nonstandard taglib just has the options property set as the literal string "${accounts}" -->
I was thinking something like the following might work but it doesn't
<c:set var="accounts" value="${accounts}"/> <!-- the core taglibs can deal with ${accounts} appropriately -->
<input:selectBox options="<%=accounts=%>"/>
I don't care how but I need to somehow access ${accounts} and set that Collection as an attribute of the taglib. Can anyone please help me solve this problem? Thank you very much.
This is related to this thread: http://forums.sun.com/thread.jspa?threadID=5389311&tstart=0
Joe.Discussion continued in [the original thread|http://forums.sun.com/thread.jspa?threadID=5389311&tstart=0].
May as well keep it all together. -
Extending functionality from existing custom taglib
Hi!
I'm trying to extend the functionality of an already existing custom taglib. To test this possibility I�ve so far created a small taglib containing two tags. QbeTag.java and QbeSumTag.java.
The QbeTag class handles a database connection and constructs a table showing the result of a query passed in as an attribute in the tag. (The database contains a �dummy table� holding information about persons.)
Now let�s pretend that I don�t have the source code for the QbeTag but need to/ want to extend its functionality. For instance:
In the QbeSumTag I want to summarize all the persons ages and present it in a new text field somewhere else on the page.
To do this I probably need to access the QbeTag class from the QbeSumTag class, or is there any other way to achieve this wanted functionality?
Up to this point:
What I�ve tried is to implement the QbeSumTag so that It extends the QbeTag class. This means that I now can access the doStartTag, doEndTag, and so on methods from the QbeSumTag by typing super.doStartTag().
The problem with this approach is that this way only gives me the possibility to run the methods not altering the process it self and I can�t alter the out stream. A syntax like:
public int doStartTag() throws JspException
return super.doStartTag();
Will only result in a call for the QbeTag�s doStartTag() method to run and do it�s stuff.
Is there any way I can solve this or am I stuck? Maybe one approach would be to nest the QbeSumTag with the QbeTag wich would mean that there will be a dependency between the tow tags.
I believe that this question is quite difficult to answer but it could be the starting point for an interesting discussion. Hasn�t anyone tried to extend the functionality of the Jakarta taglib, say the DB tags or Mail tag.
All thoughts and replies will great fully received.
/DanielWell, the answer to this is the same as the answer to extending any third party classes... it depends on how the original class was created.
If the original class was designed with extension in mind, then (hopefully) its realy functionality will be isolated to a series of protected methods (that you would have access to) and private methods (you would not have access to).
You would use the public and protected methods to retrieve the data you need to do your work, or override those ones whose work you want to replace (for instance, if it has a protected displayOutput(Map dataMap) method, you are in luck!).
If everything is done giving you know access to the pieces, then you may be stuck providing a tag that has the original tag nested inside it. Buffer the output from the original tag and parse it, retrieving the info you need, then output your own stuff... -
I am running Tomcat 4.1.30 and am trying to use the JSTL jakarta taglibs standard 1.0.6 download.
I placed my jars in the WEB-INF/lib folder. My application runs but I get this error:
JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml
or the jar files deployed with this applicationI looked at the dtd'd and in my tld's it has this:
<?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>c</short-name>
<uri>http://java.sun.com/jstl/core</uri>
<display-name>JSTL core</display-name>
<description>JSTL 1.0 core library</description>But in my context.xml I have the dtd of :
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">and in web.xml:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/dtd/web-app_2_2.dtd">and finally here are my uri's from my jsp page:
<?xml version="1.0" encoding="ISO-8859-1"?>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> When I try to change the web/context.xml dtd's to match what is in the tld's my application wont
run at all. So, I guess my question is - am I using the wrong JSTL download or the wrong dtd
in my XML's?
Also, could someone tell me or point me in the direction of documentation about the backwards compatiability of JSTL with Tomcat 4/5?fixed - onto bigger and bigger problems.... I had two description tags in my web.xml..
-
Newbie Jakarta JSTL not working.
Hi all,
I think this is the right place for asking questions on Jakarta JSTL Standard 1.0 tag libraries. I downloaded this file from Jakarta site - jakarta-taglibs-20030908.zip. Deployed the standard-doc.war in Tomcat 4.1.27. Run the demo standard-examples/elsupport/Out.jsp -General-Purpose Tags Examples - and it is giving the error message in browser window.
This absolute uri (http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
Is it necessary to add the tld declaration in web.xml ?.
Then I added the tld declaration in web.xml
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
JSP page refers to it as
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
restarted Tomcat and it gives the same error message.
What is wrong. I looked at the c.tld. It have the following uri at the top
<uri>http://java.sun.com/jstl/core</uri>
So I changed the uri in web.xml and JSP to this.
It still gives the error message.
This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
On looking at the WEB-INF directory I found that there is one c-rt.tld. Do I have to add this in web.xml ?.
Why the sample application not containing the taglib declaration in web.xml ?
rgds
Antony PaulFirst, you don't need to put anything in web.xml. Nothing, not a single change. DON'T CHANGE web.xml. OK?
Compare those two URIs
http://java.sun.com/jsp/jstl/core
http://java.sun.com/jstl/core
see the difference?
The URI including "jsp" is the "new" one for version 1.1 (which shifts JSTL under the jsp spec)
I think you may have picked up one of the nightly builds. Probably they have modified their examples to work with the new version of JSTL.
Anyway, try this page:
http://jakarta.apache.org/site/binindex.cgi#Release%20Builds
Go down to taglibs, and then click on the link for standard-1.0
The file should be something like jakarta-taglibs-standard-current.zip
Oh yeah - and the c-rt.tld is an alternative tag library that uses standard JSP runtime expressions rather than the EL. They recommend to use the EL versions.
Good luck,
evnafets -
I cannot get any TAGLIBS to work
I cannot get any taglib to work on my install of TOMCAT 4.0.1. I have even downloaded WAR files that from the jakarta taglibs project for their examples and they fail as well. Can anyone help me? I am receiving the following error:
org.apache.jasper.JasperException: This absolute uri (http://jakarta.apache.org/taglibs/dbtags) cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:194)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1159)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:755)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:243)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1133)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1091)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1087)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Unknown Source)to wainstead ( I saw your post at the JTL forum, who knows when the authors will be around)
I tried using the <taglib-uri> and it works for me(I am using Tomcat 4.0).
In fact I can use just http://www.man as long as it matchs what I put in the uri attribute of the taglib directive of my JSP.
But the situation is confusing because according to the Servlet2.3 specification
"taglib-uri element describes a URI relative to the location of the web.xml document,
identifing a Tag Library used in the Web Application." Perhaps someone with more experience
can explain. -
Taglibs to get HTML fragment ?
Hello all,
I'm looking for a Taglibs that will allow me to get some HTML pages located on another web server.
I would like to use like this :
<x:request host="http://www.myserver.com/fragment1.html">
I tried the Jakarta Taglibs but I didn't found a component.
Thanks.Does it have to be a taglib, because the code snipet like this would work.
<%
URL url1 = new URL("http://www.myserver.com/fragment1.html");
BufferedReader urlReader = new BufferedReader(new InputStreamReader(url1.getInputStream()));
String line;
while( (line = urlReader.readLine()) != null)
out.print(line);
%>and if you wanted to you could extract that code into a class and do something like this
<%= myURLReader.read("http://www.myserver.com/fragment1.html")%> -
Hi,
I just downloaded the jakarta taglibrary and I was wondering how I can start using it?
The C:\jakarta-taglibs-20040130\jakarta-taglibs folder has many subfolders like application, standard, srape,repsponse etc etc....
I am familiar with tablibraries in theory but I doono how ot implement it... can someone guide me?Looks like you have downloaded the entire taglib bundle.
Each of the subfolders has a different taglibrary in it. You probably won't want to use them all.
There are WAR files for documentation and examples in the directories - you can deploy them to your server, (for Tomcat, just dump the WAR in the webbapps directory) and read them - thats a good start.
I think the main one of interest is the implementation of JSTL.
This is in the subfolder "standard", or "standard-1.0"
If you have Tomcat 5 (ie a JSP2.0 container) use "standard"
If you only have a JSP1.2 container (Tomcat4, JRun4...) then you should use "standard-1.0"
Only concentrate on those directories - forget the rest for now.
Read the readme file.
To install the JSTL you need to
1 - copy the standard.jar and jstl.jar jar files to your web-inf/lib directory
2 - put a taglib tag at the top of your page (check the readme for exact syntax)
3 - THATS IT! You're ready for use.
4 - I said thats it. No tld files. No entries in web.xml. Just the jar files. OK?
Hope this helps.
evnafets -
Standard.jar taglib is malformed
Hi
I have the following warnings on the console.
I have bea weblogic 8.1 SP6
The application works perfect, but I keep getting this warnings.
Is there a way to fix this? or at least to hide only these warnings?
Thanks
Daniel
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/fn.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 17).>
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\webdesktop_taglib-1.0.jar!/META-INF/webdesktopTag.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 3, column 81).>
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/x.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 19).>
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/permittedTaglibs.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 19).>
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/c.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 19).>
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/sql.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 19).>
####<Dec 4, 2007 10:19:42 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/scriptfree.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 19).>
####<Dec 4, 2007 10:19:43 AM EST> <Warning> <HTTP> <DV2KATUS03> <ATUS01sp4> <main> <<WLS Kernel>> <> <BEA-101248> <[ServletContext(id=11572001,name=webdesktop,context-path=/)]: Deployment descriptor "jar:file:E:\public\AppServer\ATUSDEVsp4\ATUS01sp4\.wlnotdelete\extract\ATUS01sp4_webdesktop_webdesktop\jarfiles\WEB-INF\lib\standard-1.1.2.jar!/standard-1.1.2/META-INF/fmt.tld" is malformed. Check against the DTD: cvc-elt.1: Cannot find the declaration of element 'taglib'. (line 6, column 19).>
-------------------------------------------------------------------------------------There is no way to hide these warnings. The main reason with these warnings is that standard-1.1.2.jar is based on JSP 2.0 where as WLS 8.1 SP6 does not support JSP 2.0, but only JSP 1.2. Please check http://e-docs.bea.com/wls/docs81/notes/new.html#1184292.
In order to resolve the issue, either you need to use JSTL supported with JSP 1.2 or need to upgrade to WLS versions 9.x or higher.
Please check http://java.sun.com/products/jsp/jstl/, which states
JSTL 1.1 Specification Maintenance Release This release builds on JSTL 1.0, adding a function library and requiring a Web container that supports JSP 2.0.
Jakarta TagLibs Project also states that JSTL 1.1 requires a JSP container that supports JSP 2.0 Specifications. Please see http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html. -
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
-
My Hot Spot does not work after update to 6.0.1. Any suggestions?
-
How do I find the autofill password that is stored on my mac?
how do I find the autofill password that is stored on my mac?
-
Itunes 10.6.1 (7) shows right artwork, ipod does not
This is frustrating me to an unbelieveable degree.... I have a lot of songs on my ipod classic. I am a DJ and certainly love to be able to load as much music as I want on there, however, recently (2-3 weeks ago) I added some new songs on there. When
-
Elements 9's PhotoMerge crashes with Mac OS 10.9.2
In attempting to use any sort of PhotoMerge functions in PS Elements 9 on my Mac results in the program immediately crashing, regardless of what I attempt to do. I have successfully used PhotoMerge, but never had this happen before -- until now, afte
-
Consume Odata Service in Eclipse HTML5
Hi Experts, I am trying to consume SAP Odata service. But i was stuck in one problem. While creating my model object i got following message. This code i have written in the index.html file. var oModel = new sap.ui.model.odata.ODataModel("https: