Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bug Interpreting HTML Tag in Java Bean using c:forEach

 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64701
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to the JSTL Specification for the behavior of <cut>. You should easily see what is happening and how to prevent it.
 
Khosrow Moossavi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64701
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the default behavior of <cut> in order to help prevent cross-site scripting security issues.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic