RE: Help with TLDParser for UltraDev by Dan Mandell
Title: RE: Help with TLDParser for UltraDev by Dan Mandell Hi Becky, It took me a couple of days to get the Custom Tag floater working smoothly as well. I didn't get the exact error message you have, but I'd suggest you double check to see that there is only one of each required jar in your classpath (ie: xerces.jar should be in jdk1.3/lib/ext - if you add it to the classpath it's doubled up and you get a similar error). Failing that, remove and reinstall the extension. Kat Luna [EMAIL PROTECTED] -Original Message- From: Becky Moyer [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 14, 2001 12:36 PM To: [EMAIL PROTECTED] Subject: Help with TLDParser for UltraDev by Dan Mandell Hi all... I'm trying to get this to work...the Struts extension for Dreamweaver UltraDev found at http://www.shokker.com/ctlx/ctlx.zip . I've installed it, but I can't get it to recognize my tld files. I get the following null pointer exception in my tomcat log...any ideas? I've set up everything as far as I can tell exactly as the documentation say, as far as I can tell. I am using Dreamweaver 4. Much appreciated, Becky 2001-06-14 12:19:40 - Ctx( /TLDParser ): Exception in: R( /TLDParser + /servlet/TLDParser + null) - java.lang.NullPointerException at TLDParser.outputTLDList(TLDParser.java:379) at TLDParser.doGet(TLDParser.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Unknown Source) _ Get your FREE download of MSN Explorer at http://explorer.msn.com
RE: Displaying data retrieved from a database
It took me another day to find the small errors (I was not referencing the form bean correctly in the jsp) but your code snippets really helped. I think I finally understand how to retrieve a property from a form and iterate through it. Thanks again Kat -Original Message-From: Michael Mok [mailto:[EMAIL PROTECTED]]Sent: Tuesday, June 12, 2001 10:33 AMTo: [EMAIL PROTECTED]Subject: Re: Displaying data retrieved from a database Hi Kat In my struts-config type="org.teatimej.timesheet.EditTimeSheetAction" name="timesheetform" scope="session"> This is how I iterate through my arraylist in my jsp. property="timeHeader.timeRow" type="org.teatimej.timesheet.dao.TimeRowView"> My timesheetform bean contains an attribute called timeHeader bean. Hence in my timesheetform bean I have the getter and setter methods (eg getTimeHeader(), setTimeHeader()) which access the TimeHeader Bean. My TimeHeader bean contains an attribute of type java.util.ArrayList named TimeRow. I also added the getter and setter methods (eg getTimeRow() and setTimeRow()) The objects that I add to TimeRow are of type org.teatimej.timesheet.dao.TimeRowView. Hope it helps. Michael Mokwww.webappcabaret.com/teatimej ----- Original Message - From: Luna, Kat To: '[EMAIL PROTECTED]' Sent: Tuesday, June 12, 2001 8:36 PM Subject: RE: Displaying data retrieved from a database Michael, What exactly do you mean when you say "assign the arraylist"? I believe I have all the beans in place to retrieve from the database and store in an arraylist, but when I try to iterate through the bean from the jsp page, I get "scope = null" which makes me think that I am missing this step of assigning the ArrayList to make it accessible to the JSP page. Thanks, Kat
RE: Displaying data retrieved from a database
Michael, What exactly do you mean when you say "assign the arraylist"? I believe I have all the beans in place to retrieve from the database and store in an arraylist, but when I try to iterate through the bean from the jsp page, I get "scope = null" which makes me think that I am missing this step of assigning the ArrayList to make it accessible to the JSP page. Thanks, Kat -Original Message-From: Michael Mok [mailto:[EMAIL PROTECTED]]Sent: Tuesday, June 12, 2001 1:25 AMTo: [EMAIL PROTECTED]; 'Jonathan Asbell'Subject: RE: Displaying data retrieved from a database Jonathan A way of doing this is to use the java.util.ArrayList object. If you have a bean to represent a row of data eg TableRow CustID FirstName LastName RowBean Integer CustId; /* with get and set Methods */ String FirstName;/* with get and set Methods */ String LastName;/* with get and set Methods */ In your action perform, you can loop through your resultset, create a new RowBean for each Row and add it to the arraylist. You can then either assign the arraylist to the response object or the session object. In your JSP page, use the iterate tag to loop through your list. The other option is to use the CacheResultSet from sun but I have not venture into that area. There are a number of discussions in this list about using the CacheResultSet. Regards Michael Mok www.webappcabaret.com/normad -Original Message-From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]Sent: Tuesday, 12 June 2001 10:09To: [EMAIL PROTECTED]Subject: Displaying data retrieved from a database I was interested in how you all were displaying data retrieved from a database. My notion is that in your Actions perform() method you will make calls and get results. But where do you put the results? Do I save the data to a bean which I pass in the request to a waiting Tag class on the page I will forward to, and have that Tag class iterate through the beans data? This means I have to make Tag classes to read in passed beans. How are you all doing this in general. I am very interested. Jonathan
Logic-Iterate not finding scope of Bean
Title: Logic-Iterate not finding scope of Bean Hi all, me again with my afternoon question.. I have a UserAction class that extracts a list of Users from the database and stores them in an ArrayList. Success from this Action forwards to user.jsp which I want to display the list in table format. I have: <%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> ..etc but this causes the UserAction to run again (essentially calling the database and building the ArrayList again). Is there a way to have this bean init() when the jsp page loads and then iterate through the ArrayList instead of calling the Action first and then displaying the page? And if so, do I need to add anything to struts-config.xml to tell the page where to find/identify the UserAction bean? Thanks, Kat Luna Web Developer, BCE Emergis [EMAIL PROTECTED]
Please help with JDBC
Title: Please help with JDBC Hi all, I'm having a lot of difficulty understanding the way Struts handles JDBC. I've got a MySQL database that I can access through JDBC from a standard Java class, so I know that my computer's configuration, classpath and drivers are all set properly, but as soon as I add the to my struts-config.xml, I get the following error. When I run the DatabaseTest.java class from the command prompt it has no problem accessing the database, but obviously Struts or Tomcat or one of the parsers is not finding javax/sql/DataSource. Can anyone help me get this setup correct? New org.apache.struts.util.GenericDataSource java.lang.NoClassDefFoundError: javax/sql/DataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at org.apache.tomcat.loader.AdaptiveClassLoader12.doDefineClass(AdaptiveClassLoader12.java:9 3) at org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:509) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at org.apache.struts.digester.ObjectCreateRule.begin(ObjectCreateRule.java:152) at org.apache.struts.digester.Digester.startElement(Digester.java:498) at org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderAdapter.java:329) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1170) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1862) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScan ner.java:1238) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at javax.xml.parsers.SAXParser.parse(SAXParser.java:143) at org.apache.struts.digester.Digester.parse(Digester.java:716) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1301) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317) at org.apache.tomcat.core.Handler.init(Handler.java:215) at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296) at org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.j ava:130) at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491) at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235) Begin event threw exception java.lang.ClassNotFoundException: org/apache/struts/util/GenericDataSource at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at org.apache.struts.digester.ObjectCreateRule.begin(ObjectCreateRule.java:152) at org.apache.struts.digester.Digester.startElement(Digester.java:498) at org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderAdapter.java:329) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1170) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1862) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScan ner.java:1238) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:952) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at javax.xml.parsers.SAXParser.parse(SAXParser.java:143) at org.apache.struts.digester.Digester.parse(Digester.java:716) at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1301) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317) at org.apache.tomcat.core.Handler.init(Handler.java:215) at org.apache.tomcat.core.ServletWrap
GenericDataSource error
Title: GenericDataSource error Hi, I need to get familiar with using Struts and JDBC and I'm trying to run the fruit-glaze application. I've installed mysql and the driver, added the driver to my classpath and started mysql as a service. Then I added fruit-glaze.war to the webapps folder and started Tomcat. Now I've got Begin event threw exception java.lang.ClassNotFoundException: org/apache/struts/util/GenericDataSource when Tomcat tries to compile struts-config.xml I can see that struts.jar is in the /lib folder and GenericDataSource.class is there, so what am I missing? Is there something else I need to add to my classpath to make sure that Tomcat deploys the fruit-glaze.war correctly? Thanks, Kat Luna [EMAIL PROTECTED]
Form input using image tag
Title: Form input using image tag Hi, I'm trying to use the html:image tag to submit a form, but the graphic is not rendering correctly. html:img works fine for display, but this is the resulting source code of tag: Does anyone know why there is a blank property for "name" showing up and how to get rid of this? Thanks Kat Luna [EMAIL PROTECTED]
CTLX Dreamweaver Extension Error
Title: CTLX Dreamweaver Extension Error Hi, Has anyone encountered a Tomcat:SecurityException when running the ctlx Extension for Dreamweaver? The Floater displays the list of tld's, but onClick() of useTaglibs.html throws the following exception while trying to load the array of taglibs. java.lang.SecurityException: sealing violation at java.net.URLClassLoader.defineClass(URLClassLoader.java:234) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at TLDParser.parseTLD(TLDParser.java:150) at TLDParser.doGet(TLDParser.java:132) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Any suggestions would be appreciated... Kat Luna Web Developer, BCE Emergis [EMAIL PROTECTED]