Friday, 15 May 2015

Is there a way to call Java class with main() from JSP and print the value in the console or JSP page -


I doubt:

  1. Is it possible to call Java class JSP With the main () and print in the console or JSP page (without the use of a servlet class)?

  2. Similarly, print the JSP page in main JSP page (without the use of a servlet class)?

Please require some explanation.

Since the return type of a generic main () method is zero It can not be done:

  public steak zero main (string [] algos) {...}  

But you can do that class Say no static method and return your string and output to JSP:

}}

JSP :

  <% = Util.do something ()%>  

This prints the value in lieu of your static doSomething () method, where the JSP output tag is included.


No comments:

Post a Comment