Re: Updated version of TilesViewHandler
If you are willing to use JSF RI 1.2 (not MyFaces), then I posted an experimental version as an attachment at: http://issues.apache.org/struts/browse/SHALE-302 -= Gregg =- Garner, Shawn wrote: Since the release of a GA version of Standalone Tiles when can we expect a new version of the TilesViewHandler compatible with 2.0.5 of standalone tiles? I tried the current one with 2.0.5 and got no class def found exceptions. Shawn -Message Disclaimer- This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to [EMAIL PROTECTED] and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation. Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act (E-Sign) unless a specific statement to the contrary is included in this message. While this communication may be used to promote or market a transaction or an idea that is discussed in the publication, it is intended to provide general information about the subject matter covered and is provided with the understanding that The Principal is not rendering legal, accounting, or tax advice. It is not a marketed opinion and may not be used to avoid penalties under the Internal Revenue Code. You should consult with appropriate counsel or other advisors on all matters pertaining to legal, tax, or accounting obligations and requirements. signature.asc Description: OpenPGP digital signature
Re: SV: Tiles integration
Sorry I didn't reply to this earlier, but I didn't see it until now. I did not do this, because the code is RI specific. It uses a number of Sun com classes in the imports for example. When I posted this previously on 7/25 under topic: Any sucess with shale nightly 20070717 and RI JSF 1.2?, Mr. VanMatre correctly pointed this out and I just thought that this meant that the Shale developers would rather just go their own way rather than use anything from this code. I have been using this view handler since that time and have not had problems with it. I'm using Tiles 2.0.4, Trinidad 1.2.1, Tomahawk 1.1.6, dojo 0.9, shale 1.1.0 snapshot 20070923. I haven't used much of Shale yet, just really Tiles so far and I haven't mixed in Spring or Hibernate, since I have not gotten to that part in my dev effort so I can not speak to them yet. If there is interest I would be happy to post it as a JIRA item. -= Gregg =- Antonio Petrelli wrote: Gregg, why don't you post your work as a patch in JIRA? If you cannot find the right issue, open a new one. Anyway good candidates are: https://issues.apache.org/struts/browse/SHALE/component/21281 Antonio 2007/9/13, Gregg Leichtman [EMAIL PROTECTED]: I was not successful in getting the webapp stack that you mention to work. I ended up modifying an old TilesViewHandler to work with JSF 1.2 RI v1.2_04-b16-p02, not MyFaces, a nightly snapshot of Shale 1.1.0 from July 17, 2007, the released version of Trinidad 1.2.1, Tomahawk 1.1.6, JSTL 1.1.2 and Tiles 2.0.4. The view handler has worked well for me so far, (I'm still just developing my webapp with it) so if you're willing to use this experimental version along with the RI until these issues are resolved, you can find a posted copy of the source code at: http://www.nabble.com/Any-sucess-with-shale-nightly-20070717-and-RI-JSF-1.2--tf4123632.html#a11784014 -= Gregg =- Hermod Opstvedt wrote: Hi I don't think think MyFaces 1.2 is compatible with that Tiles version - Ask on the MyFaces list. Hermod -Opprinnelig melding- Fra: Edward Dowgiallo [mailto:[EMAIL PROTECTED] Sendt: 28. august 2007 21:31 Til: user@shale.apache.org Emne: Fwd: Tiles integration -- Forwarded message -- From: Edward Dowgiallo [EMAIL PROTECTED] Date: Aug 28, 2007 3:20 PM Subject: Tiles integration To: [EMAIL PROTECTED] I'm trying to get the following combination running: - MyFaces 1.2.0 - Shale Tiles 1.0.4 - Trinidad 1.2.1 Willing to try other combinations, especially if someone has a blank.warhandy. Been at this for about 7 hours now. Getting the following exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Request.java:2301) org.apache.catalina.connector.Request.getSession(Request.java :2075) org.apache.catalina.connector.RequestFacade.getSession( RequestFacade.java:83 3) org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession (ServletExternalContextImpl.java:117) org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession (Exte rnalContextDecorator.java:92) org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession (ExternalContextDecorator.java:92) org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession (TokenCache.java:72) org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCac he(StateManagerImpl.java :548) org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSeriali zedView(StateManagerImpl.java:265) javax.faces.application.StateManager.saveView(StateManager.java :47) org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter .flushToWriter (JspViewHandlerImpl.java:387) org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView (JspViewHand lerImpl.java:322) javax.faces.application.ViewHandlerWrapper.renderView( ViewHandlerWrapper.jav a:45) org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView (ViewHandlerImpl.java:174) org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java :176 ) javax.faces.application.ViewHandlerWrapper.renderView( ViewHandlerWrapper.jav a:45) org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView (ViewHandlerImpl.java:174
Re: SV: Tiles integration
signature.asc Description: OpenPGP digital signature
Re: SV: Tiles integration
I was not successful in getting the webapp stack that you mention to work. I ended up modifying an old TilesViewHandler to work with JSF 1.2 RI v1.2_04-b16-p02, not MyFaces, a nightly snapshot of Shale 1.1.0 from July 17, 2007, the released version of Trinidad 1.2.1, Tomahawk 1.1.6, JSTL 1.1.2 and Tiles 2.0.4. The view handler has worked well for me so far, (I'm still just developing my webapp with it) so if you're willing to use this experimental version along with the RI until these issues are resolved, you can find a posted copy of the source code at: http://www.nabble.com/Any-sucess-with-shale-nightly-20070717-and-RI-JSF-1.2--tf4123632.html#a11784014 -= Gregg =- Hermod Opstvedt wrote: Hi I don't think think MyFaces 1.2 is compatible with that Tiles version - Ask on the MyFaces list. Hermod -Opprinnelig melding- Fra: Edward Dowgiallo [mailto:[EMAIL PROTECTED] Sendt: 28. august 2007 21:31 Til: user@shale.apache.org Emne: Fwd: Tiles integration -- Forwarded message -- From: Edward Dowgiallo [EMAIL PROTECTED] Date: Aug 28, 2007 3:20 PM Subject: Tiles integration To: [EMAIL PROTECTED] I'm trying to get the following combination running: - MyFaces 1.2.0 - Shale Tiles 1.0.4 - Trinidad 1.2.1 Willing to try other combinations, especially if someone has a blank.warhandy. Been at this for about 7 hours now. Getting the following exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Request.java:2301) org.apache.catalina.connector.Request.getSession(Request.java:2075) org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83 3) org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession (ServletExternalContextImpl.java:117) org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession(Exte rnalContextDecorator.java:92) org.apache.myfaces.trinidad.context.ExternalContextDecorator.getSession (ExternalContextDecorator.java:92) org.apache.myfaces.trinidadinternal.util.TokenCache.getTokenCacheFromSession (TokenCache.java:72) org.apache.myfaces.trinidadinternal.application.StateManagerImpl._getViewCac he(StateManagerImpl.java :548) org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveSeriali zedView(StateManagerImpl.java:265) javax.faces.application.StateManager.saveView(StateManager.java:47) org.apache.myfaces.application.jsp.JspViewHandlerImpl$StateMarkerAwareWriter .flushToWriter (JspViewHandlerImpl.java:387) org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHand lerImpl.java:322) javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav a:45) org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView (ViewHandlerImpl.java:174) org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176 ) javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.jav a:45) org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView (ViewHandlerImpl.java:174) org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176 ) org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseEx ecutor.java:41) org.apache.myfaces.lifecycle.LifecycleImpl.render (LifecycleImpl.java:132) javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) tiles-defs.xml tiles-definitions !-- === -- !-- Master definition -- !-- === -- !-- Doc index page description -- definition name=test template=/page/layout.jsp put-attribute name=header value=/tile/header.jsp/ put-attribute name=footer value=/tile/footer.jsp/ /definition /tiles-definitions faces-config.xml faces-config xmlns=http://java.sun.com/xml/ns/javaee xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd; version=1.2 application !-- Tiles Integration -- view-handlerorg.apache.shale.tiles.TilesViewHandler/view-handler /application /faces-config web.xml web-app xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xmlns=http://java.sun.com/xml/ns/javaee; xmlns:web= http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
Re: Any sucess with shale nightly 20070717 and RI JSF 1.2?
signature.asc Description: OpenPGP digital signature
Re: Any sucess with shale nightly 20070717 and RI JSF 1.2?
of pos, if so, write our // state out. if (builder.indexOf( RIConstants.SAVESTATE_FIELD_MARKER, pos) == tildeIdx) { // buf is effectively zero'd out at this point int statePos = 0; while (statePos stateLen) { if ((stateLen - statePos) bufSize) { // enough state to fill the buffer stateBuilder.getChars(statePos, (statePos + bufSize), buf, 0); orig.write(buf); statePos += bufSize; } else { int slen = (stateLen - statePos); stateBuilder.getChars(statePos, stateLen, buf, 0); orig.write(buf, 0, slen); statePos += slen; } } // push us past the last '~' at the end of the marker pos += (len + STATE_MARKER_LEN); tildeIdx = getNextDelimiterIndex(builder, pos); } else { pos = tildeIdx; tildeIdx = getNextDelimiterIndex(builder, tildeIdx + 1); } } } else { // we've written all of the state field markers. // finish writing content if (totalLen - pos bufSize) { // there's enough content to fill the buffer builder.getChars(pos, (pos + bufSize), buf, 0); orig.write(buf); pos += bufSize; } else { // we're near the end of the response builder.getChars(pos, totalLen, buf, 0); int len = (totalLen - pos); orig.write(buf, 0, len); pos += (len + 1); } } } } private static int getNextDelimiterIndex(StringBuilder builder, int offset) { return builder.indexOf(RIConstants.SAVESTATE_FIELD_DELIMITER, offset); } } } -- end TilesViewHandler.java Gary VanMatre wrote: Sorry about the empty post. Let's try again. There appears to be an unresolved bug from 02/Oct/06 reported against this problem along with a workaround at: https://issues.apache.org/struts/browse/SHALE-302 http://forum.java.sun.com/thread.jspa?threadID=770686messageID=4408064 http://forum.java.sun.com/thread.jspa?threadID=770686messageID=4408064 -= Gregg =- Gregg, thanks for providing more information. The issues that Shale has with regards to the proposed changes: * Shale doesn’t yet have a code branch specifically focusing on JSF 1.2. We have talked about doing this but have not made it a priority. * Shale tries to be RI neutral. The solution on the forum uses classes in the implementation of the Sun RI. This solution wouldn’t work with myfaces. Gary Subject: Re: Any sucess with shale nightly 20070717 and RI JSF 1.2? From: Gregg Leichtman [EMAIL PROTECTED] Date: Wed, 25 Jul 2007 04:10:34 + To: user@shale.apache.org To: user@shale.apache.org Sorry about the empty post. Let's try again. There appears to be an unresolved bug from 02/Oct/06 reported against this problem along with a workaround at: https://issues.apache.org/struts/browse/SHALE-302 http://forum.java.sun.com/thread.jspa?threadID=770686messageID=4408064 -= Gregg =- Gregg Leichtman wrote: I have assembled a small sample project using: RI of JSF 1.2 v1.2_04_p2 Shale nightly 20070717 tiles-core-2.0-r468346-SNAPSHOT.jar from the Shale nightly distribution JSTL 1.1.2 Tomcat 6.0.13 Updated the faces-config.xml to use: faces-config xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd; version=1.2 Updated the web.xml to use: web-app version=2.5 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; I have the same sample project working successfully using: myfaces 1.1.4 Shale nightly 20070409 tiles-core-2.0-r468346-SNAPSHOT.jar from the Shale nightly distribution JSTL 1.1.2 Tomcat 6.0.13 faces-config.xml: !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN http://java.sun.com/dtd/web-facesconfig_1_1.dtd; web.xml: web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; When I attempt to display the home page of the new project, I get a blank page. I have checked the tomcat logs and there are no complaints. The web page source from the page that is displayed consists only of: html lang=en /html Using Live HTTP Headers inside FireFox yielded nothing of interest as far as I can tell. Have I mixed incompatible components? If not does anyone have a suggestion short of debugging the JSF RI or tiles source on how I can track down what is happening? -= Gregg =- signature.asc Description: OpenPGP digital signature
Re: Any sucess with shale nightly 20070717 and RI JSF 1.2?
Sorry about the empty post. Let's try again. There appears to be an unresolved bug from 02/Oct/06 reported against this problem along with a workaround at: https://issues.apache.org/struts/browse/SHALE-302 http://forum.java.sun.com/thread.jspa?threadID=770686messageID=4408064 -= Gregg =- Gregg Leichtman wrote: I have assembled a small sample project using: RI of JSF 1.2 v1.2_04_p2 Shale nightly 20070717 tiles-core-2.0-r468346-SNAPSHOT.jar from the Shale nightly distribution JSTL 1.1.2 Tomcat 6.0.13 Updated the faces-config.xml to use: faces-config xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd; version=1.2 Updated the web.xml to use: web-app version=2.5 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; I have the same sample project working successfully using: myfaces 1.1.4 Shale nightly 20070409 tiles-core-2.0-r468346-SNAPSHOT.jar from the Shale nightly distribution JSTL 1.1.2 Tomcat 6.0.13 faces-config.xml: !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN http://java.sun.com/dtd/web-facesconfig_1_1.dtd; web.xml: web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; When I attempt to display the home page of the new project, I get a blank page. I have checked the tomcat logs and there are no complaints. The web page source from the page that is displayed consists only of: html lang=en /html Using Live HTTP Headers inside FireFox yielded nothing of interest as far as I can tell. Have I mixed incompatible components? If not does anyone have a suggestion short of debugging the JSF RI or tiles source on how I can track down what is happening? -= Gregg =- signature.asc Description: OpenPGP digital signature
Re: Any sucess with shale nightly 20070717 and RI JSF 1.2?
signature.asc Description: OpenPGP digital signature
Re: shale-tiger and jsf 1.2
There appear to be some problems with MyFaces 1.2.0 or Tomcat 6.0.13 and JSF tags. For example see: http://article.gmane.org/gmane.comp.jakarta.myfaces.user/38651 This does not address your specific problem, but I ran into the above referenced problem immediately. Notice that the problem was reported yesterday. -= Gregg =- Tomasz Pasierb wrote: Hi, shale-tiger doesn't seem to work with myfaces 1.2 which has recenlty been released. I have a bean annotated with @Bean and it doesn't seem to be picked up. The bean doesn't exists when I try to get/set some properties on it using EL. Everything is fine with the bean when it's declared in faces-config.xml. Additionally no messages are logged by tiger even on debug level apart from the one that states that 'original variableResolver was wrapped...' Does shale-tiger work with jsf 1.2? (I've quickly skimmed through the sources and it seems that only DTDs for jsf 1_0 and 1_1 are allowed (FacesConfigParser#REGISTRATIONS) if that's what it's used for. I've configured my webapp according to the jee5 tutorial where they use schema for 1.2. May this be the reason why shale-tiger doesn't register the annotated beans?) Regards, Tom Pasierb signature.asc Description: OpenPGP digital signature
SUCCESS - Re: Migration: Struts/Tiles to Shale/JSF/Tiles
I appear to have successfully resolved my two page to one page problem. I no longer need _any_ page, for instance the loadLayout.jsp page, that contains a tiles:insertDefinition tag. I can simply jump directly to any tiles definition name. This is how I had Struts/Tiles working before, so this seems to be the best way to use Tiles with Shale and JSF. I have posted a test webapp at: http://www.lansdaletutoring.com/test The home page at this location allows the user to jump to two different tiles and, from each of them, back to the home tile and to also download the test webapp war file. I changed the index.jsp file to: jsp:forward page=/mainLayoutPage.faces/ My tiles-def.xml file is: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN http://struts.apache.org/dtds/tiles-config_2_0.dtd; tiles-definitions definition name=/mainLayoutPage template=/tiles/layouts/siteLayout.jsp put name=htmlHeader type=template value=/tiles/htmlHeaderTile.jsp/ put name=header type=template value=/tiles/headerTile.jsp/ put name=content type=template value=/tiles/homeTile.jsp/ put name=rightSideBar type=template value=/tiles/rightSideBarTile.jsp/ put name=footer type=template value=/tiles/footerTile.jsp/ /definition definition name=/contactUsPage extends=/mainLayoutPage put name=content type=template value=/tiles/contactUsTile.jsp/ /definition definition name=/aboutUsPage extends=/mainLayoutPage put name=content type=template value=/tiles/aboutTile.jsp/ /definition /tiles-definitions The homeTile.jsp file is: %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://myfaces.apache.org/tomahawk; prefix=t % h:outputText value= h4 align='center'An OutputText Method to do a Content Tile!/h4 div p A paragraph of content. p A second paragraph of content. /divbr escape=false/ h:outputText value=Some JSF output text./ f:verbatim h4 align='center'A Verbatim Method to do The Same Content Tile!/h4 div p Another paragraph of content. p Another second paragraph of content. /divbr /f:verbatim h:outputText value=Some more JSF output text./ h:outputText value=br escape=false/ h:outputLink value=/test/contactUsPage.faces h:outputText value=Contact Us/ /h:outputLink h:outputText value=br escape=false/ h:outputLink value=/test/aboutUsPage.faces h:outputText value=About Us/ /h:outputLink h:outputText value=br escape=false/ h:outputLink value=http://www.lansdaletutoring.com/test/files/test.war; h:outputText value=Download this Webapp's WAR File/ /h:outputLink As far as the org.apache.shale.tiles.TilesViewHandler goes, I don't seem to need to declare it in faces-config.xml or anywhere else. I suppose it is being automatically loaded when needed and doesn't need to be declared. If you want to see the exact error message that does occur when it is declared in faces-config.xml, just declare it in the exploded test.war and go to the home page. I believe that it will still fail as before when this is done. If not, let me know. -= Gregg =- Greg Reddin wrote: On 4/18/07, Gregg Leichtman wrote: I am also using the tiles listener from web.xml as follows: listener listener-class org.apache.tiles.listener.TilesListener /listener-class /listener instead of the Shale tiles view handler (if this makes a difference) in faces-config.xml: !-- application view-handler org.apache.shale.tiles.TilesViewHandler /view-handler /application -- which I could not get to work. [snip] The Shale/JSF/Tiles scheme that I currently have working seems really clunky. Is there some way that I can reduce the two pages down to one page under Shale/JSF/Tiles? If I understand the TilesViewHandler correctly it is supposed to work that way. Similar to how TilesRequestProcessor translated a forward definition into a Tiles invocation. I think TilesViewHandler is supposed to do something similar for Tiles 2 in a JSF environment. What sort of problems did you have with the ViewHandler? BTW, I'm planning to upgrade Shale-Tiles to the latest official Tiles release once we get another one out. HTH, Greg signature.asc Description: OpenPGP digital signature
Re: new to shale tiles
I finally got a tiled page to display after trying a multitude of server and jar versions as well as defining the correct tile contents with appropriate jsf tags and attributes and getting past an IllegalStateException caused by incorrectly having a view tag wrapping the contents of a tile that was being inserted. I learned the hard way that there can only be one---view tag pair per page---and that inserted tiles are, of course, part of a single page (obvious now, but trees vs. forest bit me). At this point however I have not succeeded in accomplishing what you describe below in your index.jsp page where you forward directly to an extended tile. I can't seem to get it to work. I have the following test setup: index.jsp: . !-- jsp:forward page=/contentPage.faces/ -- jsp:forward page=/tiles/layouts/loadLayout.faces/ . The commented out line above fails. The uncommented line above works. I also tried the commented out line both with and without the leading slash, although the TilesViewHandler javadoc states that the slash is not needed. /tiles/layouts/loadLayout.jsp: . %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % f:view tiles:insert name=/contentPage flush=false type=definition/ /f:view . /tiles/layouts/siteLayout.jsp: . %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % html lang=en tiles:insert name=htmlHeader flush=false/ body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 style=margin:0;padding:0 tiles:insert name=content flush=false/ h:outputText value=Enter something here: / h:inputText/ /body /html . /tiles/htmlHeaderTile.jsp: . %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % head base href=http://localhost:8080/tilestest3; titleh:outputText value=This is a title.//title meta name=keywords content=keyword1 keyword2 titleh:outputText value=Some title text.//title link rel=shortcut icon href=favicon.ico type=image/x-icon /head . /tiles/homeTile.jsp: . h1 align=centerContent Tile!/h1 div p A paragraph of content. p A second paragraph of content. p A third paragraph of content. /div . tiles-defs.xml: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN http://struts.apache.org/dtds/tiles-config_2_0.dtd; tiles-definitions !-- Display Definitions -- definition name=/mainLayout path=/tiles/layouts/siteLayout.jsp put name=htmlHeader value=/tiles/htmlHeaderTile.jsp/ /definition definition name=/contentPage extends=/mainLayout put name=content type=template value=/tiles/homeTile.jsp/ /definition /tiles-definitions . faces-config.xml: . ?xml version=1.0 encoding=UTF-8? !DOCTYPE faces-config PUBLIC -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN
Tiles Failure in GlassFish: org.apache.tiles.NoSuchDefinitionException
At Greg Reddins suggestion I have moved to GlassFish v2_b20 in an attempt to get past the need to use the verbatim tag around all non JSF tags within a tile. I have run into a problem that seems to be identical to the fixed problem described in SB-37: tiles:insert tag does not support correctly the name attribute. Here are what I believe are pertinent snippets from various pieces of my webapp. /tiles-defs.xml: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN http://struts.apache.org/dtds/tiles-config_2_0.dtd; tiles-definitions !-- Display Definitions -- definition name=/mainLayout path=/tiles/layouts/siteLayout.jsp put name=htmlHeader type=template value=/tiles/htmlHeaderTile.jsp/ put name=header type=template value=/tiles/headerTile.jsp/ put name=rightSideBar type=template value=/tiles/rightSideBarTile.jsp/ put name=footer type=template value=/tiles/footerTile.jsp/ /definition definition name=/welcomePage extends=/mainLayout put name=content type=template value=/tiles/homeTile.jsp/ /definition /tiles-definitions /web.xml: ... !-- Welcome File List -- welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list ... /index.jsp: jsp:forward page=/tiles/layouts/siteLayout.faces/ /tiles/layouts/siteLayout.jsp %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % html lang=en f:view head base href=http://localhost:8080/TilesBug/tiles/layouts/siteLayout.jsp; titleh:outputText value=This is a title.//title f:subview id=id1tiles:insert name=htmlHeader flush=false//f:subview /head body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 style=margin:0;padding:0 !-- Header and Menu -- h:outputText value=this is some text./ h:inputText/ /body /f:view /html /tiles/htmlHeaderTile.jsp %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % f:verbatimmeta name=keywords content=keyword1 keyword2 title/f:verbatimh:outputText value=Some title text./f:verbatim/title link rel=shortcut icon href=favicon.ico type=image/x-icon/f:verbatim I am using the following libs: commons-beanutils-1.7.0.jar commons-chain-1.1.jar commons-digester-1.7.jar commons-logging-1.1.jar javaee.jar jsf-impl.jar shale-core-1.0.4-SNAPSHOT.jar shale-spring-1.0.4-SNAPSHOT.jar shale-tiles-1.0.4-SNAPSHOT.jar spring-beans-1.2.8.jar spring-context-1.2.8.jar spring-core-1.2.8.jar spring-web-1.2.8.jar tiles-core-2.0-SNAPSHOT-20060922.jar The javaee and jsf-impl jars came directly from the latest j2ee 5 installation. I have successfully gotten the siteLayout.jsp page to render, if the tiles:insert tag is commented out, so I know that JSF is getting that far. I have also used the tiles-defs.xml and web.xml files in my previous Tomcat tests successfully albeit with the verbatim tags peppered all over the place. Does anyone see why I should receive the following exceptions: [#|2006-10-11T05:47:11.145-0400|SEVERE|sun-appserver-pe9.1|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=httpWorkerThread-8080-1;_RequestID=b9de8883-434e-4aac-b919-73480e7c1a4b;|ApplicationDispatcher[/tilestest3] PWC1231: Servlet.service() for servlet jsp threw exception org.apache.tiles.NoSuchDefinitionException at org.apache.tiles.taglib.InsertTag.processDefinitionName(InsertTag.java:486) at org.apache.tiles.taglib.InsertTag.processName(InsertTag.java:452) ... [#|2006-10-11T05:47:11.222-0400|WARNING|sun-appserver-pe9.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=12;_ThreadName=httpWorkerThread-8080-1;_RequestID=b9de8883-434e-4aac-b919-73480e7c1a4b;|executePhase(RENDER_RESPONSE 6,[EMAIL PROTECTED]) threw exception javax.faces.FacesException: javax.servlet.ServletException: Error - Tag Insert : Can't get definition 'null'. Check if this name exists in definitions factory. at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:418) at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:410) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:112) at org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:175) ... -= Gregg =- signature.asc Description: OpenPGP digital signature
Re: Tiles Failure in GlassFish: org.apache.tiles.NoSuchDefinitionException
I suppose that I could create a different definition like: definition name=/mainLayout path=/tiles/layouts/siteLayout.jsp put name=htmlHeader type=template value=/ put name=header type=template value=/tiles/headerTile.jsp/ put name=rightSideBar type=template value=/tiles/rightSideBarTile.jsp/ put name=footer type=template value=/tiles/footerTile.jsp/ /definition definition name=/htmlHeaderPage extends=/mainLayout put name=htmlHeader type=template value=/tiles/htmlHeaderTile.jsp/ /definition and then use tiles:insert name=/htmlHeaderPage / however, I have used the previous method for rendering the put described _within_ the definition successfully under Tomcat with shale-1.0.3. This is also described by Dick Starr at: http://www.nabble.com/Shale-1.0.3-and-Tiles-Question---Tag-Question-t2204571.html#a6288731 where he inserts the title and body puts successfully. Are both of use doing different things? If so, can you point out what I'm doing that is different or something that is now obsolete in shale-1.0.4? -= Gregg =- Antonio Petrelli wrote: Gregg Leichtman ha scritto: /index.jsp: jsp:forward page=/tiles/layouts/siteLayout.faces/ The problem is that you are trying to forward to a layout page, without filling its attributes. You have to forward to a page that contains: tiles:insert name=/welcomePage / (I guess this is what you need) where /welcomePage is the name of the definition. Ciao Antonio signature.asc Description: OpenPGP digital signature
Tiles failure: java.lang.IllegalStateException
Actually, Antonio's last message caused the light to go on and I saw that I was not causing the extended tile def to load and consequently the primary tile def it is derived from to load, so clearly I could not possibly expect the tiles code to find anything wrapped by either def. I have since rearranged things to fix this glaring error. At this point I am getting an illegal state exception within the siteLayout.jsp compiled code as follows: [#|2006-10-11T21:51:38.056-0400|INFO|sun-appserver-pe9.1|javax.enterprise.system.tools.deployment| _ThreadID=11;_ThreadName=Timer-4;|[AutoDeploy] Successfully autodeployed : /home/gsl/java/glassfish/glassfish_v2_b20/domains/domain1/autodeploy/tilestest3.war.|#] [#|2006-10-11T21:51:56.190-0400|WARNING|sun-appserver-pe9.1|javax.enterprise.resource.webcontainer.jsf.taglib| _ThreadID=12;_ThreadName=httpWorkerThread-8080-1;_RequestID=b9de8883-434e-4aac-b919-73480e7c1a4b;|Can't leverage base class java.lang.IllegalStateException at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:259) at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:219) at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:458) at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:639) at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1063) at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:180) at org.apache.jsp.tiles.layouts.siteLayout_jsp._jspx_meth_f_view_0(Unknown Source) at org.apache.jsp.tiles.layouts.siteLayout_jsp._jspService(Unknown Source) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111) ... There is also a stack trace as follows: [#|2006-10-11T22:04:25.762-0400|WARNING|sun-appserver-pe9.1|javax.enterprise.resource.webcontainer.jsf.lifecycl e|_ThreadID=13;_ThreadName=httpWorkerThread-8080-0;_RequestID=e36b4132-d384-4a19-a02d-0ca2563784ed;|executePhas e(RENDER_RESPONSE 6,[EMAIL PROTECTED]) threw exception javax.faces.FacesException: javax.servlet.ServletException: Exception in '/tiles/layouts/siteLayout.jsp': null at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:418) at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:410) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:112) at org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:175) ... Here is how I have changed things and there is now an intermediate page---loadLayout.jsp---to cause the extended tile def---/contentPage---and consequently the tile it is derived from---/mainLayout---to be loaded. /index.jsp (the web.xml welcome file): jsp:forward page=/tiles/layouts/loadLayout.faces/ /tiles-defs.xml: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN http://struts.apache.org/dtds/tiles-config_2_0.dtd; tiles-definitions !-- Display Definitions -- definition name=/mainLayout path=/tiles/layouts/siteLayout.jsp put name=htmlHeader type=template value=/tiles/htmlHeaderTile.jsp/ /definition definition name=/contentPage extends=/mainLayout put name=content type=template value=/tiles/homeTile.jsp/ /definition /tiles-definitions /tiles/layouts/loadLayout.jsp: %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % html lang=en f:view !-- f:subview id=id1 --tiles:insert name=/contentPage flush=false type=definition/!-- /f:subview -- /f:view /html /tiles/htmlHeaderTile.jsp: %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % meta name=keywords content=keyword1 keyword2 titleh:outputText value=Some title text.//title link rel=shortcut icon href=favicon.ico type=image/x-icon /tiles/homeTile.jsp: %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % h1 align=centerContent Tile!/h1 div p A paragraph of content. p A second paragraph of content. p A third paragraph of content. /div /tiles/layouts/siteLayout.jsp: %@ taglib uri=http://java.sun.com/jsf/core; prefix=f % %@ taglib uri=http://java.sun.com/jsf/html; prefix=h % %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % html lang=en f:view head base href=http://localhost:8080/tilestest3; titleh:outputText value=This is a title.//title !-- f:subview id=id1 --tiles:insert name=htmlHeader flush=false/!-- /f:subview -- /head