I have read many articles and stackover flow questions discussing whether to use JSP as a backend for websites. But I am stil confused over some aspects to how it works and what kind of server you need. Currently I am using 3owl.com because it has free hosting and unlimited space (I highly recommend it)! I use php to code right now, but a lot of the functions in php are rather limited. Here is the program in java:
I wanted to use this code in a javaback end. So here are my questions: Can java code like this be converted straight to JSP or some sort of java backend? What are jsp's limitations compared to a normal java application? And will 3owl work or is there something else that I can use for free that will let me use java backend?
What you need is a PHP/JAVA Bridge
there are so many examples but i"ll give only 3
Using Default PHP / Java Integration
Please See http://php.net/manual/en/book.java.php for full documentation
Examples
$frame = new Java('java.awt.Frame', 'PHP');
$button = new Java('java.awt.Button', 'Hello Java World!');
$frame->add('North', $button);
$frame->validate();
$frame->pack();
$frame->visible = True;
$thread = new Java('java.lang.Thread');
$thread->sleep(10000);
$frame->dispose();
Using 3rd Party Lib
Examples
http://acet.rdg.ac.uk/projects/vre/jbridgeinst.php
http://php-java-bridge.sourceforge.net/pjb/
Using FOP
For more information please see http://wiki.apache.org/xmlgraphics-fop/HowTo/PHPJavaBridge