• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Bug Interpreting HTML Tag in Java Bean using c:forEach

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CategoryModel.java


CategoryAction.java


category.jsp


The thing is everything ok, and the array of bean is generated correctly and with forEach item i can iterate through the array, and show them. But the ${item.subcategoryDescr} is written exactly as the code above on the screen. The <A> Tag is not interpreted into the Html, in order to show the result. the page is like this:



which should be like :


I put some html tag in bean object, and try to show them on the page, which it worked correctly. but for the Array Object, and forEach tag, it's not work correctly?

Could you see where I was doing something wrong?
[ November 28, 2008: Message edited by: Khosrow Moossavi ]
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refer to the JSTL Specification for the behavior of <c:out>. You should easily see what is happening and how to prevent it.
 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Mr. Sheriff!
I really didn't expect that would be the source of my problem.
 
Bear Bibeault
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's the default behavior of <c:out> in order to help prevent cross-site scripting security issues.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic