DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36521>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36521





------- Additional Comments From [EMAIL PROTECTED]  2005-09-17 13:05 -------
I am using tiles for non-portlet windows, but as I'm using the JSF portlet
bridge for the portlet windows, the TilesViewHandler is invoked along with all
the other view handlers when the portlet page is rended. In this case, as
Standalone Tiles does not support portlet-based applications, it is ok for the
view handler not to do anything.

The problem is easily fixed in org.apache.shale.tiles.TilesViewHandler.getTile
by checking the response and context objects, and if they are not a
ServletResponse or ServletContext (it is the servlet context which is the
problem, as the PortletResponse extends ServletResponse), return null. This
results in TilesViewHandler passing the request on to the next view handler.

Here is the changed getTile method that works:

private ComponentDefinition getTile(String name) {
     ComponentDefinition tile = null; 
     
     if (name != null) {

       ExternalContext externalContext = FacesContext.getCurrentInstance()
                                                    .getExternalContext();
                                                    
       Object request = externalContext.getRequest();
       Object context = externalContext.getContext();
       
       if (request instanceof ServletRequest
         && context instanceof ServletContext) {
         ServletRequest servletRequest = (ServletRequest)request;
         ServletContext servletContext = (ServletContext)context;
        
         try {
           tile = TilesUtil.getDefinition(name, servletRequest, servletContext);
         }
         catch(NoSuchDefinitionException  nsex) { /* not here */ }
         catch(DefinitionsFactoryException dex) { /* not here */ }
  
         if (tile == null && name.startsWith("/")) { // try again w/o slash...
           try {
              tile = TilesUtil.getDefinition(name, servletRequest, 
                servletContext);
           }
           catch(NoSuchDefinitionException  nsdex) { /* not here */ }
           catch(DefinitionsFactoryException dfex) { /* not here */ }
         }
      }
      else {
        if (log.isDebugEnabled()) {
          log.debug("Not a servlet request, ignoring");
        }
      }
     }

     return tile;
   }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to