Accessing properties
Hello All, I'm trying to use the value of a property in a c:if test= element. I have the Properties object in application scope, but I can't seem to figure out how (of if) I can address the individual property value of a given key. Something like props.get(viewer.tool.useZoomIn) in a scriptlet. I thought about transfering the properties to a HashMap, but given the .s embeded in the property keys, wasn't sure how I'd access them even then. Thanks for any help or suggestions! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
retrieve image from dynamic source and c:url
Hello All, I'm trying to create a page using an HTML img tag that has as it's src attribute a URL. my initial attempts were along the line of: img src=c:url value=http://mapserver/servlet/com.esri.wms.Esrimap; var=url c:param name=servicename value=${param.servicename}/ /c:url however, the src attribute has the value of empty string in the resulting page. Can someone point out what I'm doing wrong or suggest a better approach? Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
access to nested objects
Hello All, can someone clarify for me how to use an expression to get to a nested field in a bean. For example, I have a bean mapserviceDetailForm with a method that returns another bean service, and I want to reference the name field within the service bean. I was trying variations on: c:set var=mapservicename value=${mapserviceDetailForm.service.name}/ Can someone clarify for me? Thanks! -- john - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:if and boolean value
Thanks for the suggestion, Tim. I actually did buy Shawn's book (in PDF form), I just haven't quite gotten familiar with it to remember all the resources that are there. Still used to hard-copy, I guess :-) . -- john Tim Kettering wrote: John, Download the PDF at this URL and keep it around: http://www.manning.com/bayern/appendixA.pdf I've found it quite useful in terms of referencing JSTL tags, and for finding examples of how such tags are written. I certainly wish it had a bit more examples, but I suppose thats why you buy the book, as Bayern would like. :) -tim On Thursday, February 06, 2003, at 11:51AM, John C Cartwright [EMAIL PROTECTED] wrote: That works great, thanks to both Tim and Pierre. One follow up question though - is there a c:else tag to go with the c:if? Thanks again! -- john Timothy Kettering wrote: Yeah, that occured to me after I sent off the email and was sitting on the couch watching Law Order on TNT. Somehow I just couldn't be bothered enough to go back to the computer and follow up on it. :) Anyway, more ways to skin the proverbial cat... -tim On Wednesday, February 5, 2003, at 09:37 PM, Pierre Delisle wrote: Try the following: c:if test=${mapservice.running} [What Timothy suggested would also work, but there is no need to test against true, since you already have a boolean expression for your test.] -- Pierre Timothy Kettering wrote: offhand, id say you should be doing this. (enclose the entire evaluation in the curly braces) c:if test=${mapservice.running == true} On Wednesday, February 5, 2003, at 08:23 PM, John C Cartwright wrote: Hello All, I have a isRunning() method in my bean that returns a boolean. I'm try to test against that value with something like the following: c:if test=${mapservice.running} == true img src=../images/TransGear.gif width=20 height=20 /c:if The problem is that even though the bean's getter method is properly returning the true value (I can print it into the HTML page), the above conditional always fails. Can someone point out what I'm doing wrong? JSTL v.1.2, core library. Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [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] -- = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
c:if and boolean value
Hello All, I have a isRunning() method in my bean that returns a boolean. I'm try to test against that value with something like the following: c:if test=${mapservice.running} == true img src=../images/TransGear.gif width=20 height=20 /c:if The problem is that even though the bean's getter method is properly returning the true value (I can print it into the HTML page), the above conditional always fails. Can someone point out what I'm doing wrong? JSTL v.1.2, core library. Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with SQL tags
Thanks to Buck and Hans for your reponses. Unfortunately, I'm still having the same problem. I tried: 1) moving the mysql driver JAR file to $TOMCAT/common/lib as Buck suggested 2) unpacking the JAR file into $WEBAPP/WEB-INF/classes 3) getting the latest mysql driver from mysql.com Still same results, a scriptlet-based connection works, the JSTL doesn't. I've tried both the 1.0.2 version of the JSTL tags as well as the nightly build from last Friday. Here again is the corresponding connection code. There's no difference that I can see between the driver class name or database URL. Any further suggestions? Thanks for your help! -- john Hans Bergsten wrote: Bell, Buck (c) wrote: Hi John, My $.02. Although I'm not using MySQL, my experience with Tomcat 4.1.12 has been that I must place the JDBC Driver classes in the Tomcat common/lib directory. Although this is somewhat in contrast to the JSTL and other JARs, I found that including the JDBC driver classes in WEB-INF/lib not only caused the error you described, it did so even when I had the JARs in both locations. So, you might want to try including the classes ONLY in common/lib. Of course, once you get the JAR issue resolved, setting up a JNDI DataSource (with a pooled connection) is even better. You need to place them in common/lib only if you use JNDI (because the JNDI machinery is relying on other class loaders than the ones used for regular web app resources). Without JNDI, they should be found in WEB-INF/lib. I agree that using JNDI is a good idea, but what John is trying should work without it. Hans -Original Message- From: John C Cartwright [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 11:32 AM To: Tag Libraries Users List Subject: Re: problem with SQL tags Thank you for your reply, Hans. The JDBC driver classes are in the webapps WEB-INF/lib directory and I was assuming that they are being found because a non-JSTL JSP page with a scriptlet block containing: Connection con; try { Class.forName(org.gjt.mm.mysql.Driver); con = DriverManager.getConnection(jdbc:mysql://myhost.noaa.gov:3306/testdb,test user,testpass); } catch (Exception e) { throw (new ServletException(Error loading Driver: +e.getMessage())); } seems to work fine. Does JSTL look for the Driver classes in a location other than the scriplet-based connection code? Thanks again! -- john Hans Bergsten wrote: John C Cartwright wrote: Hello All, I am hoping that someone can help me to get going with the SQL tags. I'm trying to connect to a mysql database using tomcat4.1.12 and version 1.0.2 of the library. Here's my JSP: %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % HTML HEAD /HEAD BODY sql:setDataSource var=monitorDS url=jdbc:mysql://myhost.noaa.gov:3306/testdb driver=org.gjt.mm.mysql.Driver user=testuser password=testpass / /BODY /HTML I'm getting a: org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver This is because the JDBC driver classes are not found by the web container. Make sure you have installed them in the WEB-INF/lib directory of the application. [...] Hans -- = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: problem with SQL tags
Hello again, I think that I found the problem. I had thought that the exception: org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver was referring to the mysql driver classes not being loaded correctly. It seems that the problem was actually in the way that I was referring to the DataSource in the subsuquent sql:query tag. I was using: dataSource=$monitorDS but when I changed it to: datasource=${monitorDS} everything seems to work fine. I'm still not clear why exactly this is, but am delighted that it's working. Next task is to set up a JNDI datasource as Buck suggested. Thanks to all for the help! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
problem with SQL tags
Hello All, I am hoping that someone can help me to get going with the SQL tags. I'm trying to connect to a mysql database using tomcat4.1.12 and version 1.0.2 of the library. Here's my JSP: %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % HTML HEAD /HEAD BODY sql:setDataSource var=monitorDS url=jdbc:mysql://myhost.noaa.gov:3306/testdb driver=org.gjt.mm.mysql.Driver user=testuser password=testpass / /BODY /HTML I'm getting a: org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: No suitable driver exception thrown even though a very similar JSP using standard JDBC connection methods (listed below) works fine. Connection con; try { Class.forName(org.gjt.mm.mysql.Driver); con = DriverManager.getConnection(jdbc:mysql://myhost.noaa.gov:3306/testdb,testuser,testpass); } catch (Exception e) { throw (new ServletException(Error loading Driver: +e.getMessage())); } Can someone help me? Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- To unsubscribe, e-mail: mailto:taglibs-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:taglibs-user-help;jakarta.apache.org
problem with xercesImpl.jar
Hello All, I apologize if this is slightly off topic, but I was trying to get the standard-examples webapplication running and found that I needed to remove the xercesImpl.jar file from the WEB-INF/lib before things would operate correctly. I was previously getting a NoClassDefFoundError exception complaining about org/w3c/dom/DOMErrorHandler. Is this to be expected? I'm running v1.0 of the taglig, jdk1.4, tomcat 4.0.4 on win2K. Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: problem with xercesImpl.jar
yes, the war file with the 1.0 binary distribution of the standard taglib. -- john Todd Marti McConnell wrote: John, Do you mean the HSTL standard examples app? todd -Original Message- From: John C Cartwright [mailto:[EMAIL PROTECTED]] Sent: Friday, October 11, 2002 10:46 AM To: [EMAIL PROTECTED] Subject: problem with xercesImpl.jar Hello All, I apologize if this is slightly off topic, but I was trying to get the standard-examples webapplication running and found that I needed to remove the xercesImpl.jar file from the WEB-INF/lib before things would operate correctly. I was previously getting a NoClassDefFoundError exception complaining about org/w3c/dom/DOMErrorHandler. Is this to be expected? I'm running v1.0 of the taglig, jdk1.4, tomcat 4.0.4 on win2K. Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- 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] -- = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]