Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Element.addContent won 't accept String in   Collection

Element.addContent won 't accept String in   Collection

2006-11-16       - By Jason Hunter

 Back
I just added this.

-jh-

Jason Hunter wrote:
> You're right, a String should be suitable to add there.  If you'd like
> to add it, I think the way to do so is to check if it's a String and if
> so wrap it with a Text instance before proceeding.  That lets the class
> continue to hold a Content[].  I'll add it.
>
> -jh-
>
> Syloke Soong wrote:
>> JDOM javadoc says,
>>
>> [javadoc]
>> Element addContent(java.util.Collection collection) Appends all
>> children in the given collection to the end of the content
>> list.
>>
>> Element addContent(int index, java.util.Collection c) Inserts the
>> content in a collection into the content list at the given
>> index.
>>
>> Element addContent(java.lang.String str) This adds text content to
>> this element.
>> [/javadoc]
>>
>> Since you could add individual String, I presumed no harm would come my
>> way if String objects are included in the collection argument.
>>
>> But no, I had a Vector with a String object and addContent(collection)
>> rejected the vector due to ...
>>
>> org.jdom.IllegalAddException: Class java.lang.String is of unrecognized
>> type and cannot be added
>>     org.jdom.ContentList.add(ContentList.java:142)
>>     org.jdom.ContentList.addAll(ContentList.java:292)
>>     org.jdom.ContentList.clearAndSet(ContentList.java:338)
>>     org.jdom.Element.setContent(Element.java:742)
>>
>>
>> Hrrrmmmmpppphhhhhhhh .... !
>>
>> This email and any files transmitted with it are confidential and
>> intended solely for the use of the individual or entity to whom they
>> are addressed. If you have received this email in error please notify
>> the sender immediately. Please note that any views or opinions
>> presented in this email are solely those of the author and do not
>> necessarily represent those of the company. Even though this company
>> takes every precaution to ensure this email is virus-free, the
>> recipient should check this email and any attachments for the presence
>> of viruses. The company accepts no liability for any damage caused by
>> any virus transmitted by this email.
>> Protedyne Corporation, 1000 Day Hill Rd, Windsor, CT 06095,
>> USA,                                                                  
>> www.protedyne.com
>>
>> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
>> To control your jdom-interest membership:
>> http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
>>
> __ ____ ____ ____ ____ ____ ____ ____ ____ ____
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
>
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.