java
Tomcat appBase and docBase
By dmytro - Posted on December 19th, 2009
While deploying JSF/Ajax application faced very strange problem. JSF mapping was working for files only in application root dir and in all other dirs was thrown such exception:
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsf/core cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)Java/Python inverse regex
By dmytro - Posted on December 15th, 2009
Very simple but not very obvious inverse java/python regex:
^(.(?!(some text)))*$
So "String with some text inside" will give us:
>>> re.compile("^(.(?!(some text)))*$")
>>> r = regex.search(string)
# No match was found:
>>> rAnd "String without":
>>> re.compile("^(.(?!(some text)))*$")
>>> r = regex.search(string)
>>> r
<_sre.SRE_Match object at 0xc70014791f56cff8>
>>> regex.match(string)
<_sre.SRE_Match object at 0xc70014791f56ce00>Tada :)
Links:
http://www.pythonregex.com/ - online python regex test tool
