client control server's parallel port via jsp..help..
807569Jun 12 2006 — edited Jun 13 2006Hi everyone:
I m not sure wheather i post at the right place.. but i have no idea..
My problem:
I need to complete a project which required controlling pc(server) parallel port remotely, via internet from another pc(client) with webpage interface.
User will need to complete the registration form in order to login and controlling the server side parallel port.
i just ignore the registration side first since i hv an example about the database-related example from "Jakarta Struts for Dummies".
www.dummies.com/go/jakarta
And now i need to create a simple jsp, with servlet which will enable client to set or reset the parallel port.
Here is an example about controlling the parallel port remotely,
http://www.epanorama.net/circuits/parallel_output.html
but it run a program called portcontrol.exe with php, i need to controlled it without such .exe program.
I have successfully tested program below to set the bit0 of parallel port, but in java.
--------------------------------------------------------------------------------------------------
import parport.ParallelPort;
class SimpleIO {
public static void main ( String []args )
{
ParallelPort lpt1 = new ParallelPort(0x378); // 0x378 is normally the base address for the LPT1 port
int aByte;
aByte = 0x01; // a simple and irrelevant operation
lpt1.write(aByte); // write a byte to the port's DATA pins
System.out.println("Output to port: " + aByte);
}
}
-----------------------------------------------------------------------------------------------
but .. how to "put" these program into .jsp so it can controll by client?
let say.. the page will provide a button, and when it pressed, server will
set it parallel port's bit0.
I have set up a tomcat web-server.
I m still beginner in jsp and servlet programming, and i really need help from all of you. please guide.
Thanks in advance.