as of now, i don't want to transfer the objects from web application to command line.
i just need to refer the object that are in tomcat container.
Joined: Mar 22, 2005
What do you mean by "refer the object"? There's no such thing as having a reference to an object that lives in another JVM (unless you want to get into RMI or some such technology - do you?). Maybe you can explain in more detail what you're trying to achieve.
That sounds a bit as if an order is given ... probably not what you intended.
Joined: Jun 19, 2008
"do reply" mean that means please accept my apologize and "I AM REALLY SORRY"...
as i explained earlier, if i say application.setAttribtue("A", new String("A")) in jsp. can i get the attribute A in a swing application which is running in the same machine as tomcat runs.
Ok. Well your only real solution for one JVM talking to another is RMI. A big hammer to crack a small nut I reckon, but if you can't use a file you don't really have any other options.
One thing I will say, you say going to a file or databate is a costly operation. This sounds like an early optimisation. Have you tested how costly iti s in the context of your application? RMI is not free either.
Joined: Jun 19, 2008
Thanks for your reply.
If its DB or file, i need to do I/O operation.
If its RMI at least i can reduce I/O operation, right.
I will use RMI itself for accessing the application.
RMI is still I/O. It's just network I/O instead of disk I/O.
Actually, what it sounds like you need is Enterprise JavaBeans. However, Tomcat isn't an EJB container. But it's likely to be more trouble than it's worth to get an RMI server running in Tomcat, so what I'd recommend is that you look at a full JEE server like JBoss, WebSphere, WebLogic, or Oracle's OC4J. JBoss (and the JOnAS server from Objectweb) can use Tomcat (or jetty) as their servlet/jsp containers, but add the additional infrastructure to allow you to code your sharable resources as EJBs and access them from external applications. It's a lot faster and more reliable than re-inventing all that stuff yourself.
Customer surveys are for companies who didn't pay proper attention to begin with.