Ted Neward Validation Amusement

11 PM April 7, 2003

Ted Neward just posted an article on validation. It describes how important validation is, when to do it, what kinds of to do, how to report errors and even discusses the technologies you might use.

I thought it was great. So I went to post this comment:

This is a good read.

A site with a lot of good, consistent, Javascript validation often feels polished and professional. A site with cheesy validation (or worse, a "500 Internal Error" and a Stack trace) can be really painful.

I'd also add that testing validation is a pain-in-the-neck, but if you have, you _must_ test it. Any mistakes in the validation code look bad and can quite possibly prevent a user from submitting valid data.

And then I pressed submit and got...


HTTP Status 500 -



type Exception report



message



description The server encountered an internal error () that 

prevented it from fulfilling this request.



exception 



org.apache.jasper.JasperException: entryID should never be null!

	at org.apache.jasper.servlet.JspServletWrapper.service(

		JspServletWrapper.java:254)

	at org.apache.jasper.servlet.JspServlet.serviceJspFile(

		JspServlet.java:295)

	at org.apache.jasper.servlet.JspServlet.service(

		JspServlet.java:241)

	at javax.servlet.http.HttpServlet.service(

		HttpServlet.java:853)

	at org.apache.catalina.core.ApplicationFilterChain.

		internalDoFilter(ApplicationFilterChain.java:247)

	at org.apache.catalina.core.ApplicationFilterChain.

		doFilter(ApplicationFilterChain.java:193)

	at geekblog.filters.ReferralsFilter.

		doFilter(ReferralsFilter.java:74)

	at org.apache.catalina.core.ApplicationFilterChain.

		internalDoFilter(ApplicationFilterChain.java:213)

	at org.apache.catalina.core.ApplicationFilterChain.

		doFilter(ApplicationFilterChain.java:193)

	at geekblog.filters.PrefsSetupFilter.doFilter(

		PrefsSetupFilter.java:84)

	at org.apache.catalina.core.ApplicationFilterChain.

		internalDoFilter(ApplicationFilterChain.java:213)

	at org.apache.catalina.core.ApplicationFilterChain.

		doFilter(ApplicationFilterChain.java:193)

	at org.apache.catalina.core.StandardWrapperValve.

		invoke(StandardWrapperValve.java:256)

	at org.apache.catalina.core.StandardPipeline$

		StandardPipelineValveContext.invokeNext(

		StandardPipeline.java:643)

	at org.apache.catalina.core.StandardPipeline.invoke(

		StandardPipeline.java:480)

	at org.apache.catalina.core.ContainerBase.invoke(

		ContainerBase.java:995)



    < ... and so on for a few hundred lines ... >



Apache Tomcat/4.1.24

I am not making this up.

Not that I should find it too amusing... I know this blog's comment form can be a little dodgy too :)

By alang | # | Comments (0)
(Posted to Software Development)

Neat SAX Trick

9 PM April 7, 2003

I have a fascination with dead technologies, which explains why I started reading the Java Web Services Tutorial today. In the XSLT chapter, I came across this gem entitled “Generating XML from an Arbitrary Data Structure”.

It describes how to implement just enough of the interface of a SAX parser to drive an XSLT stylesheet. The example given transforms an LDAP database entry (in the form of an ldif file) into an XML document using the default XSLT transformation. The trick works quite well in this situation, because the ldif file has to be parsed anyway.

This kind of trick might also work in other situations where parsing and transformation are required. For example, you could build a tiny web-app that runs free-format queries against an SQL database, and returns HTML formatted table results. Using an external XSLT stylesheet would give scope for customising the display.

By alang | # | Comments (0)
(Posted to Software Development)
© 2003-2006 Alan Green