[jdom-interest] Order of tags

Jason Hunter jhunter at acm.org
Fri Oct 5 19:26:30 PDT 2001


The easiest way to do this is to do webapp.getChildren().add(3, elt) to
add it to the fourth location.  Saves a little memory thrashing.

-jh-

The Duke wrote:
> 
> Before I placed this message I looked through the FAQ and couldn't find it. But I solved the problem by creating a new Document and then with copy the existing <servlet> of the original to the new document with an enumeration. Then add the new <servlet>. For <servlet-mapping> I'm using the same method.
> 
> Thanks for your help
> 
> On Mon, 01 Oct 2001 23:12:28
>  Jason Hunter wrote:
> >There's a FAQ answer about how to control the placement of elements.
> >Short answer is use the List interface on the List of children.
> >
> >-jh-
> >
> >The Duke wrote:
> >>
> >> I am building an application that can create servlets for webapplications in Tomcat 4.0. The servlets are defined in WEB-INF/web.xml. The problem is the way the tags are placed. You only can place them like this :
> >>
> >> <servlet>
> >> </servlet>
> >>
> >> <servlet>
> >> </servlet>
> >>
> >> <servlet-mapping>
> >> </servlet-mapping>
> >>
> >> <servlet-mapping>
> >> </servlet-mapping>
> >>
> >> When I add a servlet with Jdom it will place both new tags at the end. Before the </web-app>. When I restart the tomcat server it will generate an error. On my system I do not have acces to the internet so I have downloaded the file and included the dtd with : http://localhost:8080/Dtd/web-app_2_3.dtd.
> >>
> >> I've tried to fix the problem with a different order of addContent(Element anElement) but that did not work.
> >>
> >> Can any one help??
> >>
> >> Make a difference, help support the relief efforts in the U.S.
> >> http://clubs.lycos.com/live/events/september11.asp
> >> _______________________________________________
> >> To control your jdom-interest membership:
> >> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> >_______________________________________________
> >To control your jdom-interest membership:
> >http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> >
> 
> Make a difference, help support the relief efforts in the U.S.
> http://clubs.lycos.com/live/events/september11.asp



More information about the jdom-interest mailing list