axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: xml-axis/java/webapps/axis happyaxis.jsp
Date Fri, 13 Sep 2002 17:01:07 GMT
stevel      2002/09/13 10:01:06

  Modified:    java/webapps/axis happyaxis.jsp
  Log:
  eliminate JspExceptions, return meaningful error strings at potential trouble points (untested,
obviously)
  
  Revision  Changes    Path
  1.8       +13 -11    xml-axis/java/webapps/axis/happyaxis.jsp
  
  Index: happyaxis.jsp
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/webapps/axis/happyaxis.jsp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- happyaxis.jsp	12 Sep 2002 21:01:29 -0000	1.7
  +++ happyaxis.jsp	13 Sep 2002 17:01:06 -0000	1.8
  @@ -222,18 +222,20 @@
        *
        * @return the classname of the parser
        */
  -    public String getParserName() throws JspException {
  -        try {
  -            // Create a JAXP SAXParser
  -            SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
  -            SAXParser saxParser = saxParserFactory.newSAXParser();
  -
  -            // check to what is in the classname
  -            String saxParserName = saxParser.getClass().getName();
  -            return saxParserName;
  -        } catch (Exception e) {
  -            throw new JspException(e);
  +    public String getParserName() throws Exception {
  +        // Create a JAXP SAXParser
  +        SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
  +        if(saxParserFactory==null) {
  +            return "no XML parser factory found";
  +        }
  +        SAXParser saxParser = saxParserFactory.newSAXParser();
  +        if(saxParser==null) {
  +            return "Could not create an XML Parser";
           }
  +
  +        // check to what is in the classname
  +        String saxParserName = saxParser.getClass().getName();
  +        return saxParserName;
       }
   
       %>
  
  
  

Mime
View raw message