Tomcat at dawn
More thoughts on tomcat and REST. I note Joe Gregorio has another article up on XML.com in his REST series. Well worth reading them all in my humble.
As the birds woke me this morning around 5, I realised I was thinking about my Tomcat problems. Sometimes such nocturnal meanderings drop out with solutions. Then I'm appreciative, if I make the association. When no solution is forthcoming, I'm annoyed at being awoken by daytime problems..
Still suffering with my site state problems in Tomcat; I learned this morning that the server error (as I believed it to be) was nothing the server could resolve. I'd set caching off, at the http level, and the target of the back button was a page normally reached by a post, so the browser didn't even bother talking to the server, simply shrugged its shoulders, presented a barely meaningful message to the reader and left it at that. The browser suggested a refresh might help, and doing just that I found that I finally reached one of my error pages that Tomcat so mysteriously hides away... or more accurately fails to reach when I expect it to. Such is life. I've asked Pascal in Singapore if he's familiar with this, but almost regretted it when he told me he's 'in training' for call up, having been deemed too unfit and yet still on the get ready list. I hope his siezed up body recovers.
I'm beginning to support the idea of design patterns for webpages. I've been through the pages I'm presenting changing the same thing so many times, I'm regretting not having a standard layout throughout. Then I would have known the setup order, and I wouldn't have to go back and move the definitions around so much. All lessons learned I guess.
FAQ feedback last night, offering XSLT 1.0 solutions on namespaces. Do I add it, knowing that XSLT 2.0 has a more elegant solution? If I knew that 2.0 would get the rate of take-up that 1.0 did, I might ignore it. I suspect that despite the elegance of the Saxon 8 implementation, there will be the usual conservative view of the pointy-heads, mixed with the hysteresis of the techies, which could well result in 1.0 being around and in strong use far longer than others might hope. We'll see.
I've started codeing at last on my RESTful hub. Couple of problems even prior to coding. Setting up my home network to make the server visible from my development machine. Knowing as little as I do about networking, I had the netmask inverted. I also had to add a NAT route from one to the other. Once I could ping from one machine to another, I guessed it would be OK to build on one machine (Apache ANT of course) and push it to the other. I'm left wondering if ANT can take a url (the ip address) as a target for a <copy> command? How else do I get one Linux machine to move files to another? I'm not really keen on setting up an ftp server. Any suggestions?
Basic get logic is to parse the last leg of the url to ensure it is a valid IP, then respond with a standard header. Next to seek any messages for that IP address, and write them out (as a utf-8 string I guess). Bingo, done. That led me into a nice little regex (perhaps it was worth buying that illegible regex book from O'Reilly) to parse the IP string. Next to generate the ISO 8601 datetime. It makes sense to use UTC, but I haven't figured that one out as yet. So far its using UK locale specific time, which is currently GMT+1.
That all worked out in an hour or so, then I had to help unpack the shopping! At least it's under way. I know its going to be a bit messy storing and retrieving XML files in a logical way. I'm tempted to pick up on Ron's expertise, and go find a small XML database. That way it shouldn't be too hard to keep track of messages for a specific IP. More thinking called for.
At least I won't mind being woken by that one. How come some problems are nice, others are not?
Keywords: tomcatComments (View)
Return to main index