This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I tired to set the arraylist object in the PageContext scope by using the ppageContext.setAttribute("list", list ) in a JSP file (the code is listing below), but the Intellij can't compile the code and highlight the method pageContext.setAttribute("list", list ) as "Can't resolve method 'setAttribute(java.lang.String, null)'". I also tried to copy the same jsp file to Eclipse and it worked. Would somebody please tell me how to solve this problem?
What is the point of putting something in the page context in a JSP page? And, going a step further, are you aware that it's considered bad design to keep Java code in JSPs?
Joined: May 22, 2009
Lester Burnham wrote:What is the point of putting something in the page context in a JSP page? And, going a step further, are you aware that it's considered bad design to keep Java code in JSPs?
Thank you for yr reply.
i know that, but i just want to try to write the java code in jsp file. Because i'm a jsp beginner, i just wanted to write the code, which i don't know it's output into the IDE and want to see the result, for the SCWCD.
I've solved that problem by import the tomcat 6 libraries into the project, but now i met another problem. the browser said:
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 20 in the jsp file: /WEB-INF/tags/ButtonLayout.tag
pageContext cannot be resolved
20: pageContext.setAttribute("list", list);