Sunday, February 21, 2010

YUI + Struts2 + asyncRequest + POST

I finally figured out this issue today - working with the YUI 2.x, Struts2. I am using YAHOO.util.Connect.asyncRequest('POST', url, callback, postData), and was finding that the postData was not being set in my action. Turns out - YUI wasn't setting the content type header to "application/x-www-form-urlencoded" and because of this Struts wasn't parsing the post data. The problem was this section of asyncRequest:


if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
this.initHeader('Content-Type', this._default_post_header);
YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.', 'info', 'Connection');
}


Turns out, this._isFormSubmit was undefined here, so === false turned out to be false. Changing it to !this._isFormSubmit solved the problem.

Tuesday, February 16, 2010

Developers aren't important in startups?

Dave McClure at Business Week says at startups "Design and marketing aren't just as important as engineering: They are way more important." Full Article.


I agree with Dave 100%, but I don't think he did a great job justifying his viewpoint. So, let me help him out.


His point is clearer when you consider all the real world examples of his philosophy in action. Just look at all those startups out there killing it by ignoring engineering and focusing on design and marketing. Companies like, um, well, hey, have you seen those mac ads, now that's marketing! If only Microsoft had marketing like that! My next statement is really going to blow you away. Wait for it... wait for it... "human sexuality". Now you know I'm right! Sexual humans. Human sex-u-ality. BAM!


And, let's not forget to look at the disaster that comes from believing engineering is a key skill needed. Take google, they epitomize "engineers above all else". Hell, I've know engineers who have passed on job offers from Google because they thought they were too "pro engineer". But, google was founded a long time ago, like when we were all 10 years younger. Today, it's all just styling forms and cutting distribution deals.


So, in summary, yes, all the big names in start ups were founded by engineers and solved lots of hard problem; but, shit moves fast, and now it's just forms, killer design, and marketing, but not marketing like traditional marketing, like new twitter distribution channels.


HUMAN SEXUALITY!