> I hope someone has the answer to this one ...
>
> By far the most cumbersome task (not technically challenging, just
> *lots* of work) I've encountered in servlet programming is converting
> the data in http requests into java objects. GetParameter() is
> basically a pain, but it's probably the best we can hope for in the html
> world (slightly improved methods for converting the resulting string to
> different datatypes included below for anyone who's interested).
>
> The XML world, however, seems to offer the promise of better. If the
> incoming request contains tags which tell me what the information its
> sending me is supposed to be, I should be able to stick those into
> properties on objects directly (more or less). Should make the process
> *much* easier, no?
Check out www.xml-rpc.com
> // get parameter methods for other basic datatypes
> protected boolean getBooleanParameter (HttpServletRequest rq, String
> paramName)
> {
> String str = rq.getParameter(paramName);
> if (str.equals("") || str == null) return false;
> else return (str.equals("true") || str.equals("TRUE")); // can also
> use Boolean class here
> }
I have a class that makes all of this pretty trivial...it is free...
<http://www.working-dogs.com/dash/cvsweb/index.cgi/dash/com/workingdogs/dash
/util/ParameterParser.java?rev=1.10&content-type=text/x-cvsweb-markup>
I just added getBoolean for you...
-jon
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html