Code
Code

Reputation: 825

How to run another java code through my servlet?

I want to run another Java code in my servlet and wait till its execution completes.

enter image description here

In the image, I want to run RSAKeyGenerator.java in my Servlet.java and wait for it to complete execution.

The servlet.java has a normal servlet structure, while RSAKeyGenerator.java has a java program structure.

Upvotes: 0

Views: 156

Answers (1)

Naveen
Naveen

Reputation: 535

simple create the object like this RSAKeyGenerator generator = new RSAKeyGenerator()

in servlet class and call the method using its reference

generator.xxxMethod();

Upvotes: 3

Related Questions