Hi,
In my jsp code, I have three text boxes, defined in the following manner (but all three are within the form/table, vs. the one shown below):
I test them for "nullness" as so:
Now, they always come up as non-null, even if I don't enter any value... I tried testing against "", and got the same result. They DO register as being null when the page is first displayed, but whenever "submit" is clicked, they are mysteriously non-null (I even displayed the getParameter result, and it appeared to be the empty string, so nothing strange is getting imported).
In my jsp code, I have three text boxes, defined in the following manner (but all three are within the form/table, vs. the one shown below):
Code:
<form method="get">
<table border="0" width="700">
<tr>
<td width="550">
<input type="text" name="sAccount" size="25">
</td>
</tr>
...
<tr>
<td width="550">
<input type="submit" value="Submit">
</td>
</tr>
</table>
</form>
I test them for "nullness" as so:
Code:
if ( request.getParameter("sAccount") == null )
{
%>
can't be null...
<%
};
if ( request.getParameter("sPassword") == null )
{
%>
can't be null...
<%
};
if ( request.getParameter("sDatabase") == null )
{
%>
database can't be null...
<%
};
Now, they always come up as non-null, even if I don't enter any value... I tried testing against "", and got the same result. They DO register as being null when the page is first displayed, but whenever "submit" is clicked, they are mysteriously non-null (I even displayed the getParameter result, and it appeared to be the empty string, so nothing strange is getting imported).