Re: Servlet Response formatting in IE

2013-05-01 Thread Andrey
servlet side:

private String encodeXMLContent(String encodedContent) {
encodedContent = encodedContent.replace("<", "<");
encodedContent = encodedContent.replace(">", ">");
return encodedContent;
}

On the client side 
private String decodeUploadContent(String xml) {
String result = xml.toLowerCase();
result = result.replace("<", "<");
result = result.replace(">", ">");
result = result.replace("", "");
result = result.replace("", "");
return result;
}

суббота, 20 декабря 2008 г., 1:05:42 UTC+3 пользователь D L H написал:
>
> Hello. 
>
> I have a Java servlet that reads an xml-based file and sends the 
> contents to my gwt application as an HttpServletResponse. I have the 
> content type set to text/plain in the servlet. On the client side I 
> use event.getResults() inside the onSubmitComplete method of the form 
> handler. 
>
> Everything runs smoothly in Firefox, but when I tested in IE7, it 
> would not work properly. I used a Label for debugging to see what 
> exactly the application was reading from the servlet, and in IE i'm 
> getting a buncha HTML stuff like this: 
>
>   xml version="1.0" ?> SPAN>  
>
> How do I get IE7 to format my servlet response as plain text instead 
> of html?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Servlet Response formatting in IE

2008-12-22 Thread D L H

String results = event.getResults().substring(1);
String[] caseReplace = {"TAG1", "TAG2", "TAG3", ... };
for(int i=0; i wrote:
> I took out the  at the top of 
> myxmldocument and it fixed the problem I was having, but then I think I
> had the same problem you were having. IE seemed to be taking out every
> tag it found until it got to a bit of text. In mycase, this omitted
> the first 166 characters of myxmldocument.
>
> Since it appeared to include the first bit of text and everything
> afterwards, I just put an "a" in front of thexmlstring. Then I used
> substring(1) on thexmlstring. That fixed my problems but created a
> new one, IE made all my tag names uppercase, so myxmlparsing no
> longer works properly. Now I need a workaround for thecase-
> sensitivity of getElementsByTagName(String).
>
> I hate IE.
>
> -DLH
>
> On Dec 22, 11:46 am, gregor  wrote:
>
> > That might work if you stick say 20 or 30 chars in front of it, enough
> > for IE to give up and say "I don't know what this is, pass it on".
>
> > On Dec 22, 4:35 pm, D L H  wrote:
>
> > > Yeah it looks like IE is trying to actually format thexmlto display
> > > it on the page. If I stick another character in front of thexml
> > > string I get this result from IE:
>
> > > 
> > > TheXMLpage cannot be displayed
> > > Cannot viewXMLinput using style
> > > sheet. Please correct the error and then click the  > > href="javascript:location.reload()" target=_self>Refresh button,
> > > or try again later.
> > > 
>
> > > Invalid at the top level of the
> > > document. Error processing resource 'http://localhost:/
> > > com.proprintsgear.design_lab.test6/loadXml'. Line 1, Position 1  > > P>{ > > version="1.0" encoding="UTF-8"?>
> > > etc...
>
> > > I'll try playing around with JSON. Thanks for your response, gregor.
>
> > > -DLH
>
> > > On Dec 22, 10:42 am, gregor  wrote:
>
> > > > Hi DLH,
>
> > > > I had a similar problem a couple of months ago trying to return anXML
> > > > string from a file upload servlet in IE. In mycaseIE appeared to be
> > > > consuming the first 20/30 chars of theXMLtext before my
> > > > onSubmitComplete() could get its hands on it thus rendering it un-
> > > > parsable. I went through just about every tip on the group relating to
> > > > this in various combination ("text/html" is definitely right, but
> > > > still didn't work for me) for a frustrating day to no avail. I came to
> > > > the conclusion that IE was trying to be "helpful" by interpreting the
> > > > markup itself and screwing it up rather than just leaving it alone. I
> > > > imagine there is a way to get round this but it is not clear to me
> > > > what. As you can see, this is a different but related problem to
> > > > yours, which suggests that IE can be awkward and unpredictable with
> > > >XMLresponses.
>
> > > > Next morning I decided to learn JSON, which I had never used before,
> > > > and between the simple flexjson lib and GWT JSON parser I had it
> > > > working within a couple of hours and was delighted to see that IE
> > > > completely ignored the JSON return strings in all cases. Personally I
> > > > will not bother withXMLagain.
>
> > > > Unfortunately JSON doesn't sound like a solution for you, and I'm
> > > > sorry I don't have the "real" answer. One thing that might work if all
> > > > else fails is to put yourXMLinside a JSON response as a single text
> > > > field, dig it out using the GWT JSON parser, then use the GWTXML
> > > > parser on it. Horrible I know, but it will probably stop IE
> > > > interfering with your response.
>
> > > > regards
> > > > gregor
>
> > > > On Dec 22, 2:35 pm, D L H  wrote:
>
> > > > > Hmm I think that's how I had it originally. I just changed it to text/
> > > > > html again, and it didn't seem to have any effect.
>
> > > > > public class LoadXmlServlet extends HttpServlet {
> > > > >         protected void doPost(HttpServletRequest request, 
> > > > > HttpServletResponse
> > > > > response) throws java.io.IOException {
> > > > >                 response.setContentType("text/html");
> > > > >                 ServletOutputStream out = response.getOutputStream();
> > > > >                 //StringWriter sw = new StringWriter();
> > > > >                 //PrintWriter pw = new PrintWriter(sw);
>
> > > > >                 DiskFileItemFactory factory = new 
> > > > > DiskFileItemFactory();
> > > > >                 ServletFileUpload upload = new 
> > > > > ServletFileUpload(factory);
>
> > > > >                 List items;
> > > > >                 try {
> > > > >                         items = upload.parseRequest(request);
> > > > >                         FileItem item = (FileItem)items.get(0);
> > > > >                         out.print(item.getString());
> > > > >                 } catch(FileUploadException e) {
> > > > >                         //e.printStackTrace(pw);
> > > > >                         //out.print(sw.toString());
> > > > >                 }
> > > > >         }
>
> > > > > }
>
> > > > > 

Re: Servlet Response formatting in IE

2008-12-22 Thread D L H

I took out the  at the top of my
xml document and it fixed the problem I was having, but then I think I
had the same problem you were having. IE seemed to be taking out every
tag it found until it got to a bit of text. In my case, this omitted
the first 166 characters of my xml document.

Since it appeared to include the first bit of text and everything
afterwards, I just put an "a" in front of the xml string. Then I used
substring(1) on the xml string. That fixed my problems but created a
new one, IE made all my tag names uppercase, so my xml parsing no
longer works properly. Now I need a workaround for the case-
sensitivity of getElementsByTagName(String).

I hate IE.

-DLH

On Dec 22, 11:46 am, gregor  wrote:
> That might work if you stick say 20 or 30 chars in front of it, enough
> for IE to give up and say "I don't know what this is, pass it on".
>
> On Dec 22, 4:35 pm, D L H  wrote:
>
> > Yeah it looks like IE is trying to actually format the xml to display
> > it on the page. If I stick another character in front of the xml
> > string I get this result from IE:
>
> > 
> > The XML page cannot be displayed
> > Cannot view XML input using style
> > sheet. Please correct the error and then click the  > href="javascript:location.reload()" target=_self>Refresh button,
> > or try again later.
> > 
>
> > Invalid at the top level of the
> > document. Error processing resource 'http://localhost:/
> > com.proprintsgear.design_lab.test6/loadXml'. Line 1, Position 1  > P>{ > version="1.0" encoding="UTF-8"?>
> > etc...
>
> > I'll try playing around with JSON. Thanks for your response, gregor.
>
> > -DLH
>
> > On Dec 22, 10:42 am, gregor  wrote:
>
> > > Hi DLH,
>
> > > I had a similar problem a couple of months ago trying to return an XML
> > > string from a file upload servlet in IE. In my case IE appeared to be
> > > consuming the first 20/30 chars of the XML text before my
> > > onSubmitComplete() could get its hands on it thus rendering it un-
> > > parsable. I went through just about every tip on the group relating to
> > > this in various combination ("text/html" is definitely right, but
> > > still didn't work for me) for a frustrating day to no avail. I came to
> > > the conclusion that IE was trying to be "helpful" by interpreting the
> > > markup itself and screwing it up rather than just leaving it alone. I
> > > imagine there is a way to get round this but it is not clear to me
> > > what. As you can see, this is a different but related problem to
> > > yours, which suggests that IE can be awkward and unpredictable with
> > > XML responses.
>
> > > Next morning I decided to learn JSON, which I had never used before,
> > > and between the simple flexjson lib and GWT JSON parser I had it
> > > working within a couple of hours and was delighted to see that IE
> > > completely ignored the JSON return strings in all cases. Personally I
> > > will not bother with XML again.
>
> > > Unfortunately JSON doesn't sound like a solution for you, and I'm
> > > sorry I don't have the "real" answer. One thing that might work if all
> > > else fails is to put your XML inside a JSON response as a single text
> > > field, dig it out using the GWT JSON parser, then use the GWT XML
> > > parser on it. Horrible I know, but it will probably stop IE
> > > interfering with your response.
>
> > > regards
> > > gregor
>
> > > On Dec 22, 2:35 pm, D L H  wrote:
>
> > > > Hmm I think that's how I had it originally. I just changed it to text/
> > > > html again, and it didn't seem to have any effect.
>
> > > > public class LoadXmlServlet extends HttpServlet {
> > > >         protected void doPost(HttpServletRequest request, 
> > > > HttpServletResponse
> > > > response) throws java.io.IOException {
> > > >                 response.setContentType("text/html");
> > > >                 ServletOutputStream out = response.getOutputStream();
> > > >                 //StringWriter sw = new StringWriter();
> > > >                 //PrintWriter pw = new PrintWriter(sw);
>
> > > >                 DiskFileItemFactory factory = new DiskFileItemFactory();
> > > >                 ServletFileUpload upload = new 
> > > > ServletFileUpload(factory);
>
> > > >                 List items;
> > > >                 try {
> > > >                         items = upload.parseRequest(request);
> > > >                         FileItem item = (FileItem)items.get(0);
> > > >                         out.print(item.getString());
> > > >                 } catch(FileUploadException e) {
> > > >                         //e.printStackTrace(pw);
> > > >                         //out.print(sw.toString());
> > > >                 }
> > > >         }
>
> > > > }
>
> > > > On Dec 21, 9:40 pm, "todd.sei...@gmail.com" 
> > > > wrote:
>
> > > > > It looks like you are using a FormPanel. For IE to work you need to
> > > > > have your response content type be set to text/html. This will work
> > > > > for the other browsers as well.
>
> > > > > On Dec 19, 5:05 pm, 

Re: Servlet Response formatting in IE

2008-12-22 Thread gregor

That might work if you stick say 20 or 30 chars in front of it, enough
for IE to give up and say "I don't know what this is, pass it on".

On Dec 22, 4:35 pm, D L H  wrote:
> Yeah it looks like IE is trying to actually format the xml to display
> it on the page. If I stick another character in front of the xml
> string I get this result from IE:
>
> 
> The XML page cannot be displayed
> Cannot view XML input using style
> sheet. Please correct the error and then click the  href="javascript:location.reload()" target=_self>Refresh button,
> or try again later.
> 
>
> Invalid at the top level of the
> document. Error processing resource 'http://localhost:/
> com.proprintsgear.design_lab.test6/loadXml'. Line 1, Position 1  P>{ version="1.0" encoding="UTF-8"?>
> etc...
>
> I'll try playing around with JSON. Thanks for your response, gregor.
>
> -DLH
>
> On Dec 22, 10:42 am, gregor  wrote:
>
> > Hi DLH,
>
> > I had a similar problem a couple of months ago trying to return an XML
> > string from a file upload servlet in IE. In my case IE appeared to be
> > consuming the first 20/30 chars of the XML text before my
> > onSubmitComplete() could get its hands on it thus rendering it un-
> > parsable. I went through just about every tip on the group relating to
> > this in various combination ("text/html" is definitely right, but
> > still didn't work for me) for a frustrating day to no avail. I came to
> > the conclusion that IE was trying to be "helpful" by interpreting the
> > markup itself and screwing it up rather than just leaving it alone. I
> > imagine there is a way to get round this but it is not clear to me
> > what. As you can see, this is a different but related problem to
> > yours, which suggests that IE can be awkward and unpredictable with
> > XML responses.
>
> > Next morning I decided to learn JSON, which I had never used before,
> > and between the simple flexjson lib and GWT JSON parser I had it
> > working within a couple of hours and was delighted to see that IE
> > completely ignored the JSON return strings in all cases. Personally I
> > will not bother with XML again.
>
> > Unfortunately JSON doesn't sound like a solution for you, and I'm
> > sorry I don't have the "real" answer. One thing that might work if all
> > else fails is to put your XML inside a JSON response as a single text
> > field, dig it out using the GWT JSON parser, then use the GWT XML
> > parser on it. Horrible I know, but it will probably stop IE
> > interfering with your response.
>
> > regards
> > gregor
>
> > On Dec 22, 2:35 pm, D L H  wrote:
>
> > > Hmm I think that's how I had it originally. I just changed it to text/
> > > html again, and it didn't seem to have any effect.
>
> > > public class LoadXmlServlet extends HttpServlet {
> > >         protected void doPost(HttpServletRequest request, 
> > > HttpServletResponse
> > > response) throws java.io.IOException {
> > >                 response.setContentType("text/html");
> > >                 ServletOutputStream out = response.getOutputStream();
> > >                 //StringWriter sw = new StringWriter();
> > >                 //PrintWriter pw = new PrintWriter(sw);
>
> > >                 DiskFileItemFactory factory = new DiskFileItemFactory();
> > >                 ServletFileUpload upload = new ServletFileUpload(factory);
>
> > >                 List items;
> > >                 try {
> > >                         items = upload.parseRequest(request);
> > >                         FileItem item = (FileItem)items.get(0);
> > >                         out.print(item.getString());
> > >                 } catch(FileUploadException e) {
> > >                         //e.printStackTrace(pw);
> > >                         //out.print(sw.toString());
> > >                 }
> > >         }
>
> > > }
>
> > > On Dec 21, 9:40 pm, "todd.sei...@gmail.com" 
> > > wrote:
>
> > > > It looks like you are using a FormPanel. For IE to work you need to
> > > > have your response content type be set to text/html. This will work
> > > > for the other browsers as well.
>
> > > > On Dec 19, 5:05 pm, D L H  wrote:
>
> > > > > Hello.
>
> > > > > I have a Java servlet that reads an xml-based file and sends the
> > > > > contents to my gwt application as an HttpServletResponse. I have the
> > > > > content type set to text/plain in the servlet. On the client side I
> > > > > use event.getResults() inside the onSubmitComplete method of the form
> > > > > handler.
>
> > > > > Everything runs smoothly in Firefox, but when I tested in IE7, it
> > > > > would not work properly. I used a Label for debugging to see what
> > > > > exactly the application was reading from the servlet, and in IE i'm
> > > > > getting a buncha HTML stuff like this:
>
> > > > >    > > > SPAN>xml version="1.0" ?> > > > > SPAN> 
>
> > > > > How do I get IE7 to format my servlet response as plain text instead
> > > > > of html?
--~--~-~--~~~---~--~~
You received this message

Re: Servlet Response formatting in IE

2008-12-22 Thread D L H

Yeah it looks like IE is trying to actually format the xml to display
it on the page. If I stick another character in front of the xml
string I get this result from IE:


The XML page cannot be displayed
Cannot view XML input using style
sheet. Please correct the error and then click the Refresh button,
or try again later.


Invalid at the top level of the
document. Error processing resource 'http://localhost:/
com.proprintsgear.design_lab.test6/loadXml'. Line 1, Position 1 {
etc...

I'll try playing around with JSON. Thanks for your response, gregor.

-DLH


On Dec 22, 10:42 am, gregor  wrote:
> Hi DLH,
>
> I had a similar problem a couple of months ago trying to return an XML
> string from a file upload servlet in IE. In my case IE appeared to be
> consuming the first 20/30 chars of the XML text before my
> onSubmitComplete() could get its hands on it thus rendering it un-
> parsable. I went through just about every tip on the group relating to
> this in various combination ("text/html" is definitely right, but
> still didn't work for me) for a frustrating day to no avail. I came to
> the conclusion that IE was trying to be "helpful" by interpreting the
> markup itself and screwing it up rather than just leaving it alone. I
> imagine there is a way to get round this but it is not clear to me
> what. As you can see, this is a different but related problem to
> yours, which suggests that IE can be awkward and unpredictable with
> XML responses.
>
> Next morning I decided to learn JSON, which I had never used before,
> and between the simple flexjson lib and GWT JSON parser I had it
> working within a couple of hours and was delighted to see that IE
> completely ignored the JSON return strings in all cases. Personally I
> will not bother with XML again.
>
> Unfortunately JSON doesn't sound like a solution for you, and I'm
> sorry I don't have the "real" answer. One thing that might work if all
> else fails is to put your XML inside a JSON response as a single text
> field, dig it out using the GWT JSON parser, then use the GWT XML
> parser on it. Horrible I know, but it will probably stop IE
> interfering with your response.
>
> regards
> gregor
>
> On Dec 22, 2:35 pm, D L H  wrote:
>
> > Hmm I think that's how I had it originally. I just changed it to text/
> > html again, and it didn't seem to have any effect.
>
> > public class LoadXmlServlet extends HttpServlet {
> >         protected void doPost(HttpServletRequest request, 
> > HttpServletResponse
> > response) throws java.io.IOException {
> >                 response.setContentType("text/html");
> >                 ServletOutputStream out = response.getOutputStream();
> >                 //StringWriter sw = new StringWriter();
> >                 //PrintWriter pw = new PrintWriter(sw);
>
> >                 DiskFileItemFactory factory = new DiskFileItemFactory();
> >                 ServletFileUpload upload = new ServletFileUpload(factory);
>
> >                 List items;
> >                 try {
> >                         items = upload.parseRequest(request);
> >                         FileItem item = (FileItem)items.get(0);
> >                         out.print(item.getString());
> >                 } catch(FileUploadException e) {
> >                         //e.printStackTrace(pw);
> >                         //out.print(sw.toString());
> >                 }
> >         }
>
> > }
>
> > On Dec 21, 9:40 pm, "todd.sei...@gmail.com" 
> > wrote:
>
> > > It looks like you are using a FormPanel. For IE to work you need to
> > > have your response content type be set to text/html. This will work
> > > for the other browsers as well.
>
> > > On Dec 19, 5:05 pm, D L H  wrote:
>
> > > > Hello.
>
> > > > I have a Java servlet that reads an xml-based file and sends the
> > > > contents to my gwt application as an HttpServletResponse. I have the
> > > > content type set to text/plain in the servlet. On the client side I
> > > > use event.getResults() inside the onSubmitComplete method of the form
> > > > handler.
>
> > > > Everything runs smoothly in Firefox, but when I tested in IE7, it
> > > > would not work properly. I used a Label for debugging to see what
> > > > exactly the application was reading from the servlet, and in IE i'm
> > > > getting a buncha HTML stuff like this:
>
> > > >    > > SPAN>xml version="1.0" ?> > > > SPAN> 
>
> > > > How do I get IE7 to format my servlet response as plain text instead
> > > > of html?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Servlet Response formatting in IE

2008-12-22 Thread gregor

Hi DLH,

I had a similar problem a couple of months ago trying to return an XML
string from a file upload servlet in IE. In my case IE appeared to be
consuming the first 20/30 chars of the XML text before my
onSubmitComplete() could get its hands on it thus rendering it un-
parsable. I went through just about every tip on the group relating to
this in various combination ("text/html" is definitely right, but
still didn't work for me) for a frustrating day to no avail. I came to
the conclusion that IE was trying to be "helpful" by interpreting the
markup itself and screwing it up rather than just leaving it alone. I
imagine there is a way to get round this but it is not clear to me
what. As you can see, this is a different but related problem to
yours, which suggests that IE can be awkward and unpredictable with
XML responses.

Next morning I decided to learn JSON, which I had never used before,
and between the simple flexjson lib and GWT JSON parser I had it
working within a couple of hours and was delighted to see that IE
completely ignored the JSON return strings in all cases. Personally I
will not bother with XML again.

Unfortunately JSON doesn't sound like a solution for you, and I'm
sorry I don't have the "real" answer. One thing that might work if all
else fails is to put your XML inside a JSON response as a single text
field, dig it out using the GWT JSON parser, then use the GWT XML
parser on it. Horrible I know, but it will probably stop IE
interfering with your response.

regards
gregor



On Dec 22, 2:35 pm, D L H  wrote:
> Hmm I think that's how I had it originally. I just changed it to text/
> html again, and it didn't seem to have any effect.
>
> public class LoadXmlServlet extends HttpServlet {
>         protected void doPost(HttpServletRequest request, HttpServletResponse
> response) throws java.io.IOException {
>                 response.setContentType("text/html");
>                 ServletOutputStream out = response.getOutputStream();
>                 //StringWriter sw = new StringWriter();
>                 //PrintWriter pw = new PrintWriter(sw);
>
>                 DiskFileItemFactory factory = new DiskFileItemFactory();
>                 ServletFileUpload upload = new ServletFileUpload(factory);
>
>                 List items;
>                 try {
>                         items = upload.parseRequest(request);
>                         FileItem item = (FileItem)items.get(0);
>                         out.print(item.getString());
>                 } catch(FileUploadException e) {
>                         //e.printStackTrace(pw);
>                         //out.print(sw.toString());
>                 }
>         }
>
> }
>
> On Dec 21, 9:40 pm, "todd.sei...@gmail.com" 
> wrote:
>
> > It looks like you are using a FormPanel. For IE to work you need to
> > have your response content type be set to text/html. This will work
> > for the other browsers as well.
>
> > On Dec 19, 5:05 pm, D L H  wrote:
>
> > > Hello.
>
> > > I have a Java servlet that reads an xml-based file and sends the
> > > contents to my gwt application as an HttpServletResponse. I have the
> > > content type set to text/plain in the servlet. On the client side I
> > > use event.getResults() inside the onSubmitComplete method of the form
> > > handler.
>
> > > Everything runs smoothly in Firefox, but when I tested in IE7, it
> > > would not work properly. I used a Label for debugging to see what
> > > exactly the application was reading from the servlet, and in IE i'm
> > > getting a buncha HTML stuff like this:
>
> > >    > SPAN>xml version="1.0" ?> > > SPAN> 
>
> > > How do I get IE7 to format my servlet response as plain text instead
> > > of html?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Servlet Response formatting in IE

2008-12-22 Thread D L H

Hmm I think that's how I had it originally. I just changed it to text/
html again, and it didn't seem to have any effect.

public class LoadXmlServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse
response) throws java.io.IOException {
response.setContentType("text/html");
ServletOutputStream out = response.getOutputStream();
//StringWriter sw = new StringWriter();
//PrintWriter pw = new PrintWriter(sw);

DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);

List items;
try {
items = upload.parseRequest(request);
FileItem item = (FileItem)items.get(0);
out.print(item.getString());
} catch(FileUploadException e) {
//e.printStackTrace(pw);
//out.print(sw.toString());
}
}
}

On Dec 21, 9:40 pm, "todd.sei...@gmail.com" 
wrote:
> It looks like you are using a FormPanel. For IE to work you need to
> have your response content type be set to text/html. This will work
> for the other browsers as well.
>
> On Dec 19, 5:05 pm, D L H  wrote:
>
> > Hello.
>
> > I have a Java servlet that reads an xml-based file and sends the
> > contents to my gwt application as an HttpServletResponse. I have the
> > content type set to text/plain in the servlet. On the client side I
> > use event.getResults() inside the onSubmitComplete method of the form
> > handler.
>
> > Everything runs smoothly in Firefox, but when I tested in IE7, it
> > would not work properly. I used a Label for debugging to see what
> > exactly the application was reading from the servlet, and in IE i'm
> > getting a buncha HTML stuff like this:
>
> >    SPAN>xml version="1.0" ?> > SPAN> 
>
> > How do I get IE7 to format my servlet response as plain text instead
> > of html?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Servlet Response formatting in IE

2008-12-21 Thread todd.sei...@gmail.com

It looks like you are using a FormPanel. For IE to work you need to
have your response content type be set to text/html. This will work
for the other browsers as well.

On Dec 19, 5:05 pm, D L H  wrote:
> Hello.
>
> I have a Java servlet that reads an xml-based file and sends the
> contents to my gwt application as an HttpServletResponse. I have the
> content type set to text/plain in the servlet. On the client side I
> use event.getResults() inside the onSubmitComplete method of the form
> handler.
>
> Everything runs smoothly in Firefox, but when I tested in IE7, it
> would not work properly. I used a Label for debugging to see what
> exactly the application was reading from the servlet, and in IE i'm
> getting a buncha HTML stuff like this:
>
>   xml version="1.0" ?> SPAN> 
>
> How do I get IE7 to format my servlet response as plain text instead
> of html?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---