Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2010, 05:06 PM   PM User | #1
Martin3df
New to the CF scene

 
Join Date: Oct 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Martin3df is an unknown quantity at this point
Sending info from java in HTML to a separate java class

Hi All

I'm hoping that someone can help me with this problem.

I have made a java program which basically makes some calculations, plots a graph of the results and saves this as a jpeg.

I have also made an html form with various dropdown menus and text boxes in which a user can enter their information. I want them to be able to click a 'calculate' button, which will send the information they have entered into the java application. The java will then make the required calculations, and the output graph should be displayed back on the html page so that the user can see their results. Hope this makes sense.

I know the relevant javascript to take the values from the html form and assign this to variables in javascript, but I dont know how to send this over to another java class to make the required calculations.

I have tried the following in the html:

Code:
    	CalcClass Class2Object = new CalcClass();
	
    	Class2Object.Calculate(temp);
This seems to work when I am sending variable between two java classes in pure java, but not when half of the java is embedded in the html header.

Any ideas where I might be going wrong?

The html and class files are saved in the same folder so that shouldn't be an issue should it?
Martin3df is offline   Reply With Quote
Old 11-29-2010, 05:21 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
This is the JavaScript forum. Java and Javascript are entirely different programming languages, in spite of the confusingly similar names. Ask a mod to move you over.

Java executes on the server; JavaScript on the client. There can be no interaction.


It is your responsibility to die() if necessary….. - PHP Manual
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:18 AM.


Advertisement
Log in to turn off these ads.