From evisuale at mn.mediaone.net Wed Oct 10 10:39:01 2001 From: evisuale at mn.mediaone.net (Erick Stohr) Date: Mon Jan 17 14:29:27 2005 Subject: [TCLUG-DEVEL] web.xml Message-ID: <3BC46B95.4AF1D231@mn.mediaone.net> Can anyone help with the syntax in a web.xml file for specifying a JAR file full of servlets for Tomcat? Thanks. I am wading through the sun specs but not having much luck and I don't have a lot of time. Erick From dutchman at uswest.net Wed Oct 10 22:00:24 2001 From: dutchman at uswest.net (Perry Hoekstra) Date: Mon Jan 17 14:29:28 2005 Subject: [TCLUG-DEVEL] web.xml References: <3BC46B95.4AF1D231@mn.mediaone.net> Message-ID: <3BC50B48.6020800@uswest.net> Erick Stohr wrote: > Can anyone help with the syntax in a web.xml file for specifying a JAR > file full of servlets for Tomcat? Thanks. I am wading through the sun > specs but not having much luck and I don't have a lot of time. > > Erick I am familiar with the web.xml file. What's up? -- Perry Hoekstra E-Commerce Architect Talent Software Services perry.hoekstra@talentemail.com From tanner at real-time.com Tue Oct 30 15:07:03 2001 From: tanner at real-time.com (Bob Tanner) Date: Mon Jan 17 14:29:28 2005 Subject: [TCLUG-DEVEL] Vector of Objects to Array of Objects? Message-ID: <20011030150703.Y1949@real-time.com> Is there a simple way to convert a Vector of Object to and Array of Objects of the same type? What I'm doing now is something like this: Vector v = new Vector(); v.add(obj) // Ok, vector has a bunch of Object in it int size = v.size(); BobObj obj = new BobObj[size]; for (int i = 0; i < size; i++) { // Walk the vector making it into an Array obj[i] = new BobObj(result.get(i)); } I look at the Vector.toArray() thinking that would solve my problem, but I can't seem to get it to work. -- Bob Tanner | Phone : (952)943-8700 http://www.mn-linux.org, Minnesota, Linux | Fax : (952)943-8500 Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9 From dmblevins at mediaone.net Tue Oct 30 17:05:41 2001 From: dmblevins at mediaone.net (David Blevins) Date: Mon Jan 17 14:29:28 2005 Subject: [TCLUG-DEVEL] Vector of Objects to Array of Objects? In-Reply-To: <20011030150703.Y1949@real-time.com> Message-ID: Sure, that's easy. In fact, I just wrote a few dozen of these little statements. // Long version int size = v.size(); BobObj[] objs = new BobObj[size]; v.copyInto(objs); // Short version BobObj[] objs = new BobObj[v.size()]; v.copyInto(objs); Arrays are of type object, so you can even cast them, but this can be error prone. // Ok Object[] newArray = new String[]{"one","two","tree"}; String[] stringArray = (String[])newArray; //Wrong!!! Object[] newArray = new Object[]{"one","two","tree"}; String[] stringArray = (String[])newArray; Other useful array things. System.arrayCopy(...see javadoc...); Or, how about when you have an array, but you really need a Vector. Vector v = new Vector(Arrays.asList(stringArray)); Have fun. David Blevins --- OpenEJB - EJB Container System www.openejb.org ftp.exolab.org/pub/openejb/ > -----Original Message----- > From: tclug-devel-admin@mn-linux.org > [mailto:tclug-devel-admin@mn-linux.org]On Behalf Of Bob Tanner > Sent: Tuesday, October 30, 2001 3:07 PM > To: tclug-devel@lists.real-time.com > Subject: [TCLUG-DEVEL] Vector of Objects to Array of Objects? > > > Is there a simple way to convert a Vector of Object to and Array > of Objects of > the same type? > > What I'm doing now is something like this: > > Vector v = new Vector(); > > > v.add(obj) > > > // Ok, vector has a bunch of Object in it > > int size = v.size(); > BobObj obj = new BobObj[size]; > > for (int i = 0; i < size; i++) { > // Walk the vector making it into an Array > obj[i] = new BobObj(result.get(i)); > } > > I look at the Vector.toArray() thinking that would solve my > problem, but I can't > seem to get it to work. > > > -- > Bob Tanner | Phone : (952)943-8700 > http://www.mn-linux.org, Minnesota, Linux | Fax : (952)943-8500 > Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9 > > _______________________________________________ > tclug-devel mailing list > tclug-devel@mn-linux.org > https://mailman.mn-linux.org/mailman/listinfo/tclug-devel From lamfada at lugh.net Tue Oct 30 17:11:28 2001 From: lamfada at lugh.net (Chris McKinley) Date: Mon Jan 17 14:29:28 2005 Subject: [TCLUG-DEVEL] Vector of Objects to Array of Objects? In-Reply-To: <20011030150703.Y1949@real-time.com> Message-ID: This will work for Java 1.2 and up. You should be able to do this: BObj a[] = (BObj[]) v.toArray(); However, unless you need thread safety or Java 1.0 or 1.1 compatability, you should use java.util.ArrayList. On Tue, 30 Oct 2001, Bob Tanner wrote: > Is there a simple way to convert a Vector of Object to and Array of Objects of > the same type? > > What I'm doing now is something like this: > > Vector v = new Vector(); > > > v.add(obj) > > > // Ok, vector has a bunch of Object in it > > int size = v.size(); > BobObj obj = new BobObj[size]; > > for (int i = 0; i < size; i++) { > // Walk the vector making it into an Array > obj[i] = new BobObj(result.get(i)); > } > > I look at the Vector.toArray() thinking that would solve my problem, but I can't > seem to get it to work. > > > -- > Bob Tanner | Phone : (952)943-8700 > http://www.mn-linux.org, Minnesota, Linux | Fax : (952)943-8500 > Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9 > > _______________________________________________ > tclug-devel mailing list > tclug-devel@mn-linux.org > https://mailman.mn-linux.org/mailman/listinfo/tclug-devel > -Chris McKinley finger lamfada@lugh.net for GPG key From tanner at real-time.com Tue Oct 30 22:52:46 2001 From: tanner at real-time.com (Bob Tanner) Date: Mon Jan 17 14:29:28 2005 Subject: [TCLUG-DEVEL] Vector of Objects to Array of Objects? In-Reply-To: ; from dmblevins@mediaone.net on Tue, Oct 30, 2001 at 05:05:41PM -0600 References: <20011030150703.Y1949@real-time.com> Message-ID: <20011030225246.F2684@real-time.com> Quoting David Blevins (dmblevins@mediaone.net): > Sure, that's easy. In fact, I just wrote a few dozen of these little > statements. > > > // Long version > int size = v.size(); > BobObj[] objs = new BobObj[size]; > v.copyInto(objs); Works like a charm. Thanks. You officially get put into my documentation :-) -- Bob Tanner | Phone : (952)943-8700 http://www.mn-linux.org, Minnesota, Linux | Fax : (952)943-8500 Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9