Archive

Archive for the ‘http’ Category

Never ever ever make a php config file not a php file…

November 8th, 2010 1 comment

I was using a php sdk today where the config file is NOT a php file, but rather a file named .cfg…

The problem?  You have to restrict access to this file with a .htaccess file to prevent someone from reading it.  Whereas, if it were a php file, not only would you not have to prevent access to it, you also don’t have to write your own parser.

Lesson…  Don’t use a cfg file, where a php config file will do.

Categories: http, php, php5, web Tags:

Spring MVC Redirect using “redirect:url” syntax.

October 27th, 2010 2 comments

I searched online for how to do redirects from a controller, and only came up with the RedirectView…

But I KNEW there was an easier way I had seen before…

The key is make your controller function return a string…  And then return “redirect:URL” instead of a view name.  Violaa!

Absolute and relative urls work great.

See: Spring 3.0.x docs for UrlBasedViewResolver

Categories: http, java, spring Tags:

HttpFox Rocks!!! (Better than Tamper Data)

October 26th, 2010 No comments

I used to rely on the Firefox Plugin Tamper Data to get the nitty gritty deatails of http requests.  Firebug has a feature that is similar as well (the net tab).  But I find it buggy.  Recently, a fellow developer introduced me to the HttpFox Firefox plug-in, and it is awesome!

I now use it all the time.

The only caveat,  is only start it when you need it, and stop it when you are done.  Leaving HttpFox running and capturing for long periods of time slows Firefox a lot.

Check it out:  http://code.google.com/p/httpfox/

Categories: debugging, firefox, http, php, web Tags: