aspose file tools*
The moose likes JSF and the fly likes how to stop my return string from being encoded? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to stop my return string from being encoded?" Watch "how to stop my return string from being encoded?" New topic
Author

how to stop my return string from being encoded?

Dan Acuff
Ranch Hand

Joined: Jul 13, 2009
Posts: 62
The < and > symbols are being changed to < and > in my return string.
So on my HTML page I am literally seeing on the page:

<script language='javascript1.2' src='/webstore/newshop/coremetrics/v40/eluminate.js'></script><script language='javascript1.2' src='/webstore/newshop/coremetrics/cmdatatagutils.js'></script><script language='javascript1.2'>cmSetClientId('90313131',true,newshop.com); </script>

Instead of it being part of the HTML like I want.

How can I prevent this in my java class?

Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Your java code is not converting the html entities and you're not providing us with the type of application so we'll have to guess. In case of JSF you could use


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Dan Acuff wrote:How can I prevent this in my java class?

You can't, because it's not happening in the Java class.

As Wouter pointed out, without showing us how the returned result is being used, all we can do is guess. My guess is improper use of <c:out>.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dan Acuff
Ranch Hand

Joined: Jul 13, 2009
Posts: 62
Sorry about not showing how I am using it in the application.

I am using JSF.

I tried but I am still getting a conversion and it is actually displaying the string in my web browser.

UPDATE:

I got it to work:


Thanks for the help!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Moved to the JSF forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to stop my return string from being encoded?