JSP behaving in a strange way. Instead of using css to style the table, it is printing the css

Viewed 27

I am working on an old application where I have been trying to fix this bug. What happens is that it prints the css instead of applying it. I have edited this post and added additional information for the viewer to review

:JSP file

<%@ page language="java" info="Report Build" %>
<%@ page import="com.util.CustomValidator" %>
<jsp:useBean id="mapReport" class="com.bo.MtrMappingReport" />
<html>
<title>Report</title>
<link rel="stylesheet" type="text/css" href="lds.css">

<link rel="shortcut icon" href="*" />

<%  
    String entity = request.getParameter("entity");
    
    if (null != entity)
    {   
        mapReport.setEntity(entity);
        mapReport.buildReport();
    }
    else
    {   
        out.println("Usage error: Required string paramater 'entity' not found.");
        out.println("<br>Usage: reportbuild?entity='<em>Physical_Entity_Name</em>'");
        return;
    }%>
                                                                                    
<body>
<!-- begin of main area -->
<form method="post" action="" name="reportbuild">
<table width="995" height="211">
<%= CustomValidator.cleanString(mapReport.getReport()) %>
  <tr>
    <td width="700" height="26" valign="bottom">
      <input type="button" value=" Close " onClick="parent.window.close()" id="button1" name="button1">
    </td>
  </tr>
  <tr>
    <td width="76" height="22">&nbsp;</td>
    <td width="909" height="22" colspan="2">&nbsp;
    </td>
  </tr>
</table>
</form>
<!-- end of main area -->

</body>
</html>
1 Answers

The problem is in the structure of html document. You can only use <link> tag inside a <head> tag.

<html>
<head>
<title>Report</title>
<link rel="stylesheet" type="text/css" href="lds.css">
</head>
Related