How to get the instance of running java application through jsp? -
i have java application have open apis. want use apis jsp page. don't have idea this.as of understanding have instance of running java application.
please correct me if wrong.
you have import class @ top of jsp
<%@ page import="my.class.path.myclass" %>
see how import classes in jsp? details.
then can use class in code this:
<% myclass myclassinstance = new myclass(); myclassinstance.mymethod(); %>
if want output can use:
<%= myclassinstance.amethodthatreturnsastring() %>
the method can return (but must return something). if not string
handled other non-string value in expression:
"begin " + amethodthatreturnssomething() + " end";
so, int
displayed int
, object gets tostring()
called etc.
Comments
Post a Comment