By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,538 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,538 IT Pros & Developers. It's quick & easy.

Java on Web

P: n/a
I've done a lot of java programming but never done any for the web.
For most of what I've done was with Swing.

So how difficult/different is it to still do some Java apps for the web from
Swing?

--

===========================
DaWaN
we*******@dawan.com


Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
DaWaN wrote:
I've done a lot of java programming but never done any for the web.
For most of what I've done was with Swing.

So how difficult/different is it to still do some Java apps for the web
from Swing?

Depends, but I would suggest that you learn first about the meaning of
URL's, the http protocol, and make sure that you understand the meaning of
request headers and response headers, make sure you understand the GET and
POST methods.
Then start looking at the URL classes, URLConnection, URLEncoder and
URLDecoder, HttpURLConnection, URLStreamHandler and URLStreamHandlerFactory
classes.
A very good book I can recommend is Java Network Programming (O'Reilly) from
Elliotte Rusty Harold.

If you go for Swing-less web application, go for Servlets, JSP and a MVC
framework like Struts.

Hope this gets you started,
Brgds Herman
--
Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
Anti Spam = remove the "dot" and the "at"
Registered Linux User #264690
Jul 17 '05 #2

P: n/a
It all depends exactly what you mean by programming for the web? But i take
it from you post your interest is in java applets accessible over the web to
run in a browser? Not so different to regular swing apps, plus the html page
code to contain the app.

Then theres server side programming to create dynamic web pages- using jsp
and java servlets. For this you will also need an understanding of html of
course, and set youself up with a web server. Linux with the j2sdk, Apache
web server, Tomcat for the jsp pages, and MySQL for database access works
well for me...

"DaWaN" <da*****@hotmail.com> wrote in message
news:ZK********************@giganews.com...
I've done a lot of java programming but never done any for the web.
For most of what I've done was with Swing.

So how difficult/different is it to still do some Java apps for the web from Swing?

--

===========================
DaWaN
we*******@dawan.com


Jul 17 '05 #3

P: n/a
Thanks for the replies.

What I meant was how can I use the regular Java to create programs with the
browser as the interface?

I've done a lotta programming myself and do program for the web with PHP and
done some with C. But for example when I used C I had to rap the programs in
shell files as .cgi files so they're accessible by the web.

So how can you make a program that is written in Java (including all
necessary HTML outputs from the Java program itself) to be used from a
browser?
Thanks in advance.

===========================
DaWaN
we*******@dawan.com

"DaWaN" <da*****@hotmail.com> wrote in message
news:ZK********************@giganews.com...
I've done a lot of java programming but never done any for the web.
For most of what I've done was with Swing.

So how difficult/different is it to still do some Java apps for the web from Swing?

--

===========================
DaWaN
we*******@dawan.com

Jul 17 '05 #4

P: n/a
DaWaN wrote:
Thanks for the replies.

What I meant was how can I use the regular Java to create programs with the
browser as the interface?

I've done a lotta programming myself and do program for the web with PHP and
done some with C. But for example when I used C I had to rap the programs in
shell files as .cgi files so they're accessible by the web.

So how can you make a program that is written in Java (including all
necessary HTML outputs from the Java program itself) to be used from a
browser?


Swing is not the right technology for this. What you are interested in
is servlets and JSPs. You will need a servlet container for them to run
in; try Tomcat from apache.org for a freely available one to get you
started. Use the tutorials on java.sun.com to get started on servlets
and JSPs. (Although the servlet API is pretty straightforward, if you
are a seasoned programmer you can probably get it going right away.)

Ray

Jul 17 '05 #5

P: n/a
DaWaN wrote:
Thanks for the replies.

What I meant was how can I use the regular Java to create programs with
the browser as the interface?

I've done a lotta programming myself and do program for the web with PHP
and done some with C. But for example when I used C I had to rap the
programs in shell files as .cgi files so they're accessible by the web.

So how can you make a program that is written in Java (including all
necessary HTML outputs from the Java program itself) to be used from a
browser?
Thanks in advance.

===========================
DaWaN
we*******@dawan.com

"DaWaN" <da*****@hotmail.com> wrote in message
news:ZK********************@giganews.com...
I've done a lot of java programming but never done any for the web.
For most of what I've done was with Swing.

So how difficult/different is it to still do some Java apps for the web

from
Swing?

--

===========================
DaWaN
we*******@dawan.com

The easiest way is probably to use JSP/Servlets and deploy them in a
JSP/Servlet container like Tomcat or Jetty.
Brgds, Herman
--
Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
Anti Spam = remove the "dot" and the "at"
Registered Linux User #264690
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.