• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to stop my return string from being encoded?

 
Dan Acuff
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>.
 
Dan Acuff
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JSF forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic