Why won't <BR> stick in out statement ?

From: Andrew Rich (vk4tec_at_hotmail.com)
Date: 02/18/05


Date: Fri, 18 Feb 2005 21:39:18 +1000

My java keeps saying that the <BR> is unterminated

Why ?

It is just a string

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<jsp:directive.page import="java.sql.*" />
<HTML>
    <HEAD>
        <TITLE>JDBC scriptlet example</TITLE>
    </HEAD>
    <BODY>
        <jsp:scriptlet>
            Class.forName("com.mysql.jdbc.Driver");
            Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/smtrack", "", "");
            Statement statement = connection.createStatement();
            ResultSet rs = statement.executeQuery("select region from
sm04022005");
            int numCols = rs.getMetaData().getColumnCount ();
            while (rs.next())
            {
            out.print(" Region=" + rs.getString("region") + "<br>");
            }
            statement.close();
            connection.close();
        </jsp:scriptlet>
        <jsp:expression>numCols</jsp:expression>
    </BODY>
</HTML>



Relevant Pages

  • Re: soooo many questions!
    ... takes to create a dropdown HTML menu in Java, ... as a string via the toString ...
    (comp.lang.java.beans)
  • Re: Problem passing text from php to java applet via HTML param tag
    ... to a String variable in a java applet. ... I tried using a string literal in my php echo ... attribute value, which would make this an HTML issue, not a PHP ...
    (comp.lang.php)
  • MVC in JSP (was: template in servlet)
    ... JSP = viel HTML mit wenig Java ... ... HTML ins JSP, ... public void setUser(String user) { ...
    (de.comp.lang.java)
  • Re: ArrayIndexOutOfBoundsException: -1 stack periodically occurs
    ... are a number of issues within JEditorPane itself inasmuch as how it ... handles HTML. ... Java seems to provide no way of cleaning ... public SimpleHTMLRenderableEditorPane(String type, String text) { ...
    (comp.lang.java.help)
  • Re: Generating html or xhtml
    ... >javax.swing.text.html API but don't quite get how it all works. ... You only need JTextPane etc. to render the html. ... public static String withClass(String cssClass, ... http://mindprod.com Again taking new Java programming contracts. ...
    (comp.lang.java.help)