if with null


Web tier: servlets, JSP, Web frameworks: if with null

  1. if with null (1 messages)

    I have a file called add.jsp, the form that has the input fields and the
    action processing are all in this file, what I want is :
    when this file is for the first time displayed it will not be processed but
    only show the form, The problem is when I filled up all the fields and I
    submit the if statment never executed.


    String ipaddress = request.getParameter("ipaddress");
    System.out.println("ipaddress ================" + ipaddress);
    String user = request.getParameter("user");
    String newname = request.getParameter("newname");
    String jack = request.getParameter("jack");
    String os = request.getParameter("os");
    String pc = request.getParameter("pc");
    String processor = request.getParameter("processor");
    String memory = request.getParameter("memory");
    String domain = request.getParameter("domain");
    <% if ( (ipaddress!=null)&& (user!=null)&& (newname!=null)&& (jack !=null)&&
    (os !=null)&&
           (pc !=null)&& (processor!=null)&& (memory !=null)&& (domain !=null))
                   { %>

    <% } %>

    <form method="POST" action="add.jsp">
    input fields here


    Threaded Messages (1)

  2. if with null[ Go to top ]

    try this.........

    if ("POST".equals(request.getMethod())) {
    All your request.getParameter();