"I remember in the pre-Struts days of someone on the JSP Interest mailing list talking about the fact that they had a 5000 line JSP page that implemented the entire app (complete with creating different forms and processing the results) -- all in a single page. And he was *proud* of it!"
Doesn't he still post to this list under the alias Vic C.? >>> [EMAIL PROTECTED] 11/12/2003 7:03:13 PM >>> Quoting Christian Bollmeyer <[EMAIL PROTECTED]>: > Am Mittwoch, 12. November 2003 21:31 schrieb Craig R. McClanahan: > > Quoting Larry Meadors <[EMAIL PROTECTED]>: > > > Why would you ever do this? This looks like a complete and total > > > kludge. > > > > > > If you are sending back binary data (application/pdf), just do it > > > from the action class using the response.getOutputStream() and > > > return null from the execute method. > > > > > > Advantages: > > > - you already have everything you need right there > > > - you eliminate the entry in struts-config > > > - you eliminate a useless jsp > > > - you can specify any content type (not just one per jsp) > > > - you get better exception handling > > > - the list could go on and on... > > > > There's actually a much more fundamental reason than all of the above > > (which are true nonetheless) -- JSP pages are not allowed to create > > binary output. They never call response.getOutputStream(). > > That's how it's meant to be, and JSPs themselves don't, but you > can always shed in a scriptlet to make them behave otherwise. You might get lucky on some containers, but you can be assured that writing binary output from a scriptlet is not guaranteed to be portable. Indeed, you're more likely to cause an IllegalStateException, because the servlet container won't let you call getWriter() and getOutputStream() on the same response. > I've seen people doing just ridiculous things with JSPs, some > of them routinely putting a <% at the top and a %> at the end, > and then went on happily putting everything imaginable in-bet- > ween, usually with lengthy <%@ page import="[xy]" %> state- > ments on top. Won't support Mark Galbreath on this matter, > so if there may be a grain of truth in his direction, I'm still > just telling from my personal experiences, limited to a > single case, thankfully. But never underestimate human > ingenuity ;-) > s/ingenuity/foolishness/ :-) I remember in the pre-Struts days of someone on the JSP Interest mailing list talking about the fact that they had a 5000 line JSP page that implemented the entire app (complete with creating different forms and processing the results) -- all in a single page. And he was *proud* of it! > > > Larry > > > > Craig > > -- Chris. > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]