Use blank strings instead of nulls as placeholder values when replacing placeholders.

 Reference from mailing list:
  http://thread.gmane.org/gmane.comp.apache.tiles.user/685
     
>  <definition name="layout" template="/WEB-INF/layout/web.jsp"/>
>   <definition name="layout.mob" template="/WEB-INF/layout/mob.jsp"/>
>   <definition name="layout.tab" template="/WEB-INF/layout/tab.jsp"/>
>   <definition name="REGEXP:home(\.(mob|tab))?" extends="layout{1}">
>     <put-attribute name="heading" value="Home" />
>     <put-list-attribute name="body">
>       <add-attribute value="/WEB-INF/views/home.jsp" />
>     </put-list-attribute>
>   </definition>
>
> The above rules match a pattern employed with spring-mobile where
>  views can be resolved based on (mob)ile/(tab)let/normal , as normal is
>  a fallback it does not contain a suffix.
> 
> I can understand why this fails as the capture {1} does not exist in
>  the found pattern, instead I'd like it to recognise this and evaluate
>  to an empty string.
> 
> Full stack-trace is as follows: 
> java.lang.NullPointerException
>        at org.apache.tiles.BasicAttributeContext.inherit(BasicAttributeContext.java:212)
>        at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.getDefinitionFromResolver(ResolvingLocaleUrlDefinitionDAO.java:84)
>        …
      

The code ends up looking for "layoutnull" instead of "layout".

This comes from in RegexpDefinitionPatternMatcher.createDefinition(..) the call to matcher.group(i) returning null.

Rather than fix it there though i'd rather put the fix in lower down in PatternUtil.replacePlaceholders(..) so that any nulls in the vars parameter are always replaced with blanks.


git-svn-id: https://svn.apache.org/repos/asf/tiles/framework/branches/TILES_3_0_X@1571643 13f79535-47bb-0310-9956-ffa450edef68