Just so you don't think I'm pulling your leg, here's a jthml file I just
pulled off of Javasoft's site.  It dates to 1998 and mentions in a
comment that JSP will soon be the preferred technology.

Scott

On 27 Dec 2000 11:50:37 -0600, John N. Alegre wrote:
> This is incorrect.
> 
> I am not sure of the history but JHTML is what is used today by Art Technology
> Group's "Dynamo" application server.  It is proprietary but has some neat
> advantages to speed the set up of the presentation layer.
> 
> John
> 
> On 27-Dec-00 Scott "M." Stirling wrote:
> > I believe JHTML is one of the names for old JSP-like stuff prior to the
> > standardization of the first JSP spec.  I think Weblogic and Sun's JWS
> > used to support it.  Like classical Latin, it's a dead language.
> > 
> > 
> > On 27 Dec 2000 10:33:36 +0530, Santosh Kumar wrote:
> > What is the difference between JHTML and JSP?

-- 
Scott Stirling
West Newton, MA
Title: XML Validation Service
Java Server /*

If you are reading this, STOP!

This document needs to be be served by an HTTP server which understands the original version of Java Server Pages, "page compilation". It includes Java code embedded in HTML, and appropriate web servers automatically turn it into a servlet

You will not be able to use this XML validation service without a web server, such as the Java Web Server, which supports this technology.

*/ if ("POST".equals (request.getMethod ())) { String URI = request.getParameter ("URI"); // n.b. later versions of JHTML have "out" as a PrintWriter ... PrintWriter writer = new PrintWriter ( new OutputStreamWriter (out, "ISO-8859-1") );

XML Validation Service Results

Here are the results of validating the document at URI:
/* JHTML allows this compact syntax; JSP doesn't */ URI

Please use your browser's back button if you wish to validate another document.


try { URL u; String scheme; // Support relative URLs by default u = new URL (HttpUtils.getRequestURL (request).toString ()); u = new URL (u, URI); scheme = u.getProtocol (); if ("http".equals (scheme) || "https".equals (scheme)) { String showWarnings = request.getParameter ("WARN"); String checkType = request.getParameter ("MIMECHECK"); doValidate (u, writer, "yes".equals (showWarnings), "yes".equals (checkType) ); } else {

This service only accepts URIs for the HTTP and HTTPS schemes. } } catch (MalformedURLException e) { // how present URI vs URL distinction?

The URL you provided is malformed. The diagnostic provided is:

String mesg = e.getMessage (); if (mesg == null) mesg = e.getClass ().getName (); writer.print (mesg);
} catch (Throwable t) { String mesg = t.getMessage ();

Sorry, the URL you provided could not be processed.

/* if (mesg == null) mesg = t.getClass ().getName (); writer.write (""); writer.write (mesg); writer.write (""); */ t.printStackTrace (writer);
} finally { if (writer != null) writer.flush (); } } else {

XML Validation Service

Welcome to this XML Validation service.

This is an easy-to-use XML validation service based on an XML parser. It checks XML documents for conformance to the XML 1.0 specification of valid documents.


Validate Documents by URI

Enter the URI of an XML document you would like validated: URI:
Show warnings Use MIME type of document
} // // This method does the fun work of validating. In production // configurations it'd throttle down the load, and also need to // be able to reject some web sites. // private void doValidate ( URL url, Writer out, boolean showWarnings, boolean checkType ) throws IOException { HttpURLConnection conn; conn = (HttpURLConnection) url.openConnection (); try { if (conn.getResponseCode () != 200) { out.write ("

The document server returned an abnormal "); out.write ("response code: "); out.write (Integer.toString (conn.getResponseCode ())); out.write ("\n"); out.write ("This means: "); out.write (conn.getResponseMessage ()); out.write (".\n"); out.write ("Please try again, with a different URL."); return; } } catch (FileNotFoundException x) { // JDK 1.1.x bug out.write ("

The document server does not have the "); out.write ("document you specified,
\n"); out.write (url.toString ()); out.write ("

Did you provide the correct URL?\n"); return; } ErrorLister lister = new ErrorLister (out); boolean sawFatal = false; try { Resolver resolver; org.xml.sax.Parser parser; parser = new ValidatingParser (); lister.setShowWarnings (showWarnings); parser.setErrorHandler (lister); resolver = new Resolver (); resolver.setIgnoringMIME (!checkType); parser.setEntityResolver (resolver); parser.parse (url.toString ()); } catch (SAXException e) { // parse exceptions were reported already if (!(e instanceof SAXParseException)) { out.write ("

Exception: "); out.write (e.getMessage ()); out.write (""); } else sawFatal = true; } out.write ("

"); if (lister.msgCount != 0) out.write ("


"); if (lister.errCount == 0) { out.write ("Congratulations! Your document "); out.write ("appears to be valid XML text.\n"); } else { out.write ("Your document appears to have " + lister.errCount); out.write (" XML validation error" + (lister.errCount == 1 ? "" : "s") + ".\n"); } out.write ("

Note that this validator is under development,\n"); out.write ("and so may (like most XML validators today) not\n"); out.write ("be correct in all cases."); if (sawFatal) { out.write ("

Diagnostics labeled Fatal Error must\n"); out.write ("cause all XML processors to stop processing.\n"); out.write ("They are \"well formedness\" errors.\n"); out.write ("

In some cases, web servers have been known to\n"); out.write ("provide incorrect MIME types for documents. This\n"); out.write ("changes character encodings for entities and\n"); out.write ("causes XML processing errors in valid documents.\n"); out.write ("Try turning on warnings to see if such a problem is\n"); out.write ("reported. If it is, try turning off use of MIME\n"); out.write ("types. If this makes the problem go away, then the\n"); out.write ("web server administrator should fix it.\n"); } } static class ErrorLister implements ErrorHandler { Writer out; boolean showWarnings = false; int msgCount = 0; int errCount = 0; ErrorLister (Writer dest) { out = dest; } void setShowWarnings (boolean value) { showWarnings = value; } private void dump (String type, SAXParseException e) { try { msgCount++; out.write ("

"); out.write (type); out.write (" ... file "); out.write (e.getSystemId ()); out.write (" ... line "); out.write (Integer.toString (e.getLineNumber ())); out.write ("
\n
"); String mesg = e.getMessage (); int len = mesg.length (); for (int i = 0; i < len; i++) { char c = mesg.charAt (i); if (c == '<') out.write ("<"); else if (c == '&') out.write ("&"); else out.write (c); // Note: this relies on the writer producing // canonical garbage ("?") for characters that // can't be encoded using the current character // set ... e.g. emitting Kanji with ISO-8859-1. // Some diagnostics include text from the XML // document, which may not be in ISO-8859-1. } out.write ("
"); } catch (IOException ioe) { throw new RuntimeException ("I/O Exception: " + ioe.getMessage ()); } } public void warning (SAXParseException e) { if (showWarnings) dump ("Warning", e); } public void error (SAXParseException e) { dump ("Error", e); errCount++; } public void fatalError (SAXParseException e) { dump ("Fatal Error", e); errCount++; } }

Reply via email to