The exception is telling you that the JSP and bean are doing something out
of the proper sequence. Setting the response type after sending some output
is the most likely cause.
What you're doing can be made to work. I used to do JSP work exactly this
way. But since getting all this sorted out is going to be a lot of work
anyway, you really should consider moving to something better than JSP.
See http://virtualschool.edu/wap for the rationale and code.
If you want to use dynamic binding between code and presentation, consider
integrating JWAP and Velocity (or similar template engine) as outlined
there.
On Saturday, June 16, 2001, at 06:47 PM, Martin Smith wrote:
> This is probably dumb, but . . .
>
> I am trying to re-do a "model 1" JSP app to do at least minimal
> separation between presentation and scriptlets.
>
> So, I extracted all the java from my JSP and put it into a java class.
>
> Since the work I want to do in the class (doing a parameterized
> retrieval into an LDAP directory) depends on lots of values I get from
> the jsp request object, I thought I'd pass that object to the class from
> within the JSP, like:
>
> <% myjavaclass w = new myjavaclass(request); %>
>
> Problem: I get an Illegalstateexception from the JSP compiler, saying
> the "response is already committed."
>
> OK, that sounds like the issues discused with the JSP Forward
> directive: can't forward once you start outputting the response object
> from a JSP.
>
> So, am I in a blind alley here? Can I not send the request object off
> to a java class?
>
> I suppose I could extract all the query parameters I need to pass and
> package them into a hashtable, but you recall I was trying to eliminate
> scriptlets in the first place . . .
>
> TIA,
>
> Martin
>
> =========================================================================
> ==
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
---
For industrial age goods there were checks and credit cards.
For everything else there it http://virtualschool.edu/mybank
Brad Cox [EMAIL PROTECTED] 703 361 4751
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets