I want to use JSP page to return dynamic xml.The problem I'm facing is that I've model where some values are null and when they are null I don't wont to display them. So I can do following:
if(ampApInfo.getColourcd().equals(null)){ %>
<ColourCd><%= ampApInfo.getColourcd() %></ColourCd>
<%} else if(ampApInfo.getSzWeightColourcd().equals(null)){ %>
<SzWeightColourcd><%= ampApInfo.getSzWeightColourcd() %></SzWeightColourcd>
<%}%> //and so forth
But this makes my code ugly and not practical. Is there a way to avoid that?? Can you please provide me with an example how to do it or point to one. Thanks a lot.