Upgrading from Grails 2.3.8 to 2.4.2
When upgrading to Grails 2.4.2 i ran into an issue where the following error message would pop up.
Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'grailsResourceLoader' while setting bean property 'grailsResourceLoader'; To solve this issue you need to delete some lines in the <grails-app>/web-app/WEB-INF/applicationContext.xml file.
Delete the following lines:
public class Promises { | |
private static class PageMetrics { | |
Integer visits; | |
Long avgMsOnPage; | |
@Override | |
public String toString() { | |
return String.format("{ avgMsOnPage=%d, visits=%d }", avgMsOnPage, visits); | |
} |
Plan for actually getting shit done | |
=================================== | |
1. Do not read emails or answer forum questions until 5pm every day. That way they don't piss me off for the rest of the day. | |
2. Set aside Friday afternoons for shitty process stuff that I can't completely avoid or delegate. That way it doesn't intrude on important work or make me depressed and not want to do anything for the rest of the week. | |
3. Spend rest of time actually getting shit done and creating cool stuff. | |
4. Profit! |
This is a script which runs a "bot" that tries to solve the incredibly addictive 2048 game. It makes use of Groovy and browser automation with Geb.
-
First step, if you don’t have it, you need to install Groovy.
-
Second step is to install the Google Chrome WebDriver (just unzip the appropriate file to a local directory)
-
Next, edit the script to set the path to the Chrome Driver
-
then execute the script: groovy solver2048.groovy
import org.vertx.groovy.core.Vertx | |
class BootStrap { | |
def init = { servletContext -> | |
def vertx = Vertx.newVertx() | |
def httpServer = vertx.createHttpServer() | |
vertx.createSockJSServer(httpServer).installApp(prefix: '/events') { sock -> | |
sock.dataHandler { buff -> | |
sock << buff |
update="updateResult_${i}" | |
onSuccess="function(data,textStatus){ alert('ok'); alert(data) };return true;" | |
<a href="/ca/tradeOrder/addToDrawback/64" onclick="jQuery.ajax({type:'POST',data:{'id': '64'}, url:'/ca/tradeOrder/addToDrawback',success:function(data,textStatus){jQuery('#updateResult_0').html(data);},error:function(XMLHttpRequest,textStatus,errorThrown){}});return false;" action="addToDrawback">加入退款</a> |
enum Status implements org.springframework.context.MessageSourceResolvable { | |
AVAILABLE, SOLD_OUT | |
public Object[] getArguments() { [] as Object[] } | |
public String[] getCodes() { [ name() ] } | |
public String getDefaultMessage() { "?-" + name() } | |
} |
// http://groovy.dzone.com/tips/quicktip-grails-scaffolding | |
class Product { | |
static enum Status { | |
AVAILABLE("Beschikbaar"), SOLD_OUT("Uitverkocht") | |
final String value | |
Status(String value) { | |
this.value = value |
document.addEventListener("deviceready", function(){ | |
var initUrl = location.href; | |
if (Device.platform === 'Android') { | |
//阻止按后退按钮就退出程序 | |
navigator.app.overrideBackbutton(true); | |
} | |
/*解决jquerymobile用phonegap打包后后退导航失效问题*/ | |
document.addEventListener("backbutton", function(){ |