Hi all,
I have some questions about running a Java application from a JSP page. I have a class, package.Main. I want to run this, i.e. invoke it's main method, then I want to use a Bean for another class, package.Class1, and call some of the methods there. This brings me to some questions.
1) On
one JSP page, can I use two Beans (jsp:useBean), one for package.Main, another for package.Class1?
2) If so, how would I run the main method of package.Main? Would I simply say
Main.main();
on my JSP page?
3) If I use a Bean with scope="session" for each of the two aforementioned classes, the classes will be 'running', so to speak, throughout the entire session, correct? In case that is vague, let me provide an example.
In my Main class, I have
private byte[] in;
which gets instantiated after the main method executes. I also have a getter method for that byte[], Main.getByteArray(), inside the Main class. Therefore, if I run Main.main() from my JSP page, and want to call Main.getByteArray() immediately afterwards, will
byte[] in
still be instantiated?
Thanks for any help,
Dan
Message was edited by:
Djaunl