Skip to content

Do NOT program Java on the JSP pages! #6

Description

@FreakyBytes

Trac Ticket #6

component: code
owner: martinP,mariam
reporter: martin
created: 2016-06-09 16:59:48
milestone:
type: task
version:
keywords:

You shouldn't put programming code within the JSP stuff. That's super ugly and bad habits. Especially looking at constructs like these:

<% String feedbackUrl = Util.getFeedbackUrl(request); 
if( feedbackUrl != null) { %>
<div id="feedback">
   <a href="<%=feedbackUrl%>" title="feedback"></a>
</div>
<% } %>

or

<div class="col-md-2 col-md-offset-8 col-xs-6 search-result-score">
<% if( search.getAggregationType().equals("DEFAULT") ||  search.getAggregationType().equals("COMB_MNZ") ) { %>
	<fmt:formatNumber value="${result.score * 100}" minFractionDigits="1" maxFractionDigits="1" var="score" />
	score: ${score}%
	<% } %>
</div>

Instead please ONLY use taglibs and expression language! To learn more see for example: http://stackoverflow.com/a/3180202/723540

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions