Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: AjaxTK examples

  1. #1
    Join Date
    Sep 2005
    Location
    Kent, UK
    Posts
    4
    Rep Power
    10

    Default AjaxTK examples

    I have just downloaded the latest milestone 3.0M1 and am trying to get the AjaxTK examples to work.

    I don't have a jsp server up and running so I converted the pages to PHP. The JSP files seemed to only be used to import other jsp's and setup the initial js environment (?).

    I can now run the examples pretty much as expected. However, none of the images show up.

    Is there an way to obtain the html that is generated by the toolkit to see where it is trying to get the images from?

    Any other suggestions would be welcome.

    I would also like to congratulate you on an excellent piece of work and thank you for making is OSS. I would also like to second the request for making your AjaxTK a seperately available download (I can see so much potential!).

    regards,
    Jon
    Last edited by xiris; 01-17-2006 at 02:17 AM.

  2. #2
    Join Date
    Sep 2005
    Posts
    3
    Rep Power
    10

    Default How about error_log?

    How about checking web server's error log to see where browser expects to find graphic files?

  3. #3
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    The images and their css are generated at build time. So to make it work corrently you really need to use the included code. Bascilly setup a tomcat server and run the deploy target inthe Ajax/build.xml project.

  4. #4
    Join Date
    Sep 2005
    Location
    Kent, UK
    Posts
    4
    Rep Power
    10

    Default

    Quote Originally Posted by KevinH
    The images and their css are generated at build time. So to make it work corrently you really need to use the included code. Bascilly setup a tomcat server and run the deploy target inthe Ajax/build.xml project.
    I am attempting to run with PHP instead of JSP so I don't have Tomcat up and running. How can I build the CSS and images without using Tomcat?

    Or can I only do it through deploying with Tomcat and then copying the constructed css and images?

    thanks,
    Jon

  5. #5
    Join Date
    Sep 2005
    Location
    Kent, UK
    Posts
    4
    Rep Power
    10

    Default

    Success!!

    I have succeeded in getting the examples to work with PHP properly
    For those interested here is how I did it...

    I used Ant to build the Ajax toolkit and then copied the contents of the Ajax/build/WebRoot directory to my website directory. This copied a across the generated files that where missing. I then converted the JSP pages to PHP and let it run. At this point the examples still didn't work but a little look at the Javascript console told me it couldn't find the AjxCore (plus a few others). Lo and behold the Ajax build folder I copied across only seemed to contain the bits of AjaxTK that it had built and not the core js files etc (I guess they are put in the war file only?).

    So I went back to my downloaded source and copied across the directories in Ajax/WebRoot/js. This provided me with the rest of the toolkit and the examples now work as expected.

    I hope this help people.

    regards,
    Jon

  6. #6
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Perfect. Yes I should have been clearer. You must use ant to build the images. Then your PHP code will work. Gald you got it working.

  7. #7
    Join Date
    Oct 2005
    Posts
    6
    Rep Power
    10

    Default Details for running without JSP

    Thanks to everyone who helped me get this far. Here is what I did to get the examples to run without Java:

    1. Unpack the sources
    2. cd zcs/Ajax
    3. ant war # this puts some generated files into build/WebRoot
    4. yes no | cp -ri WebRoot/js build/WebRoot/ # copy non generated files
    5. Add a link so that a URL starting with /ajax points to your build/WebRoot dir:
      1. If you are using Apache, add something like this to your config: Alias /ajax/ <path to zcs>/Ajax/build/WebRoot/
      2. If you want to use file: urls, you can add a symlink to your filesystem root: ln -s <path to zcs>/Ajax/build/WebRoot /ajax
    6. In each example directory, run jsp2html.pl on the .jsp file to generate non-JSP HTML. For example: ( cd build/WebRoot/examples/tree/; jsp2html.pl TreeExample.jsp > index.html )


    Here is my jsp2html.pl. Pretty ugly, but it works for these simple examples:

    Code:
    #!/usr/bin/perl -w
    use strict;
    
    sub process
    {
      my ( $fname ) = @_;
      my $fdata;
      {
        open F, $fname or die "Failed to open $fname: $!";
        undef $/;
        $fdata = <F>;
        close F;
      }
    
      $fdata =~ s{<%= *contextPath *%>}{../..}g;
      $fdata =~ s{<fmt:message key="DwtMsg"[^>]*>}{../../js/dwt/config/msgs/DwtMsg_en.js}g;
      $fdata =~ s{<fmt:message key="AjxMsg"[^>]*>}{../../js/config/msgs/AjxMsg_en.js}g;
      $fdata =~ s{<(%.*?%)>}{<!--$1-->}sg;
      $fdata =~ s{<jsp:include *page="([^"]*)" */>}{ process( $1 ) }ge;
    
      return "<!-- BEGIN $fname ($0) -->\n$fdata\n<!-- END $fname -->\n";
    }
    
    print process( $ARGV[0] )

  8. #8
    Join Date
    Oct 2005
    Location
    Brussels
    Posts
    1
    Rep Power
    10

    Default

    Could someone provides us with the content of the Ajax/build/WebRoot directory ? I don't have ant nor be able to reproduce what you've done

    Thanx

  9. #9
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Quote Originally Posted by Bruno R
    Could someone provides us with the content of the Ajax/build/WebRoot directory ? I don't have ant nor be able to reproduce what you've done

    Thanx
    FYI you can get ANT here: http://ant.apache.org/

  10. #10
    Join Date
    Oct 2005
    Location
    San Jose
    Posts
    5
    Rep Power
    10

    Default

    I'd really appreciate if someone would provide details on using Eclipse to build the project.

Similar Threads

  1. JSP Tag Library for AjaxTK?
    By dsmalley in forum Developers
    Replies: 3
    Last Post: 10-28-2005, 08:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •