[ANN] Standard Taglib 1.1.2
Hi everyone, The Jakarta Taglibs Team is proud to announce the release of Standard 1.1.2, an implementation of JSTL 1.1. This is minor bug fix releases. For all the changes since last release, please see the Release Notes. With JSTL, page authors can create dynamic web pages more easily. JSTL encapsulates the core functionality common to many Web applications. It has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. Standard 1.1.2 is available for download through the Taglibs Downloads area. Taglibs Downloads: http://jakarta.apache.org/site/binindex.cgi Standard 1.1.2: Release Notes: http://jakarta.apache.org/taglibs/doc/standard-doc/ReleaseNotes.html Project Page: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Jakarta Taglibs Project Page: http://jakarta.apache.org/taglibs Thanks, Justyna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using Node variables with JSTL XML tags
Hi Flavio, I've seen the discussion on the list related to the XPath integration. I agree the implementation is rather messy. I'm going to evaluate the fix, verify it, and if everything works apply it to the JSTL workspace. Thanks, Justyna Flavio Tordini wrote: hi Kris, I think Xalan does the right thing evaluating nodes = XPathAPI.selectNodeList(node, /@name); starting from the document root. The real problem is not being able to make *relative* XPath queries (without the starting slash). This seems to be a major flaw in the JSTL spec. Since node variables set with x:set (obviously) work, I looked at the Jakarta impl sources to discover how x:set does the job. Basically it's a big *hack*: - x:set evaluates the XPath expression with Xalan the wraps the Nodelist result into a org.apache.taglibs.standard.tag.common.xml.JSTLNodeList class. - when x:out evaluates the XPath expression it checks for the $variable type: - if it is a JSTLNodeList containing 1 element of type org.w3c.dom.Node, it creates a new Document, imports the Node and then (here comes the hack) it prepends /* to the user specified XPath: xpath=/* + xpath; (org.apache.taglibs.standard.tag.common.xml.XPathUtil line 683) - if the $variable is a org.w3.dom.Node it is used as it is as the XPath Context as expected. why this different treatment? obviously because of the Xalan behaviour that Kris explained. I think the same hack should be applied to Node variables so they work just like the impl-specific JSTLNodeList. Any ideas? Any chance to let the developers know? They don't seem to be on this list at all... flavio Kris Schneider wrote: It seems like an issue with Xalan's XPath implementation. The Standard 1.1 taglib uses Xalan while Standard 1.0 uses Jaxen/SAXPath. Here's an example app that mimics what it sounds like Flavio is trying to do: import java.io.*; import javax.xml.parsers.*; import org.apache.xpath.*; import org.w3c.dom.*; import org.xml.sax.*; public class XPathNode { private static final String XML = root name=\root\child name=\child\grandchild name=\grandchild\/grandchild/child/root; public static void main(String[] args) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(new InputSource(new StringReader(XML))); Element root = doc.getDocumentElement(); Node node = root.getFirstChild(); NodeList nodes = null; nodes = XPathAPI.selectNodeList(doc, /root/child/@name); printNodes(nodes); nodes = XPathAPI.selectNodeList(node, /@name); printNodes(nodes); nodes = XPathAPI.selectNodeList(node, ./@name); printNodes(nodes); } public static void printNodes(NodeList nodes) { System.out.println(nodes:); for (int i = 0, n = nodes.getLength(); i n; i++) { Node node = nodes.item(i); System.out.println(\t + node); } } } Which results in: nodes: name=child nodes: nodes: name=child Notice that for the XPath evaluation to work with node, I had to prepend . to the expression. I'm not sure if it's possible to construct something similar with the select attribute of JSTL's x tags... Quoting Johnson, Chris [EMAIL PROTECTED]: I see. I ran across a similar problem with JDOM Xpath, although they solved it in a newer version, but totally screwed up the API and some other stuff, so it killed the fix for me. I had performance problems with the xml jstl tags (forEach), so I've since moved on to using xslt. They're clearly not in a big hurry to fix these (what we would consider big) problems. Chris -Original Message- From: Flavio Tordini [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 10:36 AM To: Tag Libraries Users List Subject: Re: using Node variables with JSTL XML tags hi chris, thank you for your answer. The problem is i'm actually passing a *Node* to the tag, not a Document. So I'd like to evaluate the XPath starting from that Node, not from the root of the Document the Node belongs to. I also tried: x:forEach select=$node x:out select=@name/ /x:forEach and it works. But it's kind of a hack. I'm not searching for a workaround, I need a clean solution since i'm working on a project that aims to simplify JSP development with the aid of the JSTL + plus a custom Servlet, and I cannot expect people to use this forEach hack. flavio Johnson, Chris wrote: It seems that what 1.1 is doing is more correct. How do you expect jstl to find your sub node without telling it how to get there? That's how it works in directories on a computer (unix or pc). The only way that I know of to go to a subnode without providing the full path is by using the // operator, like: select=$doc//subnode. Otherwise, the only way (that I know of) to cd to a subnode, and therefore not have to give the full path is by
Re: org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
Hi Fanguang, It looks like some modification that the Landover developers made broke the way the container handles TLD's. I would tell the developers from Landover the problems that you are running into and give them the standard-examples.war file. Ask them to make sure that this file deploys and the examples can be run successfully in their modified container. Tomcat 4.x has a minimum requirement of JDK 1.2 so you should be ok with using that JDK. You have tested this out already when you successfuly deployed the JSTL examples in your local copy of the Tomcat 4.1.30 container. Thanks, Justyna Fanguang Meng wrote: Justyna: The Tomcat 4.1.24 we got here is a package that was delivered to us and all sites to keep us similar. In a way it came from Apache, but the developers from Landover got it first, made their modifications and configuration and then delivered to us. I have to work within our baseline constraints on this one, sorry about that. I downloaded the Tomcat 4.1.30 to PC and tried that standard-examples and works fine. What do you think? Maybe some configuration of Tomcat didn't work? We are using java version 1.2.2 Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit) Does this matter? Thanks very much. Fanguang Meng Justyna Horwat [EMAIL PROTECTED]To: Tag Libraries Users List [EMAIL PROTECTED] un.COM cc: Subject: Re: org.apache.jasper.JasperException: This absolute uri 08/03/2004 11:26 (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files AMdeployed with this application Please respond to Tag Libraries Users List Are you running a vanilla install of Tomcat 4.1.24 that you downloaded from Apache or is it customized/part of a bundle? What's odd is when I told you to place your jar files in the WEB-INF/lib directory then the web application classloader will load those classes and parse TLD's. It overrides the bootstrap, system, common, and shared classloaders. You shouldn't be getting this error. You can also make your classes available across all your web applications using classloaders other than the web application but you will not get your TLD's parsed. Here is a document that gives a Tomcat 4.1.x classloading overview: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html Check with your sysadmin and ask where they got their Tomcat installation. Another thing to try is download Tomcat 4.1.30 from Apache yourself and deploy the samples web application as well as your own application. Thanks, Justyna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta taglib problem
You might be running into a conflict with two different xerces implementations. The JSTL 1.0.6 binary distribution comes bundled with one version and the container has another. Try removing the old implementation that's in your container and restarting. The container's files are located in this directory: TOMCAT_HOME/common/endorsed/ - xercesImpl.jar - xmlParserAPIs.jar Thanks, Justyna Keith Westcott wrote: I have just installed jakarta-taglibs-standard-1.0.6 and only get the following error when I try to use it or run any of the examples which came with it: javax.servlet.ServletException: fRecognizedFeatures root cause java.lang.NoSuchFieldError: fRecognizedFeatures at org.apache.xerces.parsers.XML11Configuration.(Unknown Source) I am running jakarta-tomcat-4.1.10 on solaris. Explanation and help would be much appreciated. Best wishes Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:466) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:585) at java.lang.Thread.run(Thread.java:536) Fanguang Meng Justyna Horwat [EMAIL PROTECTED]To: Tag Libraries Users List [EMAIL PROTECTED] un.COM cc: Subject: Re: org.apache.jasper.JasperException: This absolute uri 08/02/2004 05:43 (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files PMdeployed with this application Please respond to Tag Libraries Users List Are you able to successfully deploy and run the JSTL examples war file in your container? Thanks, Justyna Fanguang Meng wrote: Thanks for your reply. You were right, that's 4.1.24. I did remove those taglib from web.xml and also c.tld from WEB-INF/ and did not work either. I just put a very simple code there,like this [EMAIL PROTECTED] contentType=text/html% %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % html body c:set var=xx value=23/ c:out value=${xx}/ /body /html Same problem. Do you think there is some setting which is not right. I check the log file, 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploying class repositories to work directory /data1/OPS/COTS/tomcat-4 .1.24_datapool/work/Standalone/localhost/DPC 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploy class files /WEB-INF/classes to /data1/OPS/COTS/tomcat-4.1.24_da tapool/webapps/DPC/WEB-INF/classes 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploy JAR /WEB-INF/lib/datapool.jar to /data1/OPS/COTS/tomcat-4.1.24_d atapool/webapps/DPC/WEB-INF/lib/datapool.jar 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploy JAR /WEB-INF/lib/jconn2.jar to /data1/OPS/COTS/tomcat-4.1.24_dat apool/webapps/DPC/WEB-INF/lib/jconn2.jar 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploy JAR /WEB-INF/lib/jstl.jar to /data1/OPS/COTS/tomcat-4.1.24_datap ool/webapps/DPC/WEB-INF/lib/jstl.jar 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploy JAR /WEB-INF/lib/listeners.jar to /data1/OPS/COTS/tomcat-4.1.24_ datapool/webapps/DPC/WEB-INF/lib/listeners.jar 2004-08-02 08:58:45 WebappLoader[/DPC]: Deploy JAR /WEB-INF/lib/standard.jar to /data1/OPS/COTS/tomcat-4.1.24_d atapool/webapps/DPC/WEB-INF/lib/standard.jar It did pick up standard.jar and jstl.jar. The following is the error: org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:105) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154) at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:159) at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795) at org.apache.jasper.compiler.Parser.parse(Parser.java:122) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473) at org.apache.jasper.servlet.JspServletWrapper.service
Re: org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
Tomcat 4.x does not have a 4.2.24 release. Perhaps you meant 4.1.24? Anyways the latest 4.x release is 4.1.30. With Tomcat 4.x you don't need to manually specify the tld's in your deployment descriptor if they are bundled in an included jar file. They should be loaded automatically from the standard.jar file where they are included in the META-INF directory. This jar file should be placed in your web application's WEB-INF/lib directory. Not sure why you are getting this error but I recommend letting the container parse the TLD's that are bundled in the standard.jar file and avoid specifying them manually. This way you have less to worry about and can avoid possible typos in your deployment descriptor and having to make sure your TLD's are in the right place. Also, there is a JSTL examples war file in your JSTL bundle. I recommend deploying that war file in your container and trying out the examples and making sure they work. Thanks, Justyna Fanguang Meng wrote: I have a project working well on PC JWSDP1.3, when I copied everything to UNIX, I got the following problem. org.apache.jasper.JasperException: This absolute uri( http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application I checked web.xml taglib taglib-urihttp://java.sun.com/jstl/core/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib is there. c.tld is under WEB-INF standard.jar and jstl.jar are under /WEB-INF/lib Tomcat version is 4.2.24 and JSTL version is 1.0. I also checked the c.tld in standard.jar file, it seems consistent. Everything looks just fine, I just don't know why. The problem happened because I have a line in a .jsp file %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % If I get rid of this line, it works but the c:tags. I searched through google.com and found lots of similar problems, but there solutions did not work for me. Is there anybody can help? Thanks. Fanguang Meng SAIC, EROS Data Center Sioux Falls, SD 57198 [EMAIL PROTECTED] (605)594-6880 (605)594-6940 Fax - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Standard Taglib 1.1.1 and 1.0.6 have been released
The Jakarta Taglibs Team is proud to announce the release of the Standard 1.1.1 (JSTL 1.1) and Standard 1.0.6 (JSTL 1.0) Taglibs. These are both minor bug fix releases. Taglibs Downloads: http://jakarta.apache.org/site/binindex.cgi Standard 1.1.1 (standard): Release Notes: http://jakarta.apache.org/taglibs/doc/standard-doc/ReleaseNotes.html Project Page: http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html Standard 1.0.6 (standard-1.0): Release Notes: http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/ReleaseNotes.html Project Page: http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/intro.html Jakarta Taglibs Project Page: http://jakarta.apache.org/taglibs Thanks, Justyna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New to tag libs - sax driver not specified??
Hi Bart, What is the J2SE version that you are using on Windows? The JSTL release comes with a pre-packaged examples war file that you can drop into your Tomcat webapps directory. It is called standard-examples.war. You don't need to do any custom packaging for the examples. Sounds like you've made many modifications to your environment. I would try downloading the 3 pieces that I mentioned and trying that setup out. It might be easier to do that than making further modifications on your current setup. I don't know what's going on in your environment exactly, but if you want to specifically address the exception that you are getting you can look at the following site: http://bobcat.webappcabaret.net/javachina/faq/xml_java_01.htm#jaxp_ps_Q14 Thanks, Justyna [EMAIL PROTECTED] wrote: Thanks for the reply. That is the setup that I thought I had put in place on a Win 2003 server box. When I tried to run some jstl examples from a book, most of them worked right away, so I thought that I was good to go. Then I tried the book's XML examples and found that none of them would work. At this point I have lost track of all the things that I have tried to get things working, but I know that I eventually found the jakarta-taglib 5/27 build and downloaded it. After placing the jar files and examples as best I could, I have all the jakarta examples working except the xml transform ones. Even the xml parser examples are working... So now I am baffled by the exception that I get (illustrated earlier), especially since the parser examples are working. I thought that the sax stuff had to be in place for the parser to work.?? Perhaps I need to start all over with this. Don't know what I messed up.. :-( -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 02, 2004 4:00 PM To: [EMAIL PROTECTED] Subject: Re: New to tag libs - sax driver not specified?? Hi Bart, Without knowing the details of your environment and particular setup, it's difficult to debug what is going on. I would recommend configuring your environment like one that has been tested and known to work. Consider the following combination a golden environment that is known to work: - JSTL 1.1.x release - Latest Tomcat 5.x release - J2SE 1.4.2 or higher If you are flexible with your environment, try this golden setup. You can find more information in the README file of the JSTL release. With J2SE 1.4.2 you don't need to worry about downloading a separate version of xalan or xerces and installing it on your system. I personally use the following: - JSTL 1.1.0 - Tomcat 5.0.19 - J2SE 1.4.2_03 Thanks, Justyna [EMAIL PROTECTED] wrote: Thanks, but that did not help (or hurt it seems).. Here is the exception dump: javax.servlet.ServletException: System property org.xml.sax.driver not specified org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCo nt extImpl.java:864) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCont ex tImpl.java:800) org.apache.jsp.xml.Transform_jsp._jspService(Transform_jsp.java:132) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper. ja va:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:30 1) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) Perhaps this makes sense to someone? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 02, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: Re: New to tag libs - sax driver not specified?? Grab Xalan: http://www.apache.org/dyn/closer.cgi/xml/xalan-j Install the following in $CATALINA_HOME/common/endorsed (create the endorsed dir if needed): xalan.jar xercesImpl.jar xml-apis.jar You should be good to go... Quoting [EMAIL PROTECTED]: Hi- JSP Newbie here.. I have what appears to be a setup problem. But after several googles on the subject, I am as lost as when I started.. I have installed TC 5 and the latest jakarta jstl download including the examples. Everything in the examples works fine, except for the xml transform examples (which are my main interest at this point of course). They give an exception stating that the sax driver is not specified. How do I specify this driver, please be specific.. TIA.. Bart Thompson Staff Software Engineer DST Innovis --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
Re: using JSTL with Sun ONE App Server 7
Hi Darrel, Unfortunately, SunOne AppServer 7 does not load TLD's from jar files bundled within the container and made available via the container classloader. By default JSTL is bundled this way. You will need to copy your JSTL jar file to your web application's WEB-INF/lib directory. This way the web application classloader will load the classes and perform the jar file TLD scanning. JSTL 1.0 was bundled with AppServer 7 so you can easily access it. You can find the jar location here: S1AS_HOME/lib/appserv-jstl.jar No you don't need a connection to http://java.sun.com/jstl/core; as specified in the URI. Think of the URI as a unique identifier string. You will use it in your taglib directive. By the way, the Java Systems Application Server 8 can be configured to scan bundled jar files for TLD's. You can specify the settings in your domain.xml, with the defaults including JSTL like so: jvm-options-Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar/jvm-options With JSAS 8 you wouldn't need to copy the JSTL jar file in your web application. You also would get JSP 2.0/Servlet 2.3 support. JSAS 8 is now available and free. Thanks, Justyna Darrell Esau wrote: Hello, I deleted inadvertenly deleted the message .. Dhiru Pandey recommended that I change the URI to the JSTL 1.0 spec. I did this, then redeployed.. unfortunately I'm still getting the same message (with the updated URI): [24/May/2004:16:01:11] SEVERE (10162): ApplicationDispatcher[/SampleApp] Servlet.service() for servlet jsp threw exception org.apache.jasper.compiler.CompileException: /jsp/SampleView.jsp(3,0) /jsp/fragments/stdstart.jspf(1,0) This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application One question -- does the app server actually need to make a connection to http://java.sun.com? (it cannot currently) -d On Monday 24 May 2004 3:22 pm, Darrell Esau wrote: Hello all, Please excuse if this is a duplicate message -- I'm quite new to JSTL .. I've been developing some JSP's using JSTL with NetBeans 3.6 (using the internal Tomcat 5 server). I just tried deploying my app onto a Sun ONE App Server (version 7) and found the following error: org.apache.jasper.compiler.CompileException: /jsp/SampleView.jsp(3,0) /jsp/fragments/stdstart.jspf(1,0) 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. I then realized that my dev app server (tomcat5) is J2EE 1.4, where Sun ONE App Server 7 is J2EE 1.3. How (if at all) can I use JSTL with Sun ONE App Server 7 (a J2EE 1.3 container)? I tried adding the standard.jar and the jstl.jar JAR files to the WEB-INF/lib directory, but still no go. Advice? Thanks, d - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [JSTL] How do I enter a null value with sql:param?
Derek, I forwarded your comments to the JDBC specification lead. He said that now is a good time to bring up all of these annoyances in the specification. He will look into clarifying this area in the upcoming version of the spec. Thanks, Justyna Derek Mahar wrote: After reading Section 17.7 of the JDBC specification (available at http://java.sun.com/products/jdbc/download.html), I now agree that there is a problem with the Microsoft SQL JDBC driver, but there is also a problem with the official Java JDBC API documentation that does not mention how PreparedStatement.setObject() handles the case PreparedStatement.setObject(index, null). I guess we should ask Sun to correct (or complete) its JDBC API documentation and I need to ask Microsoft to fix its JDBC driver. However, I still need to fix my problem now. So, as I have Standard Tag Library source code, but do not have the source of the Microsoft SQL Server JDBC driver, I will likely change the sql:param implementation so that it invokes PreparedStatement.setNull() when it receives a null value. Here is a perfect case where having source code is of tremendous benefit. Thank you for pointing me in the right direction and being patient with my posts as I worked through my problem. Derek -Original Message- From: Wolfgang Rckelein [mailto:[EMAIL PROTECTED] Sent: May 19, 2004 10:40 AM To: Tag Libraries Users List Subject: Re: [JSTL] How do I enter a null value with sql:param? Keith wrote: This was on the Users list and was my problem. But mine had to do specifically with the sql:dateParam and the Oracle JDBC driver. The regular sql:param worked fine for me when I passed it a null value. Link to the starting thread in the archive: http://www.mail-archive.com/[EMAIL PROTECTED]/msg06748.html Thanks for digging this out. Both problems boil down to the case that when setObject(index, null) is passed in a null value this should be converted by the driver to an SQL null does not work with the JDBC driver (perhaps only for certain data types, which could be the cause why you see it only with sql:dateParam). From my experience I know that the MS SQL JDBC driver has/had problems in this area... Regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTICE: This email contains privileged and confidential information and is intended only for the individual to whom it is addressed. If you are not the named addressee, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this transmission by mistake and delete this communication from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. AVIS: Le prsent courriel contient des renseignements de nature privilgie et confidentielle et nest destin qu' la personne qui il est adress. Si vous ntes pas le destinataire prvu, vous tes par les prsentes aviss que toute diffusion, distribution ou reproduction de cette communication est strictement interdite. Si vous avez reu ce courriel par erreur, veuillez en aviser immdiatement lexpditeur et le supprimer de votre systme. Notez que la transmission de courriel ne peut en aucun cas tre considr comme inviolable ou exempt derreur puisque les informations quil contient pourraient tre intercepts, corrompues, perdues, dtruites, arrives en retard ou incompltes ou contenir un virus. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: passing parameters to bean function???
With JSP 2.0 you can avoid scriptlets by defining a function that takes parameters. Here is some information that describes how functions work: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag.html Justyna John MccLain wrote: Here is something I have to be missing. I have a bean, and in my jstl page, I can set bean properties via the c:set tag and access the properties via the EL. syntax ${...}. This is all well and good, BUT how do I call a bean function that takes parameters without using a jsp scriptlet?? - My understanding is that the forces that be look down on %java java java% syntax embedded within html code. Is my understanding wrong or is there a tag that allows you to call a bean function that takes parameters?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with JSTL 1.0 and Weblogic 8.1 SP2
I don't know if this is related to your problem but JSTL 1.0.x binary release came bundled with a xalan and xerces implementation. Different implementations of the xml classes also exist in JDK 1.4.2 which maybe causing a conflict. The conflicts however don't typically occur on standard.jar. One thing to help you get to the bottom of your problem is to bundle the JSTL implementation jar's in your web application's WAR file. The container should pick them up there. If that works then you can move on to figuring out why the classes are not picked up from the APP-INF/lib directory by the container's classloader. Justyna Iñigo Serrano wrote: Hello I have a problem with JSTL 1.0 and Weblogic 8.1 SP2. I have put the libraries (standard.jar and jstl.jar) in the APP-INF/lib (it is obligatory to put all the libs here. Norms of the host provider...) of the EAR and in Windows2000 with JDK 1.4.1 it works but in Solaris 8 with JDK 1.4.2 it dosn´t work. The problem is that the weblogic dosn´t find the classes of the standard.jar (ClassNotFoundException). It is some problem with this configuration ? Is someone using this configuration and works ? Thanks in advance Iñigo --- http://isvalidator.sf.net __ Correo Yahoo! - 6MB, más protección contra el spam ¡Gratis! http://correo.yahoo.es - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: formatNumber tag
The formatNumber tag uses the DecimalFormat class pattern syntax. Not being familiar with the DecimalFormat class, I did some poking around and wrote a couple of variations to see how the number is formatted: DecimalFormat formatter = new DecimalFormat(); formatter.applyPattern(###-); String phoneNumber = formatter.format(5557176); System.out.println(phoneNumber); formatter.applyPattern(###'-'); phoneNumber = formatter.format(5557176); System.out.println(phoneNumber); formatter.applyPattern(###'/-'); phoneNumber = formatter.format(5557176); System.out.println(phoneNumber); formatter.applyPattern(###/-); phoneNumber = formatter.format(5557176); System.out.println(phoneNumber); This results in the following output: 5557176- 5557176- 5557176/- 5557176/- Looks like you can't use the minus sign as a separater according to the DecimalFromat pattern syntax. You can customize the separator using DecimalFormat as follows: DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setGroupingSeparator('-'); formatter = new DecimalFormat(###,, symbols); phoneNumber = formatter.format(5557176); System.out.println(phoneNumber); Which results in: 555-1716 The formatNumber tag does not have a mechanism where you can specify your own DecimalFormatSymbols with the separator you desire. You could write a tag handler that takes in a String and uses that as a separator for your String. Justyna Karl Coleman wrote: I tried and couldn't get it to work. I tried with #'s and zeros. I don't see anything in the DecimalFormat class API that would indicate why it doesn't work the way we expect it to. Karl -Original Message- From: Bharathi Balasubramanian [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 10:21 AM To: '[EMAIL PROTECTED]' Subject: fmt:formatNumber tag Hello there, I'm trying to use the fmt:formatNumber tag to format a phone number ... does anyone know how to do this? http://www.awprofessional.com/articles/article.asp?p=102219 http://www.awprofessional.com/articles/article.asp?p=102219seqNum=5 seqNum=5 fmt:formatNumber value=${calc.value1 + calc.value2} pattern=###,###/ The pattern indicates that there should be a comma after every three digits. It would also be legal to provide a decimal point, as in ###,###.##, which would indicate that a comma should be placed every three digits, with two digits following the decimal point. The example on this page suggests that this should work: fmt:formatNumber pattern=###- value=${phone.phoneNumber}/ But unfortunately that prints out: 2228014- Any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Date arithmetic in JSTL/Java
This is one simple way: jsp:useBean id=now class=java.util.GregorianCalendar/ % now.add(java.util.GregorianCalendar.DAY_OF_MONTH, 2); % fmt:formatDate value=${now.time} / Justyna Jack Lauman wrote: Is there a simple way to use the following line in a jsp page to get the current date and add 2 days to the value of ${now}? jsp:useBean id=now class=java.util.Date/ Thanks, Jack - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: More SQL Date problems
Hans, I looked into the SQL problem and consulted with the JDBC specification lead, Jonathan Bruce. Jonathan said that what JSTL is doing is correct: when setObject(index, null) is passed in a null value this should be converted by the driver to an SQL null. This behavior is in fact enforced as part of the J2EE compatibility in the CTS. The JDBC Driver Test Suite is publicly accessible and can be used to weed out the JDBC drivers that are not compatible. Thanks, Justyna Hans Bergsten wrote: Wolfgang Röckelein wrote: Hi, at JDBC level there are two different possibilities to set a parameter value to null: with setNull and setting to null. Depending on the driver sometimes only on of these methods work, and when it does not work, you see the java.sql.SQLException: Invalid column type error you see. I think this was already changed or discussed sometime during the standard taglib development. Right. I was looking at the code for JSTL in the CVS archive, and it calls setObject(index, null) when passed a null value, and there's a comment that this should be converted by the driver to an SQL null. Browsing through the JDBC JavaDocs and the JDBC spec, there seems to be some support for this claim, but it's not 100% clear. It's possible that the driver Keith is using doesn't handle it, and maybe it would be better if JSTL used setNull(). The reason it doesn't is that it would required additional type info for the sql:param case. Pierre, this may be something to look at again for JSTL.next. Keith, a work-around for this would be: fmt:parseDate value=${param.dob} var=parsed_dob pattern=dd-MM- / c:choose c:when test=${!empty parsed_dob} sql:update INSERT INTO resource_registry (resource_id, dob) VALUES (res_id_seq.NEXTVAL, ? ) sql:dateParam value=${parsed_dob} type=date/ /sql:update /c:when c:otherwise INSERT INTO resource_registry (resource_id) VALUES (res_id_seq.NEXTVAL) /sql:update /c:otherwise /c:choose If the real case involves many parameters that may be null, this gets ugly, but if it's just this one, it may be okay. Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: More SQL Date problems
Keith, That's why they have the compatibility tests to avoid the very problem that you are seeing with the Oracle driver. This is definitely a bug in Oracle's driver implementation that needs to be fixed. Justyna Keith wrote: So this is something in the Oracle JDBC driver that needs to be fixed? Just wondering whether I have to watch for a new JDBC driver or the next JSTL update to solve the problem. Right now I'm using a workaround similar to what Hans showed me and things are working fine. Just may be confusing for whoever may take over for me in the future if they don't know about the problem. Thanks! Keith -- Original Message --- From: Justyna Horwat [EMAIL PROTECTED] To: Tag Libraries Users List [EMAIL PROTECTED] Sent: Fri, 16 Apr 2004 09:54:13 -0700 Subject: Re: More SQL Date problems Hans, I looked into the SQL problem and consulted with the JDBC specification lead, Jonathan Bruce. Jonathan said that what JSTL is doing is correct: when setObject(index, null) is passed in a null value this should be converted by the driver to an SQL null. This behavior is in fact enforced as part of the J2EE compatibility in the CTS. The JDBC Driver Test Suite is publicly accessible and can be used to weed out the JDBC drivers that are not compatible. Thanks, Justyna Hans Bergsten wrote: Wolfgang Röckelein wrote: Hi, at JDBC level there are two different possibilities to set a parameter value to null: with setNull and setting to null. Depending on the driver sometimes only on of these methods work, and when it does not work, you see the java.sql.SQLException: Invalid column type error you see. I think this was already changed or discussed sometime during the standard taglib development. Right. I was looking at the code for JSTL in the CVS archive, and it calls setObject(index, null) when passed a null value, and there's a comment that this should be converted by the driver to an SQL null. Browsing through the JDBC JavaDocs and the JDBC spec, there seems to be some support for this claim, but it's not 100% clear. It's possible that the driver Keith is using doesn't handle it, and maybe it would be better if JSTL used setNull(). The reason it doesn't is that it would required additional type info for the sql:param case. Pierre, this may be something to look at again for JSTL.next. Keith, a work-around for this would be: fmt:parseDate value=${param.dob} var=parsed_dob pattern=dd-MM- / c:choose c:when test=${!empty parsed_dob} sql:update INSERT INTO resource_registry (resource_id, dob) VALUES (res_id_seq.NEXTVAL, ? ) sql:dateParam value=${parsed_dob} type=date/ /sql:update /c:when c:otherwise INSERT INTO resource_registry (resource_id) VALUES (res_id_seq.NEXTVAL) /sql:update /c:otherwise /c:choose If the real case involves many parameters that may be null, this gets ugly, but if it's just this one, it may be okay. Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: standard-examples.war in JDeveloper9i...parser doesn't like web.xml
After a quick look at Oracle's product description I found that Oracle9i JDeveloper supports JSP 1.1 and Servlet 2.2. You need a container that supports JSP 1.2 in order to have the JSTL examples work properly. The latest version of SunOne Studio (formerly Forte) has JSTL already supported and integrated in the tool: http://wwws.sun.com/software/sundev/index.html You can also checkout Netbeans, an open source IDE with JSP 1.2 support: http://www.netbeans.org Justy Robert Kuhar wrote: I'm trying to get the Examples project working in my JDeveloper9i IDE and am having difficulty. The IDE somehow takes exception to the web.xml file. Error(1): oracle.xml.parser.v2.XMLParseException: Invalid element 'listener' in content of 'web-app', expected elements '[distributable, context-param, servlet, servlet-mapping, blah...blah...blah' Has anyone got the standard-examples.war file to run under JDevelolper9i and, if so, how? Bob -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Test - please ignore
Filler for the really curious people. Justy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]