problem in AJAX

Discussion in 'Java' started by gk, Oct 26, 2005.

  1. gk

    gk Guest

    AJAX sends XML response. and javascript function parses that XML
    response and then HTML DOM is updated.


    I AM in a confused state whether i should use AJAX or NOT...



    Because i dont want javascript function to pase the XML . i want to
    use my java XML parser and want to parse in the server side. and want
    to store the data in a java bean and then i want to display the data
    from the java bean.

    The reason i want to avoid JS XML parsing is

    1) my XML is huge.
    2) it would become messy in the client side.
    3) i want to use server side XML parsing and want to diaply the data in
    my JSP via java bean.


    is it possible to use AJAX now ? How ? AJAX wont allow to use java bean
    and server side parsing . it would try to parse by its own.
     
    gk, Oct 26, 2005
    #1
    1. Advertising

  2. gk

    Roedy Green Guest

    On 26 Oct 2005 02:21:31 -0700, "gk" <> wrote, quoted
    or indirectly quoted someone who said :

    >
    >is it possible to use AJAX now ? How ? AJAX wont allow to use java bean
    >and server side parsing . it would try to parse by its own.


    Ajax is sort of like an el-cheapo generic Applet that can to a very
    limited subset of the things Java can do. Its big advantage is it
    smaller and loads faster than the Java JVM. If you have your Applet
    talk to the server instead, Ajax is no longer involved.

    For a large volume of data, XML is a pretty fluffy way to transport
    it.
    Consider a DataOutputStream or a GZIPed ObjectStream.

    see http://mindprod.com/applets/fileio.html
    for sample code to send the data over a socket.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Oct 26, 2005
    #2
    1. Advertising

  3. gk wrote:
    > AJAX sends XML response. and javascript function parses that XML
    > response and then HTML DOM is updated.
    >
    >
    > I AM in a confused state whether i should use AJAX or NOT...
    >
    >
    >
    > Because i dont want javascript function to pase the XML . i want to
    > use my java XML parser and want to parse in the server side. and want
    > to store the data in a java bean and then i want to display the data
    > from the java bean.
    >
    > The reason i want to avoid JS XML parsing is
    >
    > 1) my XML is huge.
    > 2) it would become messy in the client side.
    > 3) i want to use server side XML parsing and want to diaply the data in
    > my JSP via java bean.
    >
    >
    > is it possible to use AJAX now ? How ? AJAX wont allow to use java bean
    > and server side parsing . it would try to parse by its own.
    >

    You might want to take a look at this:
    https://blueprints.dev.java.net/ajax-faq.html

    --
    TechBookReport Java book reviews
    http://www.techbookreport.com/JavaIndex.html
     
    TechBookReport, Oct 26, 2005
    #3
  4. gk

    gk Guest

    Roedy Green wrote:
    > On 26 Oct 2005 02:21:31 -0700, "gk" <> wrote, quoted
    > or indirectly quoted someone who said :
    >
    > >
    > >is it possible to use AJAX now ? How ? AJAX wont allow to use java bean
    > >and server side parsing . it would try to parse by its own.

    >
    > Ajax is sort of like an el-cheapo generic Applet that can to a very
    > limited subset of the things Java can do. Its big advantage is it
    > smaller and loads faster than the Java JVM. If you have your Applet
    > talk to the server instead, Ajax is no longer involved.
    >
    > For a large volume of data, XML is a pretty fluffy way to transport
    > it.
    > Consider a DataOutputStream or a GZIPed ObjectStream.
    >
    > see http://mindprod.com/applets/fileio.html
    > for sample code to send the data over a socket.
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > http://mindprod.com Java custom programming, consulting and coaching.



    do u suggest me to use AJAX and update HTML dom via javascript ?


    but i was interested about XML parsing and java bean and JSTL tags to
    display the data . and AJAX is not letting me to do that.


    i am scared to go for HML DOM updation by AJAX because my JSP page is
    complex , with CSS,flash etc etc.
     
    gk, Oct 26, 2005
    #4
  5. gk

    gk Guest

    and if i dont store the data in java bean then later on i wont be able
    to sort it.
     
    gk, Oct 26, 2005
    #5
  6. gk

    Roedy Green Guest

    On 26 Oct 2005 03:53:21 -0700, "gk" <> wrote, quoted
    or indirectly quoted someone who said :

    >do u suggest me to use AJAX and update HTML dom via javascript ?

    That would do fine for low volumes and where the processing is not
    that complicated. My understanding is that Ajax is not a programming
    language, but more a forms defining language that its not nearly so
    lame as HTML forms.

    The problem with using AJax or similar light weight solutions is if
    the program gets more and more complicated, it gets harder and harder
    to kludge it together one more time. Eventually you have to start
    over from scratch.

    The main problem with using Applets is your users will be annoyed at
    the start up times to do a very simple thing. They won't like be
    hassled with computer geeky stuff like Applet privilege granting.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Oct 26, 2005
    #6
  7. gk

    Roedy Green Guest

    On 26 Oct 2005 03:53:21 -0700, "gk" <> wrote, quoted
    or indirectly quoted someone who said :

    >
    >i am scared to go for HML DOM updation by AJAX because my JSP page is
    >complex , with CSS,flash etc etc.


    My tendency is to try to reduce the number of tools in any given
    project to a minimum. Why?

    1. if someone has to take this project over, it will be a lot easier
    to find someone who knows one or two tools, rather than a random set
    of 9.

    2. The tools were designed by people who have never met. It is a
    bloody miracle when they work together as promised.

    3. A chain is as strong as its weakest link. If any one of those tools
    loses support, I may have do massive amounts of changes to redesign
    without it. Probability theory tells you that your danger increases
    with the number of tools in the exponent.

    4. There will be less duplication. More RAM will be left over to do
    something useful. Do I really need 8 different calendar calculators?

    5. It is less confusing.

    6. I once worked for a guy who was the very opposite. He was a tool
    junkie and he liked to use as many as possible simply for the fun of
    learning to use them and selecting the perfect tool for each
    individual task. The problem was he was the only one who really had
    the big picture of what was going on, since everyone who worked for
    him specialised is some subset of them. People would be helpless when
    they were forced to wander out of their skillset in an "emergency". He
    was convinced everyone else SHOULD have the same level of skill as he
    did in everything. Of course the reality was they never did and had
    to waste time learning a whole tool just to understand a few lines.



    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Oct 26, 2005
    #7
  8. gk

    Steve Sobol Guest

    gk wrote:
    > is it possible to use AJAX now ? How ? AJAX wont allow to use java bean
    > and server side parsing . it would try to parse by its own.


    AJAX's primary purpose is to enable you to go fetch XML from a URL. That URL
    can be a server-side script; TCL, JSP, Python, PHP, Perl, shell script,
    anything :D

    What exactly do you need to do?



    --
    Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
    Company website: http://JustThe.net/
    Personal blog, resume, portfolio: http://SteveSobol.com/
    E: Snail: 22674 Motnocab Road, Apple Valley, CA 92307
     
    Steve Sobol, Oct 26, 2005
    #8
  9. gk

    Steve Sobol Guest

    gk wrote:


    > but i was interested about XML parsing and java bean and JSTL tags to
    > display the data . and AJAX is not letting me to do that.


    JSP/JSTL is server-side. AJAX is, by definition, client-side.

    --
    Steve Sobol, Professional Geek 888-480-4638 PGP: 0xE3AE35ED
    Company website: http://JustThe.net/
    Personal blog, resume, portfolio: http://SteveSobol.com/
    E: Snail: 22674 Motnocab Road, Apple Valley, CA 92307
     
    Steve Sobol, Oct 26, 2005
    #9
  10. gk

    Chris Smith Guest

    Roedy Green wrote:
    > That would do fine for low volumes and where the processing is not
    > that complicated. My understanding is that Ajax is not a programming
    > language, but more a forms defining language that its not nearly so
    > lame as HTML forms.


    Your understanding is not correct. AJAX is not a language at all. It's
    a word someone invented for the generic concept of having JavaScript
    talk directly to the server without reloading the HTML page. There are
    any number of possible ways of implementing AJAX. The most common is to
    use the non-standard XmlHttpRequest class, which is available from
    JavaScript in most major browsers.

    The major defining characteristic, though, is the asynchronous aspect of
    the technology. Even XML is in there by coincidence; people describe
    things as "AJAX" applications when they don't use XML at all. There is
    no new language or file format here. There's no specification; no
    definition of AJAX is or is not. There are no special tools. There's
    no visual appearance that could be created except what you could do with
    a web browser, HTML, JavaScript, and CSS anyway. In fact, if you were
    allowed to stub out the data, you could write any AJAX application with
    only those basic client-side web technologies.

    > The main problem with using Applets is your users will be annoyed at
    > the start up times to do a very simple thing. They won't like be
    > hassled with computer geeky stuff like Applet privilege granting.


    There are actually two advantages to an AJAX-like approach over applets.
    One is that JavaScript generally starts faster than an applet. The
    other is that AJAX is really just HTML and JavaScript and CSS, so it
    ACTS like a web browser. That is, you can resize the window and expect
    to see text and tables wrapped and presented in all the normal ways.
    All the UI kludginess of applets is gone. That's significant, too.

    --
    www.designacourse.com
    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
     
    Chris Smith, Oct 26, 2005
    #10
  11. gk

    Roedy Green Guest

    On Wed, 26 Oct 2005 10:41:00 -0600, Chris Smith <>
    wrote, quoted or indirectly quoted someone who said :

    >Your understanding is not correct.

    thanks for sorting that out. I have rewritten the entry based on
    your post. See http://mindprod.com/jgloss/ajax.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Oct 27, 2005
    #11
  12. gk

    Luke Webber Guest

    Steve Sobol wrote:
    > gk wrote:
    >
    >
    >> but i was interested about XML parsing and java bean and JSTL tags to
    >> display the data . and AJAX is not letting me to do that.

    >
    >
    > JSP/JSTL is server-side. AJAX is, by definition, client-side.


    Not entirely. There has to be some sort of web service provider to serve
    the XML back to the Javascript.

    Luke
     
    Luke Webber, Oct 27, 2005
    #12
  13. gk

    gk Guest

    my server will return 1 XML after 1 second. this XML will be written to
    my web page in a table.

    again after 5 secs my server will return another XML . i want to
    place this XML in a table just below the above table.



    again after 5 secs my server will return one more XML . i want to
    place this XML in a table just below the above table.

    so, my web page is getting updated. and at last there will be 3 table
    contaning 3 XML's in them.


    i have developed AJAX application earlier also. but this architecture
    is very diiificult.



    can you show me a demo on this problem with AJAX ?

    though i have over-simplified the problem and presented to you. i am
    getting difficuly to append the page with new XML data.

    how could i do that?
     
    gk, Oct 27, 2005
    #13
  14. gk

    Roedy Green Guest

    On 26 Oct 2005 22:38:48 -0700, "gk" <> wrote, quoted
    or indirectly quoted someone who said :

    >again after 5 secs my server will return another XML . i want to
    >place this XML in a table just below the above table.


    The way you would do that on the client side in java is just have a
    thread waiting on an open socket to the server waiting for the next
    installment, OR have the client every 5 seconds send in a new request
    for the next installment.
    see http://mindprod.com/applets/fileio.html
    for sample code.

    If you want to know how to handle that in JavaScript, ask in a
    JavaScript newsgroup.

    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Oct 27, 2005
    #14
  15. gk

    gk Guest

    Roedy Green wrote:

    > On 26 Oct 2005 22:38:48 -0700, "gk" <> wrote, quoted
    > or indirectly quoted someone who said :
    >
    > >again after 5 secs my server will return another XML . i want to
    > >place this XML in a table just below the above table.

    >
    > The way you would do that on the client side in java is just have a
    > thread waiting on an open socket to the server waiting for the next
    > installment, OR have the client every 5 seconds send in a new request
    > for the next installment.
    > see http://mindprod.com/applets/fileio.html
    > for sample code.




    YES. i can do that.

    my problem is the disply problem. i can not flush a table+css+flash
    with out.println()...thats very bad.

    yes..u are right ...some javascript could help me to display those data
    in different tables...making it an updated dynamic page.
    >
    > If you want to know how to handle that in JavaScript, ask in a
    > JavaScript newsgroup.
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > http://mindprod.com Java custom programming, consulting and coaching.
     
    gk, Oct 27, 2005
    #15
  16. gk

    Roedy Green Guest

    On 26 Oct 2005 23:29:14 -0700, "gk" <> wrote, quoted
    or indirectly quoted someone who said :

    >my problem is the disply problem. i can not flush a table+css+flash
    >with out.println()...thats very bad.


    Again, that is a JavaScript problem. The place to ask is
    comp.lang.javascript
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Oct 27, 2005
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    20
    Views:
    1,910
    d1srupt3r
    Mar 31, 2008
  2. darrel

    beginner AJAX questions (AJAX.net)

    darrel, Apr 27, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    2,444
    Flinky Wisty Pomm
    Apr 28, 2006
  3. jobs
    Replies:
    0
    Views:
    371
  4. =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?=

    Deploying ASP.NET AJAX-Enabled Web site to host without AJAX insta

    =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?=, Feb 20, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    606
    Patrick
    Feb 21, 2007
  5. minnie
    Replies:
    1
    Views:
    716
    Andrew Thompson
    Dec 13, 2006
Loading...

Share This Page