title: Pass Html code from Controller to JSP
body: <p>I want to pass html data from Controller to JSP.</p>
  
  <p>I am using <code>Spring MVC</code> and <code>'Spring Validator'</code> populates messages on the JSP:</p>
  
  <pre><code>@Override
      public void validate(Object target, Errors errors) {
  //Some processing     
  errors.rejectValue("fileData", "errors.csi.invalidurl", new Object[] { url }, null);
  }
  </code></pre>
  
  <p>message.properties</p>
  
  <pre><code>errors.csi.invalidurl=File contained invalid URLs. Please find list of invalid URLs &lt;a href="{0}"&gt; here&lt;/a&gt;.
  </code></pre>
  
  <p>Corresponding JSP is:</p>
  
  <pre><code>&lt;div class="row"&gt;
  &lt;label for="upload-file"&gt;&lt;spring:message code="csi.label.uploadfile"/&gt;&lt;/label&gt;&lt;form:input path="fileData" type="file"/&gt;
  &lt;form:errors path="fileData" cssClass="error"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am able to pass text data but unable to pass href links. How could it be done?</p>
  
  <p>I tried</p>
  
  <pre><code>String url = "javascript:getImageValidationPresignedURLForDownload('8162')"; to be passed as text data but it is displayed as text.
  
  URLs &lt;a href="javascript:getImageValidationPresignedURLForDownload('8162')"&gt; here&lt;/a&gt;.
  </code></pre>
  
  <p>What am I doing wrong? How could it be done?</p>
  
  <p>Thanks,</p>