views:

72

answers:

0

I am using the following code to generate and compile java program inside another java program:

import javax.tools.*;
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
compiler.run(null, null, null, "-classpath", classpath, souce_files_directory+"WebManager.java");

Inside the WebManager.java file I use regular HttpSesion method for setting attribute:

session.setAttribute("order_list", session.setAttribute("order_list", sqlManager.getOrder(""));

sqlManager.getOrder("") returns the java.util.List. This method works fine when compiling via regular compiler method (e.g. javac)

The error is:

R D:\RAD_7.5.4_workspace\Application\WebContent\WEB-INF\classes\WebManager.java:81: cannot find symbol
symbol  : method setAttribute(java.lang.String,java.util.List)
    SystemErr     R location: interface javax.servlet.http.HttpSession
    SystemErr     R                                         session.setAttribute("order_list", sqlManager.getOrder(""));

Any thoughts?