Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which bit does what.

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
Please forgive me for asking very basic questions but I need to run what I believe to be a Java Servlet on a web server and I do not have a clue what to do.
I am a Foxpro and Perl programmer but I need to interface part of a project with a 'Java Package' within a web shop environment.

The task is, or should be, a simple one.
Details are gathered on a HTML form which are then submitted to a Java program of some kind. This program returns a security hash which is used later to check the validity of the data.
The Payment host provided an example which simply does nothing and the instructions are very vague as are the staff on the help line. I get the impression that they would rather we all paid them a monthly fee to use their interface, rather than have us designing better interfaces.
I have read FAQ's etc but I am unable to find info on how to simply run a servlet. I was wondering if someone could point me in the right direction.

The files supplied with the inoperative example use the following extensions. Perhaps that will help you ID them.
.war , .jsp , .java , .tar , .xml



Keith
 
.war -- On Sun Microsystem these are the same as .jar files, which are compressed files that contain information a java application uses.
.jsp -- Java serverpage... It's HTML with special server side Java commands inserted.
.java -- java source code, can be compiled using the java compiler javac into .class files.
.tar -- compressed files, using a compression that is very common on Unix/Linux but can be done/undone on windows given the right tools.
.xml -- XML file. eXtensible Markup Language.

My guess is that the .jsp is the front end... so you'll need to have Java Serverpages running. Then, you'll want to compile the .java file. Then, go to page that is served (use the machines webserver, don't just open the .jsp using "open file" option) and see what you get.

[plug=shameless]
[/plug]
 
Thanks for the reply.
I am assuming that the Java file will be already compiled but hey - what do I know?
The sample HTML page uses a form to submit data to a .jsp file. The jsp file contains references to various functions (I guess in the java file).
How do I get these files to do something?
I have run these files on my local server and on the web server and instead of doing anything obvious, it simply displays the source code of the .jsp file.
Am I missing something obvious here or is it too complicated for a stupid person lol?

Keith
 
If it's .java -- then, no it's not. Java files compile into .class files. You should be able to open the .java file in a text editor and see their code (and not a buch of goofy chars.

Try to compile the .java file:
javac <simefile>.java

Then try to run the program:
java <somefile>

where <somefile> is the name of the .java file (should start with a capital letter.

[plug=shameless]
[/plug]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top