Putting a Java Application Online

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 459 Views - Last Post: 05 December 2012 - 10:38 PM Rate Topic: -----

#1 itsjimmy91  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 77
  • Joined: 19-January 11

Putting a Java Application Online

Posted 05 December 2012 - 09:21 PM

Hey guys. I'm really just looking for advice and ideas. I recently built a Java application that interacts with Twitter, performing a few tasks to a user's account using the Twitter API. I have the application all complete and it works well and I actually think there might be some sort of opportunity to market the application.

I have a website up and ready for it, running with PHP and MySQL. Now I'm looking into how I am going to get this product up online and available to people. I want to do this in the easiest way with a good amount of security.

Here are some factors to consider:

1. I do not want to just have the user download the application and run it on their CPU. My main goal is to have the application run completely on the web and my server, as it is going to be something that a user will have to pay monthly (or something of this nature) to actually use.

2. I'm proficient in Java and I have written a good deal of small applications in the language. However, I have never dealt with Java applets or put any of my applications online, so this is all new to me.

3. I have the website pretty much in place. There is currently functionality to register and login, but I'm not sure where to go from here.

Any ideas or help is really appreciated. I'm really just looking to talk about it to put together some sort of plan to get this thing up and running the way I envision it.

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Putting a Java Application Online

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8325
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:24 PM

If you want to embedded Java code with an HTML page you need an Applet not an Application
Was This Post Helpful? 0
  • +
  • -

#3 itsjimmy91  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 77
  • Joined: 19-January 11

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:26 PM

Will simply converting my application into an applet (this is fairly simple to do in itself, correct?) allow me to embed my application into a webpage?
Was This Post Helpful? 0
  • +
  • -

#4 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:26 PM

pbl has it right, though the industry is moving away from applets with all due haste. Note that this is away from APPLETS, not away from Java.

It's more common these days to use Java for server-side work, with a front end technology being used for the interface. Something like Javascript.

I noted that you want this to be as secure as possible - that's actually the reason corporations are moving away from applets - the Java browser plugin has become a very attractive attack vector for security exploits.
Was This Post Helpful? 0
  • +
  • -

#5 itsjimmy91  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 77
  • Joined: 19-January 11

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:29 PM

View Postxclite, on 05 December 2012 - 09:26 PM, said:

pbl has it right, though the industry is moving away from applets with all due haste. Note that this is away from APPLETS, not away from Java.

It's more common these days to use Java for server-side work, with a front end technology being used for the interface. Something like Javascript.

I noted that you want this to be as secure as possible - that's actually the reason corporations are moving away from applets - the Java browser plugin has become a very attractive attack vector for security exploits.


Hmm.. ok. My Javascript knowledge is pretty minimal. How exactly would I go about doing something in Javascript that communicated with my application?
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8325
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:31 PM

Better to have your application that runs on a server and then an Applet, issued from tthe samne server, that communicates with it using sockets
Was This Post Helpful? 0
  • +
  • -

#7 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:33 PM

Well, firstly, you could in theory create an entire application without Ajax. You just need a stack that allows you to create web applications with Java like JSP (not recommended), Spring, Play, etc.

These serve up html responses to requests.

The Javascript bit can be used to make page content dynamic, and they simply make requests the same way a page load makes a request.

View Postpbl, on 05 December 2012 - 11:31 PM, said:

Better to have your application that runs on a server and then an Applet, issued from tthe samne server, that communicates with it using sockets

I still seriously advise against an applet as it is a massive security hole, and many security experts recommend not even allowing your browser to execute Java.

Amazon explicitly rejects applets because securing them is nigh impossible.

Note: The security of applets isn't necessarily a risk to YOUR service, it also requires your consumers to have Java enabled in their browser, which makes them vulnerable to OTHER insecure apps.

This post has been edited by xclite: 05 December 2012 - 09:35 PM

Was This Post Helpful? 0
  • +
  • -

#8 itsjimmy91  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 77
  • Joined: 19-January 11

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:34 PM

Sounds like I have a lot of research to do. It looks like the things that I should look into are converting my application into an applet, setting up my application with a server, and learning some sort of JSP/Spring?

How you don't recommend JSP? Is Spring a good option?
Was This Post Helpful? 0
  • +
  • -

#9 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8325
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:36 PM

The Java language would never had been as popular as it is if Applet were not secure

And for your Amazon story I would like to see links
Was This Post Helpful? 0
  • +
  • -

#10 itsjimmy91  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 77
  • Joined: 19-January 11

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:39 PM

So, to get things straight...

If I went the way of the applet, would I need some sort of JSP or Spring to work with the applet or would the applet do all the communication with the Java application? Does this make sense? Am I thinking of this the right way?

Also, could you point me towards some good sources for how to communicate with a server within a Java application? I have no experience with this and don't really know where to start.
Was This Post Helpful? 0
  • +
  • -

#11 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:43 PM

That isn't really sound logic. Many things that are insecure become popular. Safari is exploited every year in hacking contests by the same known exploits because Apple can't be bothered to fix them.

I can't link you to an internal memo and I'm not sure what the disclosure on specific announcements is. PHP is a security nightmare as well, and you won't find a single external-facing Amazon service running it for similar reasons.

If you seriously think Applets are secure, you're living under a rock. The recent zero day exploits that Oracle refused to take seriously are just one example:
http://nakedsecurity...ities-in-april/
http://nakedsecurity...ited-tax-email/

itsjimmy91,
Web development is a very broad area. You *can* make this work in an applet. However, anybody in tune with web applications these days should be able to tell you that that's the way of the past.

Spring and Play are popular Java frameworks for creating web applications. JSP, in my opinion, is a little less structured and less productive. You can certainly get things done however you want. I'm just suggesting that you avoid the applet route, because very few people are interested in using and deploying them.

View Postitsjimmy91, on 05 December 2012 - 11:39 PM, said:

So, to get things straight...

If I went the way of the applet, would I need some sort of JSP or Spring to work with the applet or would the applet do all the communication with the Java application? Does this make sense? Am I thinking of this the right way?

Also, could you point me towards some good sources for how to communicate with a server within a Java application? I have no experience with this and don't really know where to start.

As pbl pointed out, you can do this with sockets. If you were to go the applet route, you can open a socket in your applet to your server, which would be listening on a socket.

If you went the web framework route, you would most likely be using HTTP requests instead.

Both sockets and HTTP requests are effective ways of doing what you want. I'm not arguing against sockets, just applets.

Edit to the edit to the edit:
Using a Javascript/HTML frontend requires your users to install nothing additional. Every* browser has that. JRE? Maybe not.

This post has been edited by xclite: 05 December 2012 - 09:47 PM

Was This Post Helpful? 1
  • +
  • -

#12 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8325
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:46 PM

is this site sponsored by Microsoft ? :)
Was This Post Helpful? 0
  • +
  • -

#13 Ghlavac  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 519
  • Joined: 14-January 09

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:48 PM

You could always try and just do a java servlet page, it would require significantly more HTML knowledge and the such but then you are indeed doing web programming with java.
Was This Post Helpful? 0
  • +
  • -

#14 itsjimmy91  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 77
  • Joined: 19-January 11

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:48 PM

So, let me make sure I'm on the right track here.

I'll have a PHP page, in which I will have a framework (Spring, Play, etc), and that framework will communicate with my application through sockets, and the application will then communicate with a database? Is that the life cycle of what I'm trying to do?
Was This Post Helpful? 0
  • +
  • -

#15 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 894
  • View blog
  • Posts: 3,153
  • Joined: 12-May 09

Re: Putting a Java Application Online

Posted 05 December 2012 - 09:52 PM

Ha. I don't write anything in Microsoft tech and actually spend a lot of time on the JVM. Just not on the client side.

Another consideration - do you want your users to be able to visit this website on mobile devices?
Don't use an applet.

View Postitsjimmy91, on 05 December 2012 - 11:48 PM, said:

So, let me make sure I'm on the right track here.

I'll have a PHP page, in which I will have a framework (Spring, Play, etc), and that framework will communicate with my application through sockets, and the application will then communicate with a database? Is that the life cycle of what I'm trying to do?


That sort of depends. How do you communicate with the application right now?

It's possible for the application to run side by side with a web site that communicates with it, or it's possible to have the web site *be* the application, where you handle each request by communicating with the application code.

One advantage of applets is that they are probably simpler to understand than learning the entire web development stack that one needs to know to be effectively create web applications.

This post has been edited by xclite: 05 December 2012 - 09:54 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2