JSP page pass value is space but not null and List is empty and not null

    When the JSP value is passed, there is no content in the input of the front-end page, but the null value cannot be obtained.

if(title.equals("")){
                title = null;
            }
            if(content.equals("")){
                content = null;
            }
            if(author.equals("")){
                author = null;
            }
            if(type.equals("")){
                type = null;
            }

        Another situation is that there is no object in the List, but the list is not empty, and the List object is displayed as [] in the background. This is because the List object has been instantiated and points to an empty object. If you want to judge whether there is an object in the List, you can use the list.size() method to judge. If there is no object in the list, then list.size() will be It is 0, if there is, it is greater than or equal to 1, and it can be judged from this

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326563673&siteId=291194637