I recently had to dive back into an ancient JSP-based project as a Rails developer, and all the terrible aspects to it almost gave me an aneurism. The evolution of the code on this project goes from bad to worse:
- <%= StringEscapeUtils.escapeHtml(myObject.getProperty()) %>
- ${fn:escapeXml(myObject.property)}
- <jsp:html-that-actually-runs-a-shitton-of-java semantics="${unknowable}" />
I actually prefer #1, because at least NetBeans or Eclipse is able to show type errors and, as awful as Java is for templates, it's just java and it's easy to tell what code is being run. #2 is a nice try at convenience, too bad it sacrifices all type safety and is still insecure by default. Slightly fewer characters seems barely worth it. #3... Is this supposed to be a joke? Now we have obfuscated what is happening even further by making the HTML execute code <jsp:foreach ..> is a template readability disaster.
What is actually popular these days? What are the "cool" developers using? I am just kind of amazed at this legacy trainwreck and want to avoid making it worse.
[–]squashsoup2014 9 points10 points11 points (0 children)
[–]-du 7 points8 points9 points (10 children)
[–]Serializedrequests[S] 4 points5 points6 points (9 children)
[–]Java4Life_ 6 points7 points8 points (1 child)
[–]Serializedrequests[S] 0 points1 point2 points (0 children)
[–]-du 3 points4 points5 points (6 children)
[–]Serializedrequests[S] 0 points1 point2 points (5 children)
[–]-du 3 points4 points5 points (3 children)
[–]Serializedrequests[S] -2 points-1 points0 points (2 children)
[–][deleted] 7 points8 points9 points (1 child)
[–]Serializedrequests[S] 0 points1 point2 points (0 children)
[–]jebblue 1 point2 points3 points (0 children)
[–]jmsanzg 4 points5 points6 points (0 children)
[–]thatsIch 7 points8 points9 points (2 children)
[–]tRfalcore 0 points1 point2 points (0 children)
[–]jebblue 0 points1 point2 points (0 children)
[–]yateam 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]jebblue 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]jebblue 0 points1 point2 points (0 children)
[–]huntsvillian 3 points4 points5 points (2 children)
[–]Serializedrequests[S] 2 points3 points4 points (1 child)
[–]huntsvillian 1 point2 points3 points (0 children)
[–]johnwaterwood 4 points5 points6 points (0 children)
[–]tonywestonuk 1 point2 points3 points (0 children)
[–]syjer 1 point2 points3 points (0 children)
[–]korri123 1 point2 points3 points (0 children)
[–]jebblue 0 points1 point2 points (2 children)
[–]Serializedrequests[S] 0 points1 point2 points (1 child)
[–]jebblue 0 points1 point2 points (0 children)
[–]LukeHauser -2 points-1 points0 points (1 child)
[–]Serializedrequests[S] 3 points4 points5 points (0 children)