View Single Post
  #1 (permalink)  
Old 07-19-2007, 02:00 AM
oregon oregon is offline
Member
 
Join Date: Jul 2007
Posts: 41
oregon is on a distinguished road
how to parse an xml file
I need to parse an XML file hello.xml which is in WEB-INF/classes folder
My Action class calls a helper class called XMLMenuBuilder which needs to parse the menu.xml

the code:

LogonAction.java
Code:
XMLMenuBuilder builder = new XMLMenuBuilder(); Vector menuV = (Vector)builder.renderMenu();
XMLMenuBuilder.java
Code:
public Vector renderMenu() throws AppException { DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse( new File(xmlfile) ); }

My Problem is how can I make the builder.parse access the menu.xml file under the WEB-INF/classes folder instead of searching for it on the file system
any ideas?
Reply With Quote
Sponsored Links