I am getting a weird error of page constantly fluctuating between nullpointerexception to actual execution on every form submit. I am writing a simple jsp page and running it on tomcat 5.x server. I am taking data from text field of a form and processing it upon form submit. Here is the code I am trying:
form id="mainForm" method=POST action="index.jsp">
<input type="text" name="reportName" size=20>
<a class="btnBlue btnBlueRight" href="#" onclick="document.getElementById('mainForm').submit();" >
<%
if(request.getParameter("reportName")!=null){
//do things
else
//print message
%>
for this code, page address in address bar is localhost:8080/# or localhost:8080/index.jsp for every form submit. I am new to jsp so could not resolve this.