JSP cannot be resolved to a type

后端 未结 1 1035
無奈伤痛
無奈伤痛 2021-01-18 09:14
<%@ page import =\"java.util.*\" %>
<%@ page import =\"book.*\" %>


ArrayList movies = (ArrayList) request.getAttribute(\"movieinfo\");

    if(movies!=         


        
1条回答
  •  一向
    一向 (楼主)
    2021-01-18 09:47

    Look at your movie class definition . It is packaged inside movie package.

    package movie; // full class name will be movie.movie
    import java.util.Date;
    public class movie { ......
    }
    

    You should import the movie class as :

    <%@ page import ="movie.movie" %>
    

    Even then writing Java code inside JSP is highly discouraged . Read How to avoid Java Code in JSP-Files?.

    For your purpose you can use JSTL's loop.

    0 讨论(0)
提交回复
热议问题