If I may add a comment...
To test if the request parameter "username" does not exist in the JSP page "a-jsp.jsp", we can write an "if" clause in the page "a-jsp.jsp":
http://server/webapp/a-jsp.jsp
or
http://server/webapp/a-jsp.jsp?username=
We won't if the requested URL is:
http://server/webapp/a-jsp.jsp?username=foo