jsp - How to direct the output of java program through HTML/CSS? -


i trying create web application using java , java server pages .i want output of java file display on jsp(web page)..i new jsp don't know how include java program jsp file , output variables...i have searched didn't found me...any code or link tutorial helpful....
consider filename is: xyz.java
, want display value of one of variable.

and want display value of 1 of variable.

first of if class not accessible in jsp need import class

<%@ page import="com.my.yourclass" %> 

second need call method of class want output or said want use value of variable make sure should initialized can directly use jsp expression.

<%= new yourclass().variablename; %> 

you can use directly display variable value html page make sure variable should accessible means should not private.

you can use scriplet that

for example:

<% system.out.println("hello!!"); %> 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -