Moving method outputs from a java class to HTML -


i'm programming in java , have simple hello-world type class can provide outputs console quite happily.

what transfer outputs of this, or similar class, html - preferably without using having use applet.

in head i'm imagining included line of code in html file read along lines of 'call class file following parameters , print results here'

i'm quite new java have lot of experience in programming in general.

kind regards

in head i'm imagining included line of code in html file read along lines of 'call class file following parameters , print results here'

you on right track. html in java .jsp file (like suggested @henryabra) have deploy web container (like tomcat) process inline block of code , call java class method time requests on web.

so, rename .html (ready body , table , heading tags determine how content rendered browser) .jsp file , add dynamic blocks of code jsp scriptlets.

<h1>hello world</h1> <p> message is:<br /> <% // scriptlet   out.write(new helloworld().getmessage());   // out lets write html response stream %> </p> 

please, note although jsp files quite similar html ones they'll require page directive use import java classes follows

<%@ page language="java"  contenttype="text/html;charset=utf-8" import="pkg.path.to.helloworld" %> 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -