jsp - Print all bean properties in EL without need to override toString() every time -


i have list/map of beans in el, or @ least assume , i'm fed spending hours going through trying work out sections belong each other. print plain ${example}.

football.beans.footballfixture@72bec69[match=football.domain.footballmatch@773aa1d5[id=360496,competition=premiership,seasonid=2011,groupname=,roundtype=,roundnumber=,matchperiod=full_time,matchday=3,venueid=33,venue=white hart lane,venuecity=london,hometeamid=t6,awayteamid=t43,homescore=1,awayscore=5,scorers=[football.domain.score@3d5bed54[567825,away,2011-08-28 14:05:05.0,34,goal,dzeko,,first_half

currently overriding tostring() on beans every time. it'd great have similar php's print_r in jsp. know how stop eternal headache caused problem.

import jackson json library , (assuming "mylist" list/map have defined):

 objectmapper mapper = new objectmapper();  system.out.println( mapper.defaultprettyprintingwriter().writevalueasstring(mylist) ); 

this print out complete list object string standard out.

hope helps.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -