Month: April 2017

Regex + Javascript: pitfalls concerning dot, backslash and others

console.log(“====== ^ and $ =====”); console.log(/a/.test(“abc”)); //true console.log(/^a$/.test(“abc”)); //false. Add ^ ad $ to confirm a non-partial match console.log(“====== dot =====”); console.log(/^.$/.test(“a”)); //true. A dot means any character console.log(/^\.$/.test(“a”)); //false. \. means dot console.log(/^\.$/.test(“.”)); //true. \. means dot console.log(/^[.]$/.test(“a”)); //false. A dot in brackets means a real dot console.log(/^[.]$/.test(“.”)); //true. A dot in brackets means …

Regex + Javascript: pitfalls concerning dot, backslash and others Read More »

Wildfly wierd feature in 8.2.0 — automatic redirect if your path matches a directory under your webapp

1. If there is a directory "abc" under your webapp root directory and there is no index.jsp under this "abc" directory 2. and you request http://xxx/abc regardless of GET or POST method 3. then wildfly will redirect you to: 302, GET http://xxx/abc/ The code is on github String remaining = match.getRemaining() == null ? match.getMatched() …

Wildfly wierd feature in 8.2.0 — automatic redirect if your path matches a directory under your webapp Read More »