I am guessing its because you have already opened the stream by calling the resp.setContentType("text/plain"); method, and are then trying to get a Writer object. You can either use Stream based classes, or Writer based classes - not both.
Either remove the setContentType(), or send the response using response.getOutputStream() method. That should solve the problem. --sri On Sep 10, 3:02 am, 6real <xirgon...@gmail.com> wrote: > Dear all, > > I met an issue with my servlets, then I try the demo servlet given by > Google : > > ------- > import java.io.IOException; > import javax.servlet.http.HttpServlet; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > public class MyServlet extends HttpServlet { > public void doGet(HttpServletRequest req, HttpServletResponse > resp) > throws IOException { > resp.setContentType("text/plain"); > resp.getWriter().println("Hello, world"); > }} > > -------- > > And I still raise an exception when invoking the method getWriter : > > java.lang.IllegalStateException: STREAM > at org.mortbay.jetty.Response.getWriter(Response.java:583) > at ..... > > Can anyone help me ? Is there a workaround ? > > For information my environment is : > - Mac OS X 10.5.6 > - I downgraded my default JVM to the JAVA 5 32 bits version (else I > couln't launch GWT app in hosted mode ...). > > Thanks for your help. > > C. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---