You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by JimP <ji...@gmail.com> on 2008/02/12 17:19:48 UTC
Shale Remoting returning "text/XML"
I am trying to use Shale remoting to do AJAX calls from my JSF backing beans
for the first time. I have previously used servlets for AJAX calls. Shale
remoting is much better, but I am having a terrible time returning XML to
the javascript. The XML always contains the special characters >, <,
" etc instead of the real characters which makes it impossible to parse
in the javascript. I have tried everything I can think of to get the XML
returned without this characters. I have the line : ResponseWriter
writer =(new ResponseFactory()).getResponseWriter(context, "text/xml"); in
my faces bean. I don't have this problem using servlets that uses the line
java.io.PrintWriter out=response.getWriter() to return. Can someone give
me a tip on how to get the pure XML that I can parse into the javascript?
Thanks
--
View this message in context: http://www.nabble.com/Shale-Remoting-returning-%22text-XML%22-tp15434530p15434530.html
Sent from the Shale - User mailing list archive at Nabble.com.
Re: Shale Remoting returning "text/XML"
Posted by JimP <ji...@gmail.com>.
I am writing directly to it: ResponseWriter writer =(new
ResponseFactory()).getResponseWriter(context, "text/xml");
try {
writer.startDocument();
writer.writeText(text, null);
writer.endDocument();
writer.close();
}
Greg Reddin-4 wrote:
>
> On Feb 12, 2008 10:19 AM, JimP <ji...@gmail.com> wrote:
>>
>> returned without this characters. I have the line :
>> ResponseWriter
>> writer =(new ResponseFactory()).getResponseWriter(context, "text/xml");
>> in
>> my faces bean.
>
> Did you set the ResponseWriter on the FacesContext using:
>
> facesContext.setResponseWriter(writer);
>
> Or did you try writing to the ResponseStream directly?
>
> Greg
>
>
--
View this message in context: http://www.nabble.com/Shale-Remoting-returning-%22text-XML%22-tp15434530p15441497.html
Sent from the Shale - User mailing list archive at Nabble.com.
Re: Shale Remoting returning "text/XML"
Posted by Greg Reddin <gr...@gmail.com>.
On Feb 12, 2008 10:19 AM, JimP <ji...@gmail.com> wrote:
>
> returned without this characters. I have the line : ResponseWriter
> writer =(new ResponseFactory()).getResponseWriter(context, "text/xml"); in
> my faces bean.
Did you set the ResponseWriter on the FacesContext using:
facesContext.setResponseWriter(writer);
Or did you try writing to the ResponseStream directly?
Greg