<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-21728458</id><updated>2007-11-07T19:14:38.528-08:00</updated><title type='text'>Development Diary - J2EE, .NET, Web Technologies</title><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/index.php'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml'/><author><name>flake</name></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21728458.post-8656445795624388653</id><published>2007-08-20T22:11:00.000-07:00</published><updated>2007-08-20T22:14:55.044-07:00</updated><title type='text'>Latitude Longitude hover values on a map mashup</title><content type='html'>&lt;p&gt;This is just a simple little latitude &amp;amp; longitude map mashup to compile rough data points for testing&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Instructions:&lt;/strong&gt; Click on the map to record a point and get the lat/lng of your desired position &lt;br/&gt;&lt;br /&gt;&lt;span style='color:#999;'&gt;(you can record ten clicks before requiring a page refresh)&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="/developer_blog/hover_lat_lng.html" frameborder="0" height="875" width="390"&gt;&lt;/iframe&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2007/08/latitude-longitude-hover-values-on-map.php' title='Latitude Longitude hover values on a map mashup'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=8656445795624388653' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/8656445795624388653'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/8656445795624388653'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-310315077229313168</id><published>2007-07-14T00:35:00.000-07:00</published><updated>2007-07-14T00:44:16.598-07:00</updated><title type='text'>Asset Packager with Custom Rhino for super optimized JavaScript</title><content type='html'>Scott Becker has a wicked Javascript/CSS rails gem documented at:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;a  href="http://synthesis.sbecker.net/pages/asset_packager"&gt;http://synthesis.sbecker.net/pages/asset_packager&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If like me, you have a stray missing semi-colon somewhere or would prefer to have the compression done in a compiled way as opposed to jsmin's regular expression substitution,&lt;br /&gt;&lt;br /&gt;(note this requires a java runtime)&lt;br /&gt;&lt;br /&gt;1. download &lt;a  href="http://alex.dojotoolkit.org/shrinksafe/"&gt;DOJO shrinksafe's Custom Rhino jar&lt;/a&gt; from &lt;a  href="http://svn.dojotoolkit.org/dojo/trunk/buildscripts/lib/custom_rhino.jar"&gt;here&lt;/a&gt; into /vendor/plugins/asset_packager/lib&lt;br /&gt;&lt;br /&gt;2. and then modify&lt;br /&gt;/vendor/plugins/asset_packager/lib/synthesis/asset_package.rb as follows:&lt;br /&gt;     def compress_js(source)&lt;br /&gt;       #jsmin_path = "#{RAILS_ROOT}/vendor/plugins/asset_packager/lib"&lt;br /&gt;       custom_rhino_path = "#{RAILS_ROOT}/vendor/plugins/asset_packager/lib"&lt;br /&gt;       tmp_path = "#{RAILS_ROOT}/tmp/#{@target}_#{revision}"&lt;br /&gt;    &lt;br /&gt;       # write out to a temp file&lt;br /&gt;       File.open("#{tmp_path}_uncompressed.js", "w") {|f| f.write(source) }&lt;br /&gt;    &lt;br /&gt;       # compress file with JSMin library&lt;br /&gt;       #`ruby #{jsmin_path}/jsmin.rb &lt;#{tmp_path}_uncompressed.js &gt;#{tmp_path}_compressed.js \n`&lt;br /&gt;       &lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:24;" &gt;        cmd = "java -jar #{custom_rhino_path}/custom_rhino.jar -c #{tmp_path}_uncompressed.js &gt; #{tmp_path}_compressed.js \n"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:24;" &gt;        `#{cmd}`  &lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;PS. I havent yet chased up an easy way to rebuild the custom_rhino.jar  with &lt;a href="http://svn.dojotoolkit.org/dojo/trunk/buildscripts/lib/custom_rhino.diff"&gt;dojo's diff&lt;/a&gt; for newline stripping etc.</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2007/07/asset-packager-with-custom-rhino-for.php' title='Asset Packager with Custom Rhino for super optimized JavaScript'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=310315077229313168' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/310315077229313168'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/310315077229313168'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-3550270392933651573</id><published>2007-05-26T00:12:00.000-07:00</published><updated>2007-05-26T00:16:52.453-07:00</updated><title type='text'>Configuring HTTP Timeout for Rails GeoKit::Geocoders Plugin</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;My internet connection is pretty spotty and when it drops out, the&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;IpGeocoder.geocode(request_ip)&lt;/span&gt;&lt;br /&gt;functionality from the GeoKit::Geocoders Plugin takes forever and a day to resolve.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;/span&gt;&lt;br /&gt;I directly hacked&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;vendor/plugins/geokit/lib/geo_kit/geocoders.rb&lt;/span&gt;&lt;br /&gt;as follows:&lt;br /&gt;&lt;br /&gt;    class IpGeocoder &lt; Geocoder&lt;br /&gt;&lt;br /&gt;      private&lt;br /&gt;&lt;br /&gt;      # Given an IP address, returns a GeoLoc instance which contains latitude,&lt;br /&gt;      # longitude, city, and country code.  Sets the success attribute to false if the ip&lt;br /&gt;      # parameter does not match an ip address. &lt;br /&gt;      def self.do_geocode(ip)&lt;br /&gt;        return GeoLoc.new unless /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})?$/.match(ip)&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;#        response = Net::HTTP.get_response('api.hostip.info', "/get_html.php?ip=#{ip}&amp;position=true")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          domain = 'api.hostip.info'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          path = '/get_html.php'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          pars = "ip=#{ip}&amp;position=true"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          h = Net::HTTP::new(domain)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          h.read_timeout = 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          begin&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;            response = h.post(path, pars)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          rescue TimeoutError =&gt; e&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;            raise "Error calling #{domain}, #{path}, #{pars}: #{e.inspect}"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;          end     &lt;/span&gt;  &lt;br /&gt;       &lt;br /&gt;        response.is_a?(Net::HTTPSuccess) ? parse_body(response.body) : GeoLoc.new&lt;br /&gt;      rescue&lt;br /&gt;        logger.error "Caught an error during HostIp geocoding call: "+$!&lt;br /&gt;        return GeoLoc.new&lt;br /&gt;      end</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2007/05/configuring-http-timeout-for-rails.php' title='Configuring HTTP Timeout for Rails GeoKit::Geocoders Plugin'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=3550270392933651573' title='1 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/3550270392933651573'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/3550270392933651573'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-1153293039431589552</id><published>2007-02-06T11:30:00.000-08:00</published><updated>2007-02-06T12:19:50.815-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='BaseWithoutTable'/><category scheme='http://www.blogger.com/atom/ns#' term='Example'/><category scheme='http://www.blogger.com/atom/ns#' term='ActiveRecord'/><category scheme='http://www.blogger.com/atom/ns#' term='Ruby on Rails'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><category scheme='http://www.blogger.com/atom/ns#' term='Validation'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><category scheme='http://www.blogger.com/atom/ns#' term='Snippet'/><title type='text'>Email Form Validation in Ruby on Rails Tutorial</title><content type='html'>This tutorial shows how to perform email form validation in Ruby on Rails using the built-in ActiveRecord::Validations framework with a non-persistent model.&lt;br /&gt;&lt;br /&gt;Note: This tutorial assumes you already have Rails installed and have successfully created &amp; configured a database for your environment.&lt;br /&gt;&lt;br /&gt;Create a new Rails Project from the command line:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;C:\temp&amp;gt; rails EmailFormValidation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: in order to leverage ActiveRecord validation, the application will need to be hooked into a database, so even though this example doesn’t talk to a database, one needs to be configured anyway:&lt;br /&gt;Modify c:\temp\EmailFormValidation\config\database.yml to point to a locally running database:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;development:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  adapter: mysql&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  database: depot_development&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  username: root&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  password: password&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;  host: localhost&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Install the BaseWithoutTable plugin so that we can validate the model without persistence:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;C:\temp&amp;gt; cd EmailFormValidation&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;C:\temp\EmailFormValidation&amp;gt; ruby script/plugin install http://svn.viney.net.nz/things/rails/plugins/active_record_base_without_table/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create c:\temp\EmailFormValidation\app\models\Contact.rb to use BaseWithoutTable and set up the email fields:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;class Contact &amp;lt; ActiveRecord::BaseWithoutTable&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;column :name, :string&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;column :email_address, :string&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;column :enquiry, :string&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;validates_presence_of :name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;validates_format_of :email_address, :with =&amp;gt; /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;validates_length_of :email_address, :within =&amp;gt; 5..255&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;def send_email&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;if save&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;begin&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;return true #This tutorial does not cover Email configuration &amp; sending&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#return true if ApplicationMailer.deliver( ApplicationMailer.create_contact( self ) )    &lt;br /&gt;rescue Object =&amp;gt; e&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;errors.add("There is a problem with our email system and this form could not be submitted")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;false&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Test the Model – the Contact Object should now have validation on save:&lt;br /&gt;(note: If you have not correctly configured a database, you will see an error at this step along the lines of: Mysql::Error: Access denied for user: 'root@localhost')&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;C:\temp\EmailFormValidation&amp;gt; ruby script/console&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;gt;&amp;gt; c = Contact.new&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;=&amp;gt; #&amp;lt;Contact:0x487171c @new_record=true, @attributes={"name"=&amp;gt;nil, "enquiry"=&amp;gt;nil, "email_address"=&amp;gt;nil}&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;gt; c.save&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;=&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;false&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;gt;&amp;gt; c &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;=&amp;gt; #&amp;lt;Contact:0x4823030 @errors=#&amp;lt;ActiveRecord::Errors:0x48217bc @base=#&amp;lt;Contact:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;0x4823030 ...&amp;gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;@errors={"name"=&amp;gt;["can't be blank"], "email_address"=&amp;gt;["is too short (minimum is 5 characters)", "is invalid"]&lt;/span&gt;}&amp;gt;, @new_record=true, @attributes=&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;{"city"=&amp;gt;nil, "company"=&amp;gt;nil, "name"=&amp;gt;nil, "enquiry"=&amp;gt;nil, "number_members"=&amp;gt;nil&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;, "state"=&amp;gt;nil, "email_address"=&amp;gt;nil}&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;gt;&amp;gt; exit&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create c:\temp\EmailFormValidation\app\controllers\contact_controller.rb:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;class ContactController &amp;lt; ApplicationController&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;def index&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;if request.post?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;@contact_us_email = Contact.new(@params[:contact_us_email])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;if @contact_us_email.send_email&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;flash[:notice] = 'Thank you for the email! We will get back to you ASAP =]'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;@contact_us_email = nil&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Create c:\temp\EmailFormValidation\app\views\contact\ &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;(directory)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Create c:\temp\EmailFormValidation\app\views\contact\index.rhtml:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;title&amp;gt;Contact Us&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;style type="text/css"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;body{font-family:verdana;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#contact_us_email label {position:absolute; text-align:right; width:250px;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#contact_us_email input, #contact_us_email select, #contact_us_email textarea {margin-left:255px; margin-bottom:10px; width:180px;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#contact_us_email select{width:50px;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#contact_us_email label.required {text-align:left; font-style:italic; color:#B2B8CC;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;.fieldWithErrors {padding: 2px; background-color: red; display: table;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#errorExplanation { width: 400px; border: 2px solid red; padding: 7px; padding-bottom: 12px; margin-bottom: 20px; background-color: #f0f0f0;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#errorExplanation h2 { text-align: left; font-weight: bold; padding: 5px 5px 5px 15px; font-size: 12px; margin: -7px; background-color: #c00; color: #fff;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#errorExplanation p { color: #333; margin-bottom: 0; padding: 5px;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#errorExplanation ul li { font-size: 12px; list-style: square;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;#notice {color: green}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;p id="notice"&amp;gt;&amp;lt;%= flash[:notice] %&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;%= start_form_tag %&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;%= error_messages_for 'contact_us_email' %&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;fieldset id="contact_us_email"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;legend&amp;gt;Contact Us &amp;lt;/legend&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;label for="contact_us_email_name"&amp;gt;Your Name:&amp;lt;/label&amp;gt; &amp;lt;%= text_field(:contact_us_email, 'name', :size =&amp;gt; 255) %&amp;gt; &amp;lt;label class="required"&amp;gt;(required)&amp;lt;/label&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;label for="contact_us_email_email_address"&amp;gt;Email Address:&amp;lt;/label&amp;gt; &amp;lt;%= text_field(:contact_us_email, 'email_address', :size =&amp;gt; 255) %&amp;gt; &amp;lt;label class="required"&amp;gt;(required)&amp;lt;/label&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;label for="contact_us_email_enquiry"&amp;gt;Comments or Questions?&amp;lt;/label&amp;gt; &amp;lt;%= text_area(:contact_us_email, 'enquiry', :rows =&amp;gt; 6) %&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;label&amp;gt; &amp;lt;/label&amp;gt; &amp;lt;%= submit_tag("Submit Enquiry") %&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/fieldset&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;%= end_form_tag %&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Launch the built-in Webrick server &amp; test the form:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;C:\temp\EmailFormValidation&amp;gt; ruby script/server&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Point your web browser to &lt;span style="font-weight: bold;"&gt;http://localhost:3000/contact&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And Bob’s your uncle - The email form should now validate existence of data in the name &amp;amp; email fields and also validate the format of the email address using standard rails form validation.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;This example application can be downloaded from: &lt;a href="http://www.kangarooit.com/developer_blog/EmailFormValidation_RoR_Example.zip"&gt;EmailFormValidation_RoR_Example.zip&lt;/a&gt; (77kb)</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2007/02/email-form-validation-in-ruby-on-rails.php' title='Email Form Validation in Ruby on Rails Tutorial'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=1153293039431589552' title='2 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/1153293039431589552'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/1153293039431589552'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-116856575267954663</id><published>2007-01-11T17:31:00.000-08:00</published><updated>2007-01-11T17:35:52.693-08:00</updated><title type='text'>New Blogger Layouts Feature not compatible with FTP publishing</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;We needed a new blog publishing account at work for our &lt;a href="http://www.insiderpages.com/rubyonrails/index.html"&gt;Ruby on Rails Blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We chose Google Blogger which in the past (whilst in Beta) has worked superbly for me.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem:&lt;/span&gt;&lt;br /&gt;Customizing the layout in the new post-beta Blogger has a whole new tag library (eg. stuff like &lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;b:skin, b:section, b:widget&lt;/span&gt; etc. etc. instead of the old beta style: &lt;span style="color: rgb(51, 51, 255); font-style: italic;"&gt;$BlogPageTitle$, $BlogMetaData$, $BlogItemTitle$&lt;/span&gt; etc.)&lt;br /&gt;&lt;br /&gt;Unfortunately, any layouts developed using this new tag library will not work if you want to use FTP/SFTP publishing because the Blogger application does not support these Templating layout tags for FTP/SFTP (Yet?).&lt;br /&gt;&lt;br /&gt;This turned out to be a big waste of time in my case as we had a test blog set up to publish to blogspot which I used for template development (using the new templating tags) and when I tried to copy that template HTML over to our 'real' (Self-hosted, FTP-published) blog, the template tags failed to render.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/blogger_template_vs_layout-714601.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/blogger_template_vs_layout-712062.gif" title="Layout vs Template Blogger Blog Settings" alt="Layout vs Template Blogger Blog Settings" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;If you have set up the blog as hosted on blogspot.com and want to convert it to FTP publishing, you need to:&lt;br /&gt;- Go to Template Tab &gt; Edit HTML Screen&lt;br /&gt;- Click the 'Revert to Classic Template' link&lt;br /&gt;- Go to Settings Tab &gt; Publishing Screen&lt;br /&gt;- Click on the 'FTP' or 'SFTP' link and configure accordingly&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Other Web Resources dealing with this Issue:&lt;/span&gt;&lt;br /&gt;How can I use the new Blogger Layouts features?&lt;br /&gt;&lt;a href="http://help.blogger.com/bin/answer.py?answer=44474&amp;useful=0&amp;amp;show_useful=1"&gt;http://help.blogger.com/bin/answer.py?answer=44474&amp;useful=0&amp;amp;show_useful=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Blogger Beta: Classic or Beta template?&lt;br /&gt;&lt;a href="http://blogger-tricks.blogspot.com/2006/12/blogger-beta-classic-or-beta-template.html"&gt;http://blogger-tricks.blogspot.com/2006/12/blogger-beta-classic-or-beta-template.html&lt;br /&gt;&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2007/01/new-blogger-layouts-feature-not.php' title='New Blogger Layouts Feature not compatible with FTP publishing'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=116856575267954663' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116856575267954663'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116856575267954663'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-116552800936281815</id><published>2006-12-07T13:40:00.000-08:00</published><updated>2006-12-07T14:04:16.410-08:00</updated><title type='text'>Mac Widget for Local Search</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.insiderpages.com/mac_widget"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/screenshot_search_result-749143.gif" alt="Funky-looking Local Search Mac Widget" title="Funky-looking Local Search Mac Widget" border="0" /&gt;&lt;/a&gt;Today I came across Mac Widgets for the first time after using this cool &lt;a href="http://www.insiderpages.com/mac_widget"&gt;Local Search Widget&lt;/a&gt; from &lt;a href="http://www.insiderpages.com"&gt;Insider Pages&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It was a cool experience (being able to &lt;a href="http://www.insiderpages.com/mac_widget/"&gt;search for businesses eg. My local Taco Bell&lt;/a&gt; in a widget without having to launch a web-browser).&lt;br /&gt;&lt;br /&gt;I really like how easy it is to make these things (Mac Widgets) - they seem to be made up of some structured DHTML and that's about it!&lt;br /&gt;&lt;br /&gt;Note to self: Macs are getting cooler every day (especially amongst developers) - I will have to give it a go as a development environment sometime soon! (Maybe when Internet Explorer becomes standards compliant and web GUI's can be tested solely from Firefox).</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/12/mac-widget-for-local-search.php' title='Mac Widget for Local Search'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=116552800936281815' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116552800936281815'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116552800936281815'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-116526960671085803</id><published>2006-12-04T13:58:00.000-08:00</published><updated>2006-12-05T14:06:13.846-08:00</updated><title type='text'>Ruby on Rails / PHP HTTP Referer header</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;I've noticed Google does a nice job of highlighting your keywords on Googles cached 'HTML' version of indexed PDF documents eg. &lt;a href="http://66.102.7.104/search?q=cache:6TXmKD8SSc8J:java.sun.com/developer/onlineTraining/Database/jdbcrowsets.pdf+tutorial+pdf&amp;hl=en&amp;amp;gl=us&amp;ct=clnk&amp;amp;cd=2&amp;client=firefox-a"&gt;tutorial pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This could performed by checking the &lt;a href="http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14"&gt;Referer HTTP Header&lt;/a&gt;&lt;br /&gt;eg.&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;%= @request.env["HTTP_REFERER"] %&gt;&lt;/span&gt; in Ruby on Rails&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;$_SERVER["HTTP_REFERER"]&lt;/span&gt;   in PHP&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;I want to get a handle on any Google search query that a user has performed to visit a page on my site so that I can customize content specifically to their interest&lt;br /&gt;&lt;br /&gt;eg.&lt;br /&gt;A user searches on 'streetball blog' on Google&lt;br /&gt;eg. &lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;http://www.google.com/search?q=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);font-size:85%;" &gt;streetball&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;+&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);font-size:85%;" &gt;blog&lt;/span&gt;&lt;br /&gt;They click on "Jason's Streetball Blog" - a page I administer&lt;br /&gt;I want to customize this page based on their referring keywords.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PHP/Ruby on Rails Problem Solution (ie. getting a handle on referring keywords):&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;PHP:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;$ref = $_SERVER["HTTP_REFERER"]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;if (strstr($ref, "google.com/search?")) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;  $search_query = "";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;  $query_arg = strtok($ref, "&amp;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;  while ($query_arg !== false) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    if (strstr($query_arg, "q=")) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;      $search_query = substr($query_arg, 2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;      break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    $query_arg = strtok("&amp;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;  echo $search_query;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ruby on Rails:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; # Creates @referring_search containing any referring search engine query minus stop words&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; #&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; # eg. If the HTTP_REFERER header indicates page referer as:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; #     http://www.google.com/search?q=Most+Calories+iN+a+Cheesesteak+at+Belmont&amp;start=0&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;ie=utf-8&amp;oe=utf-8&amp;amp;client=firefox-a&amp;rls=org.mozilla:en-US:official&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; #    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; #     then this function will create:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; #     @referring_search = "Most Calories Cheesesteak Belmont"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; #    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; def setup_referring_keywords&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   # Check whether referring URL was a search engine result&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   referer = @request.env["HTTP_REFERER"]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   unless referer.nil_or_empty?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     search_referers = [&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://(www)?\\.?google.*', 'q'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://search\\.yahoo.*', 'p'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://search\\.msn.*', 'q'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://search\\.aol.*', 'userQuery'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://(www\\.)?altavista.*', 'q'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://(www\\.)?feedster.*', 'q'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://search\\.lycos.*', 'query'],&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ['^http://(www\\.)?alltheweb.*', 'q']&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       ]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     search_referers.each do |search_engine|&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       # Check if the referrer is a search engine we are targetting&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       pattern = search_engine[0]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       reg = Regexp.new(pattern)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       if (reg.match(referer))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         # Create a globally scoped variable (@referring_search) containing the referring Search Engine Query&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         query_args = URI.split(referer)[7]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         unless query_args.nil_or_empty?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;           query_param_name = search_engine[1]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;           query_args.split("&amp;").each do |arg|&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;             if arg.split("=")[0] == query_param_name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;               unstopped_keywords = CGI.unescape(arg.split("=")[1])&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;               stop_words = Regexp.new(/\b(\d+|\w|about|after|also|an|and|are|as|at|be|because|before|between|but|by|can|com|de|do|en|for|from|has|how|however|htm|html|if|i|in|into|is|it|la|no|of|on|or|other|out|since|site|such|than|that|the|there|these|this|those|to|under|upon|vs|was|what|when|where|whether|which|who|will|with|within|without|www|you|your)\b/i)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;               @referring_search = unstopped_keywords.gsub(stop_words, '').squeeze(' ')&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;               $logger.info("Referring Search Keywords: #{@referring_search}")&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;               break&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;             end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;           end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;         break&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;     end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   end&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; end&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/12/ruby-on-rails-php-http-referer-header.php' title='Ruby on Rails / PHP HTTP Referer header'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=116526960671085803' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116526960671085803'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116526960671085803'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-116417199577582077</id><published>2006-11-21T21:06:00.000-08:00</published><updated>2006-12-04T14:01:15.933-08:00</updated><title type='text'>&lt;iframe&gt; with 100% Height supporting window resizes, IE &amp; Firefox</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;Need to create a resizeable html &amp;lt;iframe&gt; element that stretches to almost the full height of a window.&lt;br /&gt;&lt;br /&gt;Expected:&lt;br /&gt;&amp;lt;iframe width="100%" height="100%"&gt;&amp;lt;/iframe&gt;&lt;br /&gt;to work.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;Setting the iframe.style.width=100% CSS property was incorrectly using the full height of the window and didn't factor the resize event.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&gt;&lt;br /&gt;&amp;lt;head&gt;&lt;br /&gt;&amp;lt;title&gt;Untitled&amp;lt;/title&gt;&lt;br /&gt;&amp;lt;style type="text/css"&gt;&lt;br /&gt;body, h1 {margin:0px; text-align:center; color:#000;}&lt;br /&gt;#header_div {background-color:red;}&lt;br /&gt;#diagnosed_site {width:99%; height:100%;}&lt;br /&gt;* html #diagnosed_site {width:100%;} /* IE workaround - firefox needs a 99% width to avoid a horizontal scroll-bar */&lt;br /&gt;&amp;lt;/style&gt;&lt;br /&gt;&amp;lt;script&gt;&lt;br /&gt;function resize_iframe() {&lt;br /&gt;var body_height = document.body.clientHeight;&lt;br /&gt;var header_height = document.getElementById("header_div").offsetHeight;&lt;br /&gt;var iframe = document.getElementById("diagnosed_site");&lt;br /&gt;iframe.style.height = parseInt(body_height) - parseInt(header_height) - 5;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;body onload="resize_iframe()" onresize="resize_iframe()"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id="header_div"&gt;&lt;br /&gt;&amp;lt;h1&gt;Iframe Test&amp;lt;/h1&gt;&lt;br /&gt;&amp;lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;iframe src="http://www.kangarooit.com/" id="diagnosed_site"&gt;&amp;lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/iframe_full_height_example-745602.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/iframe_full_height_example-742986.gif" alt="" border="0" /&gt;&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/11/iframe-with-100-height-supporting.php' title='&amp;lt;iframe&gt; with 100% Height supporting window resizes, IE &amp; Firefox'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=116417199577582077' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116417199577582077'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116417199577582077'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-116407198489765833</id><published>2006-11-20T17:10:00.000-08:00</published><updated>2006-11-20T17:23:29.453-08:00</updated><title type='text'>Sybase Error JZ00L when trying to connect/login to database</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;Trying to Connect to a Sybase Database, the login fails with an error message:&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);font-size:85%;" &gt;An error occured while establishing the connection.&lt;br /&gt;Type: java.sql.SQLException Error Code: 0 SQL State: JZ00L&lt;br /&gt;Message:&lt;br /&gt;JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;According to the &lt;a href="http://www.sybase.com/detail?id=47902"&gt;Sybase SQL Error Code description page&lt;/a&gt;, error JZ00L occurs as follows:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;This error occurs if you enter an incorrect password and/or login ID in the Password and Login ID fields of the Database Profile.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Refer: &lt;a href="http://www.sybase.com/detail?id=47902"&gt;http://www.sybase.com/detail?id=47902&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;/span&gt;&lt;br /&gt;There was no problem with username/password I was using.&lt;br /&gt;&lt;br /&gt;The problem I experienced was that the Sybase server had too many idle connections lying around (probably because our network dropped out prior to previous connections disconnecting correctly and we had finally reached our pool limit).&lt;br /&gt;&lt;br /&gt;I restarted the Sybase server &amp;amp; it resolved the issue. (It would have been cleaner to kill the idle connections)</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/11/sybase-error-jz00l-when-trying-to.php' title='Sybase Error JZ00L when trying to connect/login to database'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=116407198489765833' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116407198489765833'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/116407198489765833'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-115566799175978425</id><published>2006-08-15T11:45:00.000-07:00</published><updated>2006-08-16T10:53:00.766-07:00</updated><title type='text'>uninitialized constant FPDF - Ruby on Rails View Page Code</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;Trying to use my first Rails plugin - Rfpdf and after following the instructions on the &lt;a href="http://wiki.rubyonrails.org/rails/pages/Rfpdf"&gt;RoR Rfpdf documentation page&lt;/a&gt;, my page fails to load. Checking the &lt;a href="http://rubyforge.org/forum/?group_id=1869"&gt;associated forum&lt;/a&gt; didn't help - it's probably something easy because it's the first thing I've ever done anything with Rails.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;when trying:&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:78%;" &gt;pdf = FPDF.new()&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;the following error message is occuring:&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:78%;" &gt;&lt;span style="color: rgb(255, 0, 0);"&gt;uninitialized constant FPDF&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;I think the problem is that I attempted to install Rfpdf using:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;ruby script/plugin install svn://rubyforge.org//var/svn/rfpdf&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;however it appears that that particular command line syntax is &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt; specific and I did not yet have Subversion installed.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;/span&gt;&lt;br /&gt;Kind of straight-forward and ugly but I downloaded the source from:&lt;br /&gt;&lt;a href="http://rubyforge.org/projects/rfpdf/"&gt;http://rubyforge.org/projects/rfpdf/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and copied it into my vendor/profiles directory in my rails application source. I could have downloaded Subversion and done it properly, but apparently we don't use that here at my workplace.</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/08/uninitialized-constant-fpdf-ruby-on.php' title='uninitialized constant FPDF - Ruby on Rails View Page Code'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=115566799175978425' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/115566799175978425'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/115566799175978425'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-114307009552365627</id><published>2006-03-22T14:43:00.000-08:00</published><updated>2006-03-22T15:36:22.946-08:00</updated><title type='text'>Connecting a PDA to a USB Laptop HDD for extra storage</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/fig1-hp_ipaq_2490-757688.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/fig1-hp_ipaq_2490-756219.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;I recently purchased a &lt;a href="http://h10010.www1.hp.com/wwpc/us/en/sm/WF06b/215348-64929-215381-314903-f67-421399-1105214-1146683.html?jumpid=re_r138/05spmob_solutions/ipaqhx2490"&gt;HP iPAQ hx 2490 Pocket PC&lt;/a&gt; (PDA with Windows Mobile 5.0 Operating System) to take overseas for internet access &amp; entertainment (see figure 1).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;I want to take a lot of entertainment data overseas (movies &amp; mp3's etc.) and also use the device to back up a lot of high resolution photo's that we will be taking.&lt;br /&gt;&lt;br /&gt;The PDA could do this either with SD Cards or CF cards, however these mediums are highly expensive storage mediums eg:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;$109&lt;/span&gt; AUD - &lt;span style="font-weight: bold;"&gt;1gb&lt;/span&gt; Sandisk Ultra II Compact Flash Card&lt;/span&gt;&lt;span style="font-style: italic;"&gt; (from &lt;a href="http://www.organiserworld.com.au/"&gt;Organiser World&lt;/a&gt;)&lt;/span&gt;  &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$109&lt;/span&gt; AUD - &lt;span style="font-weight: bold;"&gt;1gb&lt;/span&gt; Sandisk Ultra II Secure Digital Card (from &lt;a href="http://www.organiserworld.com.au/"&gt;Organiser World&lt;/a&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;compared to normal Hard Drives eg:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;$145&lt;/span&gt; AUD - &lt;span style="font-weight: bold;"&gt;80gb&lt;/span&gt; Samsung 2.5 inch'' Inch ATA Notebook HDD Hard Disk (from &lt;a href="http://www.msy.com.au"&gt;msy&lt;/a&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/fig2-ipaq_usb_hdd-788604.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/fig2-ipaq_usb_hdd-786934.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Ideally, I would like to be able to plug the PDA directly into a laptop HDD Hard Disk using a USB laptop HDD case (eg. refer figure 2.), however when I connect the devices in this fashion (regardless of whether I am using the HP charger adapter to power the cradle), the USB laptop HDD light does not come on to indicate that it is being powered by the PDA.&lt;br /&gt;&lt;br /&gt;This indicates to me that there is a master-slave type relationship between USB devices, and that the HP iPAQ 2490 is not capable of performing the 'master' role.&lt;br /&gt;&lt;br /&gt;I wonder whether this is a software/Operating System issue with &lt;a href="http://www.microsoft.com/windowsmobile/5/"&gt;Windows Mobile 5.0&lt;/a&gt; (ie. whether it is/is not permitted by the Operating System)? If so, then I wonder if anyone has written PDA software that will facilitate this connection?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;/span&gt;&lt;br /&gt;The &lt;a href="http://www.ratocsystems.com/english/products/subpages/cfu1u.html"&gt;Ratoc USB 1.1 Host Adapter CF Card (CFU1U)&lt;/a&gt; (see figure 3) looks like it will solve the problem (of connecting the iPaq PDA to the USB laptop HDD Hard Disk), however at &lt;a href="http://www.froogle.com"&gt;$139&lt;/a&gt; (US), the cost is more then I would like to pay (especially if it would be technically possible to write software that would make the situation in figure 2 work).&lt;br /&gt;&lt;br /&gt;Also, I have not come across the Ratoc card here in Australia so have been unable to confirm whether it will work as hoped for with a USB laptop HDD Hard Disk. The question is whether the Windows Mobile 5.0 Operating System will pick up the USB HDD and allow it to be used for transfer of data.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/fig3-ratoc_usb_cf-751200.gif"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/fig3-ratoc_usb_cf-749791.gif" alt="" border="0" /&gt;&lt;/a&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/03/connecting-pda-to-usb-laptop-hdd-for.php' title='Connecting a PDA to a USB Laptop HDD for extra storage'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=114307009552365627' title='4 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114307009552365627'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114307009552365627'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-114108167715253839</id><published>2006-02-27T14:54:00.000-08:00</published><updated>2006-02-27T15:36:42.906-08:00</updated><title type='text'>xtags v1.0 parse custom JSP tag using Dom4J Document object parameter</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;Trying to parse a Dom4J XML Document using &amp;lt;xtags:parse&gt; in order to iterate through it (XSLT style) inside JSP code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;The JSP code has an inline Dom4J Document object, however it cannot be passed as a parameter to xtags:parse&lt;br /&gt;eg. when trying:&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:78%;" &gt;&amp;lt;%&lt;br /&gt;org.dom4j.Document xmlDoc = ...;&lt;br /&gt;%&gt;&lt;br /&gt;&amp;lt;xtags:parse reader="&amp;lt;%= xmlDoc %&gt;" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;the following error message is occuring:&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:78%;" &gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Explicit cast needed to convert org.dom4j.Document to java.io.Reader._jspx_th_xtags_parse_0.setReader( xmlDoc);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;according to the &lt;a href="http://jakarta.apache.org/taglibs/doc/xtags-doc/index.html#parse"&gt;xtags:parse v1.0 API documentation&lt;/a&gt;, this is occuring because the &lt;span style="font-style: italic;"&gt;reader&lt;/span&gt; parameter of xtags:parse requires an object of type java.io.Reader so the question is how to get a java.io.Reader from an org.dom4j.Document (The &lt;a href="http://jakarta.apache.org/taglibs/doc/xtags-doc/index.html#overview"&gt;xtags:parse v1.0 documentation&lt;/a&gt; shows how to parse a URL, an XML file, a java.io.Reader etc, but doesn't have an example for an org.dom4j.Document parameter).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;/span&gt;&lt;br /&gt;Kind of straight-forward and ugly but:&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:78%;" &gt;&amp;lt;%&lt;br /&gt;org.dom4j.Document xmlDoc = ...;&lt;br /&gt;%&gt;&lt;br /&gt;&amp;lt;xtags:parse&gt;&lt;br /&gt;  &amp;lt;%= xmlDoc.asXML() %&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-size:78%;" &gt;&amp;lt;/xtags:parse&gt;&lt;br /&gt;&lt;/span&gt;It would have been nicer to have a parameter to the tag that accepts an org.dom4j.Document however the performance doesn't seem to be an issue (ie. with the writing of the XML straight to the output stream).</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/02/xtags-v10-parse-custom-jsp-tag-using.php' title='xtags v1.0 parse custom JSP tag using Dom4J Document object parameter'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=114108167715253839' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114108167715253839'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114108167715253839'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-114048109691325956</id><published>2006-02-20T16:11:00.000-08:00</published><updated>2006-02-20T17:01:23.110-08:00</updated><title type='text'>Dom4j SAXParseException performing XSLT with JSTL 1.0 transform tag</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;Trying to perform an XSL Transformation of a Dom4J Document in some JSP.  Receiving SAXParseException.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;The Following Code:&lt;/span&gt;&lt;br /&gt;Document searchResults = ...&lt;br /&gt;&lt;br /&gt;&amp;lt;c:import url="/servlet/test.xsl" var="stylesheet" /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;x:transform xml="${&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;searchResults&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;}" xslt="${stylesheet}"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt; &amp;lt;x:param name="currentUrlNoQueryString" value="&amp;lt;%=request.getRequestURI()%&gt;"/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt; &amp;lt;x:param name="queryStringNoSortType" value="&amp;lt;%=queryStringNoSortType%&gt;"/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt; &amp;lt;x:param name="selectedSortType" value='&amp;lt;%=request.getParameter("selectedSortType")%&gt;'/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;/x:transform&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;is producing:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Document root element is missing.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;The solution was that my path to the XSL file (ie. "/servlet/test.xsl") was not being resolved properly.&lt;br /&gt;&lt;br /&gt;ie. I changed it explicitly to:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:78%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;c:import url="http://servername/servlet/test.xsl" var="stylesheet" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;and it worked. I Guess the error message wasn't intuitive enough for me at first (a lot of other forum posts eg. &lt;a href="http://swforum.sun.com/jive/thread.jspa?messageID=219865"&gt;this one&lt;/a&gt; and &lt;a href="http://forum.java.sun.com/thread.jspa?tstart=0&amp;forumID=34&amp;amp;start=0&amp;threadID=499493&amp;amp;trange=15&amp;range=15"&gt;this one&lt;/a&gt; seem to suggest the same error message can also be caused by invalid ie. non UTF characters at the beginning of the XML file).&lt;br /&gt;&lt;br /&gt;As a side-note, I was unable to find a JSTL 1.0 API specification anywhere. The &lt;a href="http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/x/transform.html"&gt;JSTL 1.1 API Specification for the x:transform tag&lt;/a&gt;  deprecates the &lt;span style="font-style: italic;"&gt;xml&lt;/span&gt; attribute and the 1.0 specification doesn't yet support the &lt;span style="font-style: italic;"&gt;doc&lt;/span&gt; attribute.</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/02/dom4j-saxparseexception-performing.php' title='Dom4j SAXParseException performing XSLT with JSTL 1.0 transform tag'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=114048109691325956' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114048109691325956'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114048109691325956'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-114013090042053131</id><published>2006-02-16T14:46:00.000-08:00</published><updated>2006-02-16T15:20:59.110-08:00</updated><title type='text'>Image Thumbnail (16*16px) Icons for common file types</title><content type='html'>Seems like I am constantly having to find icons for common file types. This page will serve as a reference to find them when needed:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_TXT-764878.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_TXT-758885.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Text&lt;/span&gt; (.txt) MimeType: &lt;span style="font-style: italic;"&gt;text/plain&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_ZIP-709921.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_ZIP-708338.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;WinZip&lt;/span&gt; (.zip) MimeType: &lt;span style="font-style: italic;"&gt;application/zip&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_PDF-780167.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_PDF-779116.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Adobe&lt;/span&gt; (.pdf) MimeType: &lt;span style="font-style: italic;"&gt;application/pdf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_SWF-773554.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_SWF-769357.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Macromedia Flash SWF&lt;/span&gt; (.swf) MimeType: &lt;span style="font-style: italic;"&gt;application/zip&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_DOC-790215.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_DOC-788941.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Microsoft Word&lt;/span&gt; (.doc) MimeType: &lt;span style="font-style: italic;"&gt;application/msword&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_XLS-713045.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_XLS-711898.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Excel&lt;/span&gt; (.xls) MimeType: &lt;span style="font-style: italic;"&gt;application/excel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_VSD-751854.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_VSD-747925.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Microsoft Visio&lt;/span&gt; (.vsd) MimeType: &lt;span style="font-style: italic;"&gt;application/x-visio&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_PPT-777950.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_PPT-776821.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Microsoft PowerPoint&lt;/span&gt; (.ppt) MimeType: &lt;span style="font-style: italic;"&gt;application/powerpoint&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_GIF-787508.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_GIF-786380.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;GIF Image&lt;/span&gt; (.gif) MimeType: &lt;span style="font-style: italic;"&gt;image/gif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_JPG-785271.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_JPG-783622.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;JPEG Image&lt;/span&gt; (.jpg, .jpeg) MimeType: &lt;span style="font-style: italic;"&gt;image/jpeg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_MPEG-777780.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_MPEG-776207.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;MPEG Video&lt;/span&gt; (.mpeg) MimeType: &lt;span style="font-style: italic;"&gt;video/mpeg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_BMP-792715.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_BMP-791708.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;BMP&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; Image&lt;/span&gt; (.bmp) MimeType: &lt;span style="font-style: italic;"&gt;image/bmp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_PNG-707372.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_PNG-706142.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;PNG Image&lt;/span&gt; (.png) MimeType: &lt;span style="font-style: italic;"&gt;image/png&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_EXE-743882.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://www.kangarooit.com/developer_blog/uploaded_images/filetype_EXE-741557.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Executable&lt;/span&gt; (.exe) MimeType: &lt;span style="font-style: italic;"&gt;application/octet-stream&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/02/image-thumbnail-1616px-icons-for.php' title='Image Thumbnail (16*16px) Icons for common file types'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=114013090042053131' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114013090042053131'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/114013090042053131'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-113935774423987025</id><published>2006-02-07T16:03:00.000-08:00</published><updated>2006-02-14T15:10:40.550-08:00</updated><title type='text'>Printing server-side JSP scriptlet code to output HTML conditionally from a custom JSP tag</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;The Java Web Application (WAR) that I am developing uses a content management system (&lt;a href="http://www.fatwire.com/"&gt;Fatwire CMS&lt;/a&gt;) that executes all JSP code during the publish process and spits the resultant HTML out into static files in the published output WAR.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description&lt;/span&gt;&lt;br /&gt;I needed to be able to conditionally either execute JSP code or write the JSP to the output.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;br /&gt;&lt;/span&gt;The JSP &lt;span style="font-style: italic;"&gt;bodycontent&lt;/span&gt; attribute of the tag config in the web.xml can be set to either 'JSP' or 'tagdependent' (as per this &lt;a href="http://www.weblogic.com/docs51/classdocs/API_taglib.html"&gt;article&lt;/a&gt;) ie:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;&lt;br /&gt;&amp;lt;bodycontent&gt;tagdependent&amp;lt;/bodycontent&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When bodycontent is set to 'JSP' in the web.xml, the following JSP code:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;%= "a" + "b" %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;outputs to the result stream:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;ab&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Wraps any 'dynamic' server side processing JSP code that is to&lt;br /&gt;be deployed to the application server without being parsed by&lt;br /&gt;the Fatwire publication process.&lt;br /&gt;&lt;br /&gt;Also, allows evaluation of the code in preview mode of Fatwire.&lt;br /&gt;&lt;br /&gt;however, when bodycontent is set to 'tagdependent' in the web.xml, the same JSP code outputs:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;&lt;%= "a" + "b" %&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The question now is how to conditionally determine whether to set bodycontent to 'JSP' or 'tagdependent'&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Resolution: &lt;/span&gt;Was unable to find a JSP API call that dynamically modified the &lt;span style="font-style: italic;"&gt;bodycontent&lt;/span&gt; property of the custom tag.  As a work-around, implemented a custom version of the Fatwire tag render:sattelitepage (containing if/else logic that either parsed the page in preview mode using ics.ReadPage() or otherwise printed out the include contents if in publish mode)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note: &lt;/span&gt;bodycontent should be set to 'tagdependent' not 'tagdependant' (that typo in the web.xml caused this error for me: &lt;span style="color: rgb(51, 102, 255);"&gt;jasper.error.bad.bodycontent.type&lt;/span&gt;)&lt;br /&gt;Using a custom JSP tag, the conditional&lt;br /&gt;saaj.jar fr</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/02/printing-server-side-jsp-scriptlet.php' title='Printing server-side JSP scriptlet code to output HTML conditionally from a custom JSP tag'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=113935774423987025' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/113935774423987025'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/113935774423987025'/><author><name>flake</name></author></entry><entry><id>tag:blogger.com,1999:blog-21728458.post-113866554484440476</id><published>2006-01-30T15:51:00.000-08:00</published><updated>2006-01-30T17:02:29.480-08:00</updated><title type='text'>Java Apache Axis upgrade from version 1.1 to 1.2 - IncompatibleClassChangeError</title><content type='html'>&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Background:&lt;/span&gt;&lt;br /&gt;The Java Web Application (WAR) that I developed makes a Web Service Call. I originally developed the application using Apache Axis version 1.1, however due to server deployment requirements, I have been forced to upgrade to Axis version 1.2.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Description&lt;/span&gt;&lt;br /&gt;After changing to the axis.jar in my WEB-INF/lib to Axis 1.2 (from Axis 1.1), the application started throwing the following error:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;java.lang.IncompatibleClassChangeError&lt;br /&gt;at org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1387)&lt;br /&gt;at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148)&lt;br /&gt;at org.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112)&lt;br /&gt;at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)&lt;br /&gt;at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)&lt;br /&gt;at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)&lt;br /&gt;at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)&lt;br /&gt;at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)&lt;br /&gt;at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)&lt;br /&gt;at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)&lt;br /&gt;at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)&lt;br /&gt;at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)&lt;br /&gt;at javax.xml.parsers.SAXParser.parse(Unknown Source)&lt;br /&gt;at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)&lt;br /&gt;at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)&lt;br /&gt;at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)&lt;br /&gt;at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)&lt;br /&gt;at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)&lt;br /&gt;at org.apache.axis.client.Call.invokeEngine(Call.java:2765)&lt;br /&gt;at org.apache.axis.client.Call.invoke(Call.java:2748)&lt;br /&gt;at org.apache.axis.client.Call.invoke(Call.java:2424)&lt;br /&gt;at org.apache.axis.client.Call.invoke(Call.java:2347)&lt;br /&gt;at org.apache.axis.client.Call.invoke(Call.java:1804)&lt;br /&gt;at au.com.sensis.intranet.webservices.OutlookCalendarSoap_BindingStub.getAllMeetingRequestResponses(OutlookCalendarSoap_BindingStub.java:360)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;after finding &lt;a href="http://mail-archives.apache.org/mod_mbox/ws-axis-user/200410.mbox/%3C2ED602334F87F94CB1CA268F9608C1946E9D61@moonraker.campus.ncl.ac.uk%3E"&gt;this forum post&lt;/a&gt;, and &lt;a href="http://bexee.sourceforge.net/appendix/reporting/lab.html"&gt;this post&lt;/a&gt;, I tried upgrading the Saaj.jar &amp; jaxrpc.jar.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Solution:&lt;br /&gt;&lt;/span&gt;After downloading the &lt;a href="http://ws.apache.org/axis/java/releases.html"&gt;Axis release 1.2.1&lt;/a&gt;, I upgraded:&lt;br /&gt;saaj.jar from version 1.1 to version 1.1&lt;br /&gt;jaxrpc.jar from version 1.1 to version 1.2&lt;br /&gt;&lt;br /&gt;and added:&lt;br /&gt;wsdl4j-1.5.1.jar to WEB-INF/lib&lt;br /&gt;&lt;br /&gt;This resolved the IncompatibleClassChangeError. It's a pity Apache didn't implement Axis 1.2 to be backwards compatible with Axis version 1.1.&lt;br /&gt;&lt;br /&gt;As a side comment, the Axis upgrade to version 1.2 was good because version 1.1 uses the 'enum' java reserved keyword in it's variable naming which causes warnings when running Java Source code level 1.5.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note:&lt;/span&gt; I was using the &lt;a href="http://www.myspotter.com/wsdl2java.shtml"&gt;mySpotter WSDL2Java Eclipse plugin&lt;/a&gt;to generate my Java stub to the web service using the WSDL, however upon examining the manifest.mf of the Axis jar in the com.myspotter.wsdl2java_1.1.0 plugin directory, discovered it was using Axis 1.1. Updating this jar alone didn't work, so I decided (based upon: ) to create an ANT script to generate the Web Service stubs (using wsdl4j-1.4.1.jar from the &lt;a href="http://ws.apache.org/axis/java/releases.html"&gt;axis release&lt;/a&gt;):&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;build.properties:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;# project information&lt;br /&gt;project.owner     = &lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;My Company&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;project.owner.url = http://mywebservice.asmx&lt;br /&gt;project.fullname  = &lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;My Company&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt; Web Service Java Client library Jar&lt;br /&gt;project.vendor      = My Company&lt;br /&gt;project.name      = myproject&lt;br /&gt;project.version   = 2&lt;br /&gt;project.year      = 2006&lt;br /&gt;build.version      = 1&lt;br /&gt;&lt;br /&gt;# directory paths&lt;br /&gt;build.dir        = c:/temp/jarsbuild&lt;br /&gt;lib.dir            = ../../WebApp/WEB-INF/lib&lt;br /&gt;build.dest.dir    = ../../Builds&lt;br /&gt;source.dir        = ../../src&lt;br /&gt;whos.who.web.service.wsdl.dev = http://x.asmx?WSDL&lt;br /&gt;whos.who.web.service.wsdl.stg = http://x.asmx?WSDL&lt;br /&gt;whos.who.web.service.wsdl.prd = http://x.asmx?WSDL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;build.xml&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:78%;" &gt;&lt;target name="buildStubJar"&gt;&lt;property name="current.jar.name" value="${pkg.jar.name}-${build.type}"&gt;&lt;property name="current.src.dir" location="${generated.dir}/${current.jar.name}"&gt;&lt;property name="current.classes.dir" location="${current.src.dir}-classes"&gt;&lt;tstamp&gt;&lt;jar destfile="${current.src.dir}.jar"&gt;&lt;fileset dir="${current.classes.dir}"&gt;&lt;manifest&gt;&lt;attribute name="Manifest-Version" value="${current.jar.name}"&gt;&lt;attribute name="Built-By" value="${user.name}"&gt;&lt;target name="compile-wsdl"&gt;&lt;mkdir dir="${java.output.dir}"&gt;&lt;path id="axis.classpath"&gt;&lt;target name="fetch-wsdl"&gt;&lt;target name="import-wsdl"&gt;&lt;java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="axis.classpath"&gt;&lt;arg file="${fetched.dir}/${jar.name}.wsdl"&gt;&lt;arg value="--output"&gt;&lt;arg file="${java.src.dir}"&gt;&lt;property file="build.properties"&gt;&lt;property name="fetched.dir" location="${build.dir}/fetched"&gt;&lt;property name="generated.dir" location="${build.dir}/generated"&gt;&lt;property name="pkg.jar.name" value="${project.name}-${project.version}.0.${build.version}"&gt;&lt;property name="compiled.src.dir" location="${build.dir}/compiled-src"&gt;&lt;target name="init"&gt;&lt;delete dir="${fetched.dir}"&gt;&lt;delete dir="${generated.dir}"&gt;&lt;mkdir dir="${fetched.dir}"&gt;&lt;target name="buildStubJar"&gt;&lt;property name="current.jar.name" value="${pkg.jar.name}-${build.type}"&gt;&lt;property name="current.src.dir" location="${generated.dir}/${current.jar.name}"&gt;&lt;property name="current.classes.dir" location="${current.src.dir}-classes"&gt;&lt;tstamp&gt;&lt;jar destfile="${current.src.dir}.jar"&gt;&lt;fileset dir="${current.classes.dir}"&gt;&lt;manifest&gt;&lt;attribute name="Manifest-Version" value="${current.jar.name}"&gt;&lt;attribute name="Built-By" value="${user.name}"&gt;&lt;target name="compile-wsdl"&gt;&lt;mkdir dir="${java.output.dir}"&gt;&lt;path id="axis.classpath"&gt;&lt;target name="fetch-wsdl"&gt;&lt;target name="import-wsdl"&gt;&lt;java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="axis.classpath"&gt;&lt;arg file="${fetched.dir}/${jar.name}.wsdl"&gt;&lt;arg value="--output"&gt;&lt;arg file="${java.src.dir}"&gt;&amp;lt;project name="OutlookUtilsJar" default="init" basedir="."&gt;&lt;br /&gt;   &amp;lt;description&gt;Sensis OutlookUtils Jar build file&amp;lt;/description&gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;property file="build.properties" /&gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;property name="fetched.dir" location="${build.dir}/fetched"/&gt;&lt;br /&gt;   &amp;lt;property name="generated.dir" location="${build.dir}/generated"/&gt;&lt;br /&gt;   &amp;lt;property name="pkg.jar.name" value="${project.name}-${project.version}.0.${build.version}"/&gt;&lt;br /&gt;   &amp;lt;property name="compiled.src.dir" location="${build.dir}/compiled-src"/&gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;target name="init"&gt;&lt;br /&gt;       &amp;lt;delete dir="${fetched.dir}"/&gt;&lt;br /&gt;       &amp;lt;delete dir="${generated.dir}"/&gt;&lt;br /&gt;       &amp;lt;mkdir dir="${fetched.dir}"/&gt;&lt;br /&gt;       &amp;lt;mkdir dir="${generated.dir}"/&gt;&lt;br /&gt;     &lt;br /&gt;       &amp;lt;antcall target="buildStubJar"&gt;&lt;br /&gt;           &amp;lt;param name="build.type" value="dev"/&gt;&lt;br /&gt;           &amp;lt;param name="wsdl" value="${whos.who.web.service.wsdl.dev}"/&gt;&lt;br /&gt;       &amp;lt;/antcall&gt;&lt;br /&gt;       &amp;lt;antcall target="buildStubJar"&gt;&lt;br /&gt;           &amp;lt;param name="build.type" value="stg"/&gt;&lt;br /&gt;           &amp;lt;param name="wsdl" value="${whos.who.web.service.wsdl.stg}"/&gt;&lt;br /&gt;       &amp;lt;/antcall&gt;&lt;br /&gt;       &amp;lt;antcall target="buildStubJar"&gt;&lt;br /&gt;           &amp;lt;param name="build.type" value="prd"/&gt;&lt;br /&gt;           &amp;lt;param name="wsdl" value="${whos.who.web.service.wsdl.prd}"/&gt;&lt;br /&gt;       &amp;lt;/antcall&gt;&lt;br /&gt;   &amp;lt;/target&gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;target name="buildStubJar"&gt;&lt;br /&gt;       &amp;lt;property name="current.jar.name" value="${pkg.jar.name}-${build.type}"/&gt;&lt;br /&gt;       &amp;lt;property name="current.src.dir" location="${generated.dir}/${current.jar.name}"/&gt;&lt;br /&gt;       &amp;lt;property name="current.classes.dir" location="${current.src.dir}-classes"/&gt;&lt;br /&gt;       &amp;lt;antcall target="fetch-wsdl"&gt;&lt;br /&gt;           &amp;lt;param name="jar.name" value="${current.jar.name}"/&gt;&lt;br /&gt;           &amp;lt;param name="wsdl" value="${wsdl}"/&gt;&lt;br /&gt;       &amp;lt;/antcall&gt;&lt;br /&gt;       &amp;lt;antcall target="import-wsdl"&gt;&lt;br /&gt;           &amp;lt;param name="jar.name" value="${current.jar.name}"/&gt;&lt;br /&gt;           &amp;lt;param name="java.src.dir" value="${current.src.dir}"/&gt;&lt;br /&gt;       &amp;lt;/antcall&gt;&lt;br /&gt;       &amp;lt;antcall target="compile-wsdl"&gt;&lt;br /&gt;           &amp;lt;param name="jar.name" value="${current.jar.name}"/&gt;&lt;br /&gt;           &amp;lt;param name="java.src.dir" value="${current.src.dir}"/&gt;&lt;br /&gt;           &amp;lt;param name="java.output.dir" location="${current.classes.dir}"/&gt;&lt;br /&gt;       &amp;lt;/antcall&gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;tstamp/&gt;&lt;br /&gt;       &amp;lt;jar destfile="${current.src.dir}.jar"&gt;&lt;br /&gt;           &amp;lt;fileset dir="${current.classes.dir}" /&gt;&lt;br /&gt;           &amp;lt;manifest&gt;&lt;br /&gt;               &amp;lt;attribute name="Manifest-Version" value="${current.jar.name}"/&gt;&lt;br /&gt;               &amp;lt;attribute name="Built-By" value="${user.name}"/&gt;&lt;br /&gt;               &amp;lt;section name="${project.name}"&gt;&lt;br /&gt;                 &amp;lt;attribute name="Specification-Vendor" value="${project.vendor}"/&gt;&lt;br /&gt;                 &amp;lt;attribute name="Implementation-Version" value="${TODAY}"/&gt;&lt;br /&gt;               &amp;lt;/section&gt;&lt;br /&gt;           &amp;lt;/manifest&gt;&lt;br /&gt;       &amp;lt;/jar&gt;&lt;br /&gt;&amp;lt;copy file="${current.src.dir}.jar" tofile="${build.dest.dir}/${pkg.jar.name}/${current.jar.name}.jar"/&gt;&lt;br /&gt;   &amp;lt;/target&gt;  &lt;br /&gt;&lt;br /&gt;   &amp;lt;target name="compile-wsdl"&gt;&lt;br /&gt;       &amp;lt;mkdir dir="${java.output.dir}"/&gt;&lt;br /&gt;       &amp;lt;javac srcdir="${java.src.dir}"&lt;br /&gt;           destdir="${java.output.dir}"&lt;br /&gt;           classpathref="axis.classpath"&lt;br /&gt;           debug="on"&lt;br /&gt;           source="1.4"&lt;br /&gt;       /&gt;&lt;br /&gt;   &amp;lt;/target&gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;path id="axis.classpath"&gt;&lt;br /&gt;       &amp;lt;fileset dir="${lib.dir}"&gt;&lt;br /&gt;           &amp;lt;include name="**/*.jar"/&gt;&lt;br /&gt;       &amp;lt;/fileset&gt;&lt;br /&gt;   &amp;lt;/path&gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;target name="fetch-wsdl"&gt;&lt;br /&gt;       &amp;lt;get src="${wsdl}" dest="${fetched.dir}/${jar.name}.wsdl"/&gt;&lt;br /&gt;   &amp;lt;/target&gt;&lt;br /&gt; &lt;br /&gt;   &amp;lt;target name="import-wsdl"&gt;&lt;br /&gt;&amp;lt;java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="axis.classpath"&gt;&lt;br /&gt;           &amp;lt;arg file="${fetched.dir}/${jar.name}.wsdl"/&gt;&lt;br /&gt;           &amp;lt;arg value="--output"/&gt;&lt;br /&gt;           &amp;lt;arg file="${java.src.dir}"/&gt;&lt;br /&gt;           &amp;lt;arg value="--verbose"/&gt;&lt;br /&gt;           &amp;lt;arg value="--package"/&gt;&lt;br /&gt;           &amp;lt;arg value="au.com.sensis.intranet.webservices"/&gt;&lt;br /&gt;       &amp;lt;/java&gt;&lt;br /&gt;   &amp;lt;/target&gt;&lt;br /&gt;     &lt;br /&gt; &lt;br /&gt;&amp;lt;/project&gt;&lt;br /&gt;&lt;br /&gt;&lt;/arg&gt;&lt;/arg&gt;&lt;/arg&gt;&lt;/java&gt;&lt;/target&gt;&lt;/target&gt;&lt;/path&gt;&lt;/mkdir&gt;&lt;/target&gt;&lt;/attribute&gt;&lt;/attribute&gt;&lt;/manifest&gt;&lt;/fileset&gt;&lt;/jar&gt;&lt;/tstamp&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/target&gt;&lt;/mkdir&gt;&lt;/delete&gt;&lt;/delete&gt;&lt;/target&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/arg&gt;&lt;/arg&gt;&lt;/arg&gt;&lt;/java&gt;&lt;/target&gt;&lt;/target&gt;&lt;/path&gt;&lt;/mkdir&gt;&lt;/target&gt;&lt;/attribute&gt;&lt;/attribute&gt;&lt;/manifest&gt;&lt;/fileset&gt;&lt;/jar&gt;&lt;/tstamp&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/target&gt;&lt;/span&gt;</content><link rel='alternate' type='text/html' href='http://www.kangarooit.com/developer_blog/2006/01/java-apache-axis-upgrade-from-version.php' title='Java Apache Axis upgrade from version 1.1 to 1.2 - IncompatibleClassChangeError'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21728458&amp;postID=113866554484440476' title='0 Comments'/><link rel='replies' type='application/atom+xml' href='http://www.kangarooit.com/developer_blog/atom.xml' title='Post Comments'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/113866554484440476'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21728458/posts/default/113866554484440476'/><author><name>flake</name></author></entry></feed>
