FileDocCategorySizeDatePackage
ValidateHandler.javaAPI DocExample1640Mon Feb 09 17:58:44 GMT 2004com.jspservletcookbook

ValidateHandler

public class ValidateHandler extends DefaultHandler

Fields Summary
private String
fileName
Constructors Summary
Methods Summary
public voiderror(org.xml.sax.SAXParseException e)

    throw e;
public java.lang.StringgetFilename(javax.servlet.jsp.tagext.PageData page)

       try{
              SAXParserFactory factory = SAXParserFactory.newInstance();
              factory.setNamespaceAware(true);
              SAXParser saxparser = factory.newSAXParser();
              saxparser.parse(page.getInputStream(),this);
      } catch (FactoryConfigurationError fe){
              throw fe;
      } catch (ParserConfigurationException pce){
              throw pce;
      } catch( SAXException se){
              throw se;
      } catch( java.io.IOException io){
              throw io;
      } finally {
              return this.fileName; }
 
public voidstartElement(java.lang.String nameSpaceuri, java.lang.String sname, java.lang.String qname, org.xml.sax.Attributes attrs)


   
             
           for(int i=0; i<attrs.getLength();i++)
             if("filename".equals(attrs.getLocalName(i)))
              this.fileName=attrs.getValue(i);