xtim
Wednesday, July 28, 2004
 
Lots of maintenance pages served overnight, all from w3. There are two causes:

1. referencing the cookies array without checking to see whether it's null first. I was sure we fixed all these pages a while ago but the code says otherwise. Now definitely fixed, for all of them.

2. IllegalStateExceptions thrown when we call response.sendRedirect after HTML has already gone back to the client.

Number (2) is more serious. Jserv doesn't complain about it but Tomcat won't allow it. Therefore we have to fix it before we move to TC.

Our redirects are often in include files (or include-include files) and so buried quite far within the compiled page. Even if we've not deliberately sent any content before they get processed, the "include" mechanism can introduce rogue newlines which count as page content.

To fix this we'll have to refactor our pages in a way which ensures that all redirection logic get processed before any content is sent - ie move to controller/view architecture. Struts provides a handy framework for that. Unfortunately, jserv won't support struts.

Our options are to

a) write a struts-like framework which will work under jserv,
b) move to struts under tomcat,
c) carry on as we are, with jserv and scripts on the pages.

(a)'s a waste of time and (c)'s not got much life left in it. We're already running into "too much code" exceptions when compiling some of our more epic pages (see entries for last week). My vote goes for (b).

Would be nice to rationalise all our presentation stuff into taglibs as well so we get clean jsps at the end of it. I reckon it would be a month's project to do.

In the meantime, we're reverting w3 to run jserv rather than tomcat.

T
Comments: Post a Comment

<< Home

Powered by Blogger