AJAX vs JAVA: A Comparison of Web Development Languages

  • Context: Java 
  • Thread starter Thread starter Ulysees
  • Start date Start date
  • Tags Tags
    Java
Click For Summary

Discussion Overview

The discussion centers around the comparison of AJAX and JAVA in the context of web development, exploring their functionalities, applications, and potential integration. Participants examine the merits and drawbacks of each technology, particularly in relation to creating responsive web applications like forums.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants argue that AJAX can be cumbersome due to platform-specific intricacies, while JAVA could potentially provide similar functionality with different code.
  • Others clarify that AJAX is a technique that utilizes JavaScript and XML for immediate user interaction, while JAVA is a programming language that can be used in conjunction with AJAX.
  • There are claims that JAVA may be slower than AJAX for creating responsive web applications, with HTML loading faster than JAVA applets.
  • Some participants express skepticism about the visual capabilities of JAVA applets compared to AJAX, questioning whether JAVA can effectively display browsable forum text.
  • There is a suggestion that AJAX and JAVA can be used together to enhance web applications, but concerns are raised about the instantaneous response capabilities of server-side JAVA technologies like JSP.
  • One participant questions the suitability of JSP for creating a super-responsive forum, expressing a desire for a system that allows for local storage of messages for faster access.
  • There is confusion regarding the acronyms and functionalities of JSP and AJAX, with some participants seeking clarification on their roles in web development.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the comparison between AJAX and JAVA, with multiple competing views on their functionalities, performance, and integration. The discussion remains unresolved regarding the best approach to achieve a responsive forum application.

Contextual Notes

Limitations include varying interpretations of AJAX and JAVA functionalities, assumptions about performance, and the potential for integration. The discussion reflects differing levels of familiarity with the technologies involved.

Who May Find This Useful

Web developers, software engineers, and individuals interested in the technical aspects of web application development may find this discussion relevant.

  • #31
Ulysees said:
The topic might as well be:

"AJAX versus stand-alone JAVA"

For the hundreth time, no. You can't compare AJAX to JAVA. It's like comparing a Honda Civic to a Cessna CJ1. You can NOT communicate with a server with just AJAX (Javascript + XML). What you want to compare is client JAVA with AJAX or web JSP/J2EE with AJAX.
 
Last edited:
Technology news on Phys.org
  • #32
CRGreathouse said:
Actually that wasn't clear to me until you posted that. Your essential question, then, is about what to use on the client side -- nothing (well, nothing but styled HTML I presume), or JavaScript + XML. In either case you're using server-side Java, right?

Or have I still misunderstood?

That's it. Nothing (well, nothing but styled HTML I presume), or JavaScript + XML.

And yes, server-side java in either case. Thank you.
 
  • #33
Greg Bernhardt said:
For the hundreth time, no. You can't compare AJAX to JAVA. It's like comparing a Honda Civic to a Cessna CJ1. You can NOT communicate with a server with just AJAX (Javascript + XML). What you want to compare is client JAVA with AJAX or web JSP/J2EE with AJAX.

You don't understand how people think in business Greg. For them it's solution A, versus solution B, versus solution C (paperwork).
 
  • #34
Ulysees said:
That's it. Nothing (well, nothing but styled HTML I presume), or JavaScript + XML.

And yes, server-side java in either case. Thank you.

ah I see, that was really not clear to me either especially when you keep making your confusing A vs B comparisons.

If used correctly AJAX can be fantastic and it should be used, but if abused you can end up crippling your server. So i'd use an HTML page with some sprinkles of AJAX.
 
  • #35
I got stuck in another issue with java once. My applet was not allowed to access web pages (plain html) on servers other than the one I downloaded the applet from, "for security reasons" this was not allowed.

You know any workaround?
 
Last edited:
  • #36
Ulysees said:
I got stuck in another issue with java once. My applet was not allowed to access web pages (plain html) on servers other than the one I downloaded the applet from, "for security reasons" this was not allowed.

You know any workaround?

That's a security measure to prevent cross-site scripting - the alternative is to sign your JARs. A signed java applet will have full permissions.
 
  • #37
What about this one, -Job-:

> Is it possible to not ask the server at all, just get data straight from the cache? Because the main problem of the internet is delay, not download rate. It's a replacement for Outlook I'm trying to come up with, that interrogates the server every 5 minutes or whatever for any new messages (ie updates the cache every 5 minutes), and shows message threads immediately when requested.
 
  • #38
Ulysees said:
What about this one, -Job-:

> Is it possible to not ask the server at all, just get data straight from the cache? Because the main problem of the internet is delay, not download rate. It's a replacement for Outlook I'm trying to come up with, that interrogates the server every 5 minutes or whatever for any new messages (ie updates the cache every 5 minutes), and shows message threads immediately when requested.

You can load everything at once (e.g. load all message pages at once) and show only the active content but this is definitely not a good approach for many reasons.

The best strategy is to use AJAX (or frames) to preload content and hold it in the background until it needs to be used. For example in a mail client you can have the main page load with the first page of messages and subsequently perform AJAX requests to retrieve the next message pages so that when the user clicks to view messages 50 - 100 it can display them immediately with no load time (just some setup time). You just have to ensure that you manage the cache size and don't let it get out of control.
 
Last edited:
  • #39
But then I'd have to preload the entire forum in every session.

Can't I keep messages from previous sessions on the hard disk, just like Outlook does?

Because these days hard disk space is not an issue. Neither is bandwidth so much of an issue, unless every user downloads a ton of messages over and over in every session. The only remaining issue is delay.
 
Last edited:
  • #40
In fact I am sure there is a lot of future in this asynchronous approach, not just Asynchronous Javascript with Xml (ajax) but anything that achieves this objective, of interactivity in web pages.
 
Last edited:
  • #41
The browser can cache Ajax requests - if you ensure that the Ajax request is the same as previous ones then standard browser caching applies.
 
  • #42
-Job- said:
if you ensure that the Ajax request is the same as previous ones then standard browser caching applies.

You said this earlier:

> You can set content expiration headers on the server side to inform the browser to use cached content.

This means:

1. ask the server
2. server says "not expired yet"
3. show the cached content

We don't want this. We don't want to ask the server at all, the delay is too much. Instead, we want to show what's in the cache.

There's got to be a way to show what's in the cache from previous sessions.

Can the browser be forced to offline mode by a java applet?
 
Last edited:
  • #43
Ulysees said:
You said this earlier:

> You can set content expiration headers on the server side to inform the browser to use cached content.

This means:

1. ask the server
2. server says "not expired yet"
3. show the cached content

We don't want this. We don't want to ask the server at all, the delay is too much. Instead, we want to show what's in the cache.

There's got to be a way to show what's in the cache from previous sessions.

Can the browser be forced to offline mode by a java applet?

Really, too much delay? You have some pretty high standards. The browser makes HEAD requests which are very lightweight (contain no data) to check if new content is available - these are very fast - in addition you can also have the server set actual content expiration dates though I'm not 100% clear how the browsers handle these (they might ignore them to some degree).

IMHO I think you're getting too particular with the cache - you might be better off taking your app off the browser. You can use a single Java applet which makes socket requests to your site to retrieve content and stores it on the user's file system - so it's able to implement its own caching rules. However the main page containing the applet and the applet itself are cached (or not) according to the browser (still HEAD requests) - not to mention that the JAVA applet itself will be slower to load than any other approach. If delay is the problem then JAVA is not the solution.
 
Last edited:
  • #44
Actually I'm now reminded that Google is working on a new browser plugin called Google Gears, check it out - it's geared towards allowing applications to function offline so might be used to minimize content-related delays (it's still very much under development though). It implements a database accessible from Javascript, so you can store your content there.
 
Last edited:
  • #45
Thanks a million -Job-.

Certainly easier to convince people to install a plugin by google, than to run a windows executable of mine.

How they'd feel about giving lots of permissions to a JAVA applet is another story. Some hacker must have worked around this obstacle. But I wonder if there's a legitimate way to do it. Under the user's full supervision. Maybe the user could maintain a file and manually give it to the applet at the beginning of every session, and manually save it at the end of the session, if nothing better can be done.

Do you participate in any web-development-specific forums? Can you recommend a JAVA forum? Any AJAX one?
 
  • #46
Ulysees said:
Do you participate in any web-development-specific forums? Can you recommend a JAVA forum? Any AJAX one?

Not really - i don't have much time nowadays.
 

Similar threads

Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 33 ·
2
Replies
33
Views
8K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K
Replies
27
Views
13K
  • · Replies 129 ·
5
Replies
129
Views
26K
  • · Replies 18 ·
Replies
18
Views
4K