I've got an index.jsp with
[snip]
<%
String name = request.getParameter("name");
String pass = request.getParameter("pass");
String globalname = "webeng";
String globalpass = "2009";
if (name !=null && pass!=null && name.equals(globalname) && pass.equals(globalpass))
{
%>
<hr />
<p><b>Howdy, <%= request.getParameter("name") %></b></p>
<hr />
<% }
else if (name !=null | pass!=null && name.equals("") | pass.equals(""))
{
%>
<hr />
<p><b>Ooops, one or more fields are empty. Please fill everything out!!</b></p>
<hr />
<% }
else if (name !=null | pass!=null && !name.equals(globalname) | !pass.equals(globalpass))
{
%>
<hr />
<p><b>Incorrect Userdata!</b></p>
<hr />
<% }
else{
}
%>
[snip]
Now, the globalname for example is in lowercase "webeng". Folks may type in "WebEng", "webENG", "WEBENG" and variations thereof.
I need those typed in Strings converted to lowercase. Somehow
String newname = name.toLowerCase();
String newpass = pass.toLowerCase();
is not working. Anybody got any idea?
This is what Eclipse tells me when I use
<%
String name = request.getParameter("name");
String pass = request.getParameter("pass");
String globalname = "webeng";
String globalpass = "2009";
String newname = name.toLowerCase();
String newpass = pass.toLowerCase();
if (name !=null && pass!=null && name.equals(globalname) && pass.equals(globalpass))
{
%>
<hr />
<p><b>Howdy, <%= request.getParameter("name") %></b></p>
<hr />
<% }
else if (name !=null | pass!=null && name.equals("") | pass.equals(""))
{
%>
<hr />
<p><b>One or more fields are empty!</b></p>
<hr />
<% }
else if (name !=null && pass!=null && !name.equals(globalname) | !pass.equals(globalpass))
{
%>
<hr />
<p><b>Incorrect Userdata!</b></p>
<hr />
<% }
else{
}
%>
Eclipse: http://i.imagehost.org/0277/2009-11-15%5F19%5F34%5F00.png