I would like to have flow+views in the same package, in classpath, and use relative view name in view-state, like this :
/foo/bar/my-flow.xml
/foo/bar/my-view.xhtml
Code:
<view-state id="foo" view="my-view" />
Solution above didnt work for me with webflow 2.0.8, so here is my contribution 
I use a BeanPostProcessor to override all flowApplicationContext ResourceLoader in the FlowRegistry.
Code:
public class FlowRegistryClassPathPostProcessor implements BeanPostProcessor {
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if(bean instanceof FlowDefinitionRegistry) {
alterRegistry((FlowDefinitionRegistry) bean);
}
return bean;
}
protected void alterRegistry(FlowDefinitionRegistry registry) {
for(String flowId : registry.getFlowDefinitionIds()) {
ApplicationContext ctx = registry.getFlowDefinition(flowId).getApplicationContext();
overrideResourceLoader((GenericApplicationContext) ctx);
}
}
protected void overrideResourceLoader(GenericApplicationContext ctx) {
ctx.setResourceLoader(new CustomFlowResourceLoader((ClassPathResource)ctx.getResource("")));
}
}
Code:
class CustomFlowResourceLoader implements ResourceLoader {
private ClassPathResource base;
public CustomFlowResourceLoader(ClassPathResource base) {
this.base = base;
}
public ClassLoader getClassLoader() {
return base.getClassLoader();
}
public Resource getResource(String location) {
return new CustomClassPathContextResource(base.getPath()+location, base.getClassLoader());
}
}
Code:
class CustomClassPathContextResource extends ClassPathResource implements ContextResource {
public CustomClassPathContextResource(String path, ClassLoader classLoader) {
super(path, classLoader);
}
public String getPathWithinContext() {
return getPath();
}
public Resource createRelative(String relativePath) {
String pathToUse = StringUtils.applyRelativePath(getPath(), relativePath);
return new CustomClassPathContextResource(pathToUse, getClassLoader());
}
}
Sample use :
Code:
<bean class="foo.bar.FlowRegistryClassPathPostProcessor" />