Note that there are some explanatory texts on larger screens.

plurals
  1. POnetbeans text not allowed in element form error
    primarykey
    data
    text
    <p>I'm pretty new to HTML and trying to figure the following error: I'm using netbeans (7.4) and I am trying to make a Web project with Servlets. When I use the defaults that we are instructed to use (yes it's a homework assignment, but my issue is ancillary to the actual assignment, so I don't think I'm trying to cheat here), Java 5 EE, it creates index.jsp. If I write HTML in that .jsp file, such as</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Foo&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;/head&gt; &lt;body&gt; &lt;form action="http://localhost:8084/MyProject/MyClass" method=GET&gt; How many Foos and Bars? &lt;select name="Foo"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;/select&gt; &lt;select name="Bar"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>it works perfectly fine. However, we are told to use .html files instead of .jsp files, and when I copy this file over (from a .jsp to a .html), without the following line (which causes it's own error if included)</p> <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt; </code></pre> <p>then Netbeans tells me:</p> <pre><code>"Text not allowed in element 'form' in this context" </code></pre> <p>So how do I get text in-between some of my form-fields, when it is an HTML document, not a .jsp?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload