>>> [EMAIL PROTECTED] 11/12/03 3:14 PM >>>
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.

But that is the point - Why would you?

It is like using a screwdriver as a hammer because you like
screwdrivers.

> 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 ;-)

Heheh, you will sometimes see stupidity coming disguised as ingenuity -
beware!

Larry


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to