JAVA and DREAMWEAVER

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
javanewbie
Posts: 2
Joined: Wed Oct 08, 2003 1:30 am

JAVA and DREAMWEAVER

Post by javanewbie »

Help...i'm learning java and am having problems getting my java to work in dreamweaver. any suggestions? here's link to see what i mean:

http://www.blackpress.org/lamont.html
help a sista and help with be returned to you.
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

My Java-fu is quite out of date but here are my thoughts/questions.

Are you doing a JSP or an applet? Not that the two are incongruent technologies but I'd suspect you're wanting just a regular HTML page, that or you need to rename your file .jsp and make sure you have a servlet engine serving your content.

Next thing is your code. I haven't dealt with JSPs in so long and don't feel like installing Tomcat just to test your JSP declarations at the top.
However, if I compile your code, I get errors. The first thing I'd point out is that you have a space in your import statements between the final period and the star.

Code: Select all

import java.awt. *;
import java.applet. *;
//Should be
import java.awt.*; //  import java.awt.Graphics;
import java.applet.*; //  import java.applet.Applet;
You also probably need to wrap your code with something to tell your servlet engine that "This is Java code here and not that boring HTML" The trick to do that is to wrap your code with <% and %>. Your file would then look like

Code: Select all

<p>&nbsp; <% import java.awt. *;
...     
    }
}%>
As a general rule, at least when I was learning Java, it was suggested that even though there is no difference in performance, it is a kindness to only import the libraries that are needed. It will help you learn where things are located so you can look up the documentation plus it is a kindness to those that have to maintain your code.

At any rate, I made those two changes, embeded the class file into an html document and called appletviewer on it and it looked peachy to me. My web server is down periodically because I'm fiddling with one thing or another but you're welcome to view your code at http://65.26.130.206/foo.html

Finally, while you're probably more than welcome to post java questions here, don't be intimidated by this---they are kind of partial to Java and have lots of tutorials and Java experts to get others started on the path.

Cheers.
I choose to fight with a sack of angry cats.
javanewbie
Posts: 2
Joined: Wed Oct 08, 2003 1:30 am

Post by javanewbie »

Wow. Your reply was really good. I'm trying to take it all in. Thanks so much!
help a sista and help with be returned to you.
Post Reply