Mary,
You might want to create a backup of your file before you start "commenting out" sections of your code. You must also make sure that you get the comment command correct (try saying that 10 times really fast!).
In JSP you'll need to use "//" at the start of the line. You cannot use:
since this will only comment out the code in the browser. The JSP code will still be executed by the webserver.
Example:
Code:
<!--
<%
out.print("value='"+fname+"'");
%>
-->
This will output (assuming fname=pete):
in the browser, which shouldn't display anything in the browser screen. However, the JSP code has still executed.
You should use:
Code:
<%
// out.print("value='"+fname+"'");
%>
Which will tell the JSP server, not to execute the code following the comment.
Looking at your original post, I have done some further testing. The code (even though it is invalid is still ok to test with):
Code:
<tr>
<td>First Name: </td>
<td><INPUT TYPE="text" name="firstname"
<%
String fname=new String();
fname="pete";
out.println("value='"+fname+"'");
%> >
</td>
when served from a JSP server, performs as expected. The result was:
where the bold "pete" is an input box.
The same code served from the file system performs (as expected) very differently. And yes, an extra HTML bracket is displayed:
Code:
First Name: [blank input box] >
You MUST ensure that JSP files are served from a JSP (Apache-Tomcat is one such example) Server.
What is the URL that you are entering into your browser???
Pete.
Web Developer / Aptrix CMS (LWWCM) Specialist
w:
e: Pete.Raleigh(at)lclimited.co.uk