Why is a null displayed in the first row?:-/
I want the first row to display the text value given in the textfield(actually i am getting the text value from database)
Any help??

        <form name="form1">
            <input type="text" name="txtname">
            <input type="submit" value="Click here" name="Click"  onclick="fun(this.form)"/>
        function fun(form1)
       var a='Hello';
        document.write('<center><table width="75%" border="1">'); 
         document.write('<tr align="center"><td>' + <% out.println(request.getParameter("txtname")); %> + '<\/td><td>' +a + '<\/td><\/tr>'); 
          document.write('<tr align="center"><td>' + a + '<\/td><td>' +a + '<\/td><\/tr>'); 

    Null    Hello
    Hello   Hello

Looks like javascript. This is a java forum. They are different.

Because this is null:


Try to learn first jsp before attempting such code. You need to use javascript.
And don't do that:

<% out.println(....); %>

Use <%= ....%> . It is the right way.