Changing the Grails Default Server Port

March 9, 2010

The Grails tutorial I read said provided instructions for changing the default server port from 8080 to some other value, so that you would not need to specify an alternate server port every time you run-app. It said that you should open $GRAILS_HOME/scripts/Init.groovy and look for a line setting the value of serverPort.

The problem is that this tutorial was written in 2008, and while you wouldn’t think that much would have changed since then, apparently the Grails config files have been refactored. Init.groovy now appears to be a much higher-level file, and serverPort isn’t specified in it.

After searching the Grails directory, I found out that the new file to edit is $GRAILS_HOME/scripts/_GrailsSettings.groovy. Open it and look for the following line:

serverPort = getPropertyValue("server.port", 8080).toInteger()

I believe the getPropertyValue method checks properties sent in via the command line or configured in some other way. If it’s not set, though, it uses the second parameter as the default value. Change it from 8080 to some other port, like 9090, and the next time you run-app you’ll be running on the new port instead


iPhone Development Options

March 9, 2010

Either I’m behind the times, or Apple isn’t great about communicating all the options out there for iPhone development. I just found out about Dashcode, an iPhone SDK for creating web apps with all the standard awesome iPhone widgets. It even lets your web app run offline! This being the case, I thought I’d put together a summary of the options you have for creating iPhone web sites/apps. Please comment if I’ve gotten anything incorrect, and help me out by providing better links =]

Web Site iPhone Site Offline Site App Store
Accessible y y y y
Other Mobile y y ? n
Offline n n y y
Zooming y n n n
App Store Approval n n n y
App Store Sales n n n y
iPhone Data n n n y
Push n n n y
  • Web Site – This refers to a regular web site, without any adjustments for the iPhone.
  • iPhone Site – This refers to a web site with some changes for the iPhone. It might be as simple as a few meta tags and CSS styles, or you might have to rewrite your views to be iPhone targeted. Either way, though, it’s not much effort. More Info
  • Offline Site – This refers to a webapp that’s set up to be able to run offline. If your users save your app to the home screen, everything on that page is saved as well, including JavaScript. If the app is set up to use a JavaScript-accessible local storage library, that data will be accessible as well. Apple has created an SDK called Dashcode that offers not only offline storage, but also easy drag-and-drop usage of regular iPhone UI widgets as well. More Info
  • App Store – This is what most people think of when they think of iPhone apps. These are written in Objective C using the iPhone SDK. They require App Store approval to be sold. More Info

Follow

Get every new post delivered to your Inbox.

Join 525 other followers