aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Can't use pageContext.setAttribute in Scriptlet by Intellij Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Can Watch "Can New topic
Author

Can't use pageContext.setAttribute in Scriptlet by Intellij

pkinuk Buler
Ranch Hand

Joined: May 22, 2009
Posts: 63
Hi all,

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?

Thank you in advance.




Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
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?
pkinuk Buler
Ranch Hand

Joined: May 22, 2009
Posts: 63
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

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

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
17: list.add("1");
18: list.add("2");
19: list.add("3");
20: pageContext.setAttribute("list", list);
21:
22: %>
23:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't use pageContext.setAttribute in Scriptlet by Intellij