<h4>Welcome <%request.getParameter("loginname");%></h4>
The above line should be, <%= session.getAttribute("loginname") %>, i guess...
Also, I can't understand why you are checking the username and password null condition in an JSP, you could just check it in an
servlet and then forward to welcome.jsp, if the condition is met, which would make the code and logic more clear...