RE: Tiles scope problem
Richard Thanks for you reply. I don't set it to true as you can see below. This is part of my struts-config.xml action path=/providers/Eligibility type=org.bcbsri.thinui.struts.actions.EligibilityAction name=EligibilityForm scope=request input=/providers/eligibility/eligibilityLookup.jsp exception key=error.bcbsri.member.notfound type= org.bcbsri.common.exception.MemberNotFoundException path=/providers/eligibility/eligibilityLookup.jsp / exception key= error.bcbsri.provider.memberlookup.nocoveragefound type= org.bcbsri.common.exception.NoCoverageFoundException path=/providers/eligibility/eligibilityLookup.jsp / exception key=error.bcbsri.date.invalid type= org.bcbsri.common.exception.InvalidDateFormatException path=/providers/eligibility/eligibilityLookup.jsp / forward name=lookup path= /providers/eligibility/eligibilityLookup.jsp/ forward name=display path=bcbsri.layout/ If you look at the last line, thats where I call my bcbsri.layout tile. Richard Hightower To: Struts Users Mailing List [EMAIL PROTECTED] [EMAIL PROTECTED] ind.com cc: Subject: RE: Tiles scope problem 01/14/2004 11:05 PM Please respond to Struts Users Mailing List Check your action forward and make sure you don't have redirect=true. Rick Hightower Developer Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm Struts/J2EE consulting -- http://www.arc-mind.com/consulting.htm#StrutsMentoring -Original Message- From: Yogi_Shridhare/[EMAIL PROTECTED] [mailto:Yogi_Shridhare/[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 1:58 PM To: [EMAIL PROTECTED] Subject: Tiles scope problem Hi group I have a quick question for you. I really appreciate your time on this. We are trying to migrate our existing static JSP project to using Tiles. The question is this. I have a Struts action class calling a forward to one of the JSPs. This JSP does the Tiles insert for the body attribute. The body jsp iterates through the collection and tries to retrieve the properties of the collection. When I do this with Session scope, it works fine but with request scope it fails. Is there any way to make this work with request scope? Thanks. Following is the simple set up. file bcbsriLayout.jsp %@ page language=java % ... tiles:insert attribute=header / tiles:insert attribute=topnav/ tiles:insert attribute=leftnav/ ... tiles:insert attribute=body/ tiles:insert attribute=bottomnav/ File: eligibility.jsp (This jsp gets called from Struts action) %@ page language=java% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % session.setAttribute(navCode,GN2.02.01); % tiles:insert definition=bcbsri.layout tiles.put name=titleKey value=title / tiles:put name=body value=/eligibility.jsp / // the main JSP calling the logic:iterate /tiles:insert ../eligibility.jsp logic:iterate scope=request name=members id=member html:text size=30 readonly=true style=border:1 name=member property=formattedFullNameByFirst/ ... Access member properties // *Error member not defined /logic:iterate File:testTile.xml !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; !--%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %-- tiles-definitions definition name=bcbsri.layout page=/bcbsriLayout.jsp put name=titleKey type=string / put name=header value=/HeaderIncDyn.jsp / put name=topnav value=/TopNavIncDyn.jsp / put name=leftnav value=/LeftNavIncDyn.jsp / put name=body type=page / put name=bottomnav value
Tiles scope problem
Hi group I have a quick question for you. I really appreciate your time on this. We are trying to migrate our existing static JSP project to using Tiles. The question is this. I have a Struts action class calling a forward to one of the JSPs. This JSP does the Tiles insert for the body attribute. The body jsp iterates through the collection and tries to retrieve the properties of the collection. When I do this with Session scope, it works fine but with request scope it fails. Is there any way to make this work with request scope? Thanks. Following is the simple set up. file bcbsriLayout.jsp %@ page language=java % ... tiles:insert attribute=header / tiles:insert attribute=topnav/ tiles:insert attribute=leftnav/ ... tiles:insert attribute=body/ tiles:insert attribute=bottomnav/ File: eligibility.jsp (This jsp gets called from Struts action) %@ page language=java% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % session.setAttribute(navCode,GN2.02.01); % tiles:insert definition=bcbsri.layout tiles.put name=titleKey value=title / tiles:put name=body value=/eligibility.jsp / // the main JSP calling the logic:iterate /tiles:insert ../eligibility.jsp logic:iterate scope=request name=members id=member html:text size=30 readonly=true style=border:1 name=member property=formattedFullNameByFirst/ ... Access member properties // *Error member not defined /logic:iterate File:testTile.xml !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; !--%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %-- tiles-definitions definition name=bcbsri.layout page=/bcbsriLayout.jsp put name=titleKey type=string / put name=header value=/HeaderIncDyn.jsp / put name=topnav value=/TopNavIncDyn.jsp / put name=leftnav value=/LeftNavIncDyn.jsp / put name=body type=page / put name=bottomnav value=BottomNavIncDyn.jsp / /definition definition name=basic.tiles page=/definitions.jsp put name=title value=Basic title/ put name=header value=test1 / put name=footer value=test2 / put name=menu value=test33 / put name=body value=test4 / /definition /tiles-definitions The members collection gets populated by an Action class. If I change the above scope to session and change my action class accordingly, this works. But I would like to get it working with scope as request. can you suggest a solution? Thanks a lot. Yogi We are running into a following problem. ** MAILSWEEPER This e-mail and any files transmitted with are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the information contained in this e-mail is prohibited. If you have received this e-mail in error, please immediately notify your e-mail administrator. Blue Cross Blue Shield of Rhode Island in state: 401.751.1673 out of state: 1.800.343.5743 ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles scope problem
Check your action forward and make sure you don't have redirect=true. Rick Hightower Developer Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm Struts/J2EE consulting -- http://www.arc-mind.com/consulting.htm#StrutsMentoring -Original Message- From: Yogi_Shridhare/[EMAIL PROTECTED] [mailto:Yogi_Shridhare/[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 1:58 PM To: [EMAIL PROTECTED] Subject: Tiles scope problem Hi group I have a quick question for you. I really appreciate your time on this. We are trying to migrate our existing static JSP project to using Tiles. The question is this. I have a Struts action class calling a forward to one of the JSPs. This JSP does the Tiles insert for the body attribute. The body jsp iterates through the collection and tries to retrieve the properties of the collection. When I do this with Session scope, it works fine but with request scope it fails. Is there any way to make this work with request scope? Thanks. Following is the simple set up. file bcbsriLayout.jsp %@ page language=java % ... tiles:insert attribute=header / tiles:insert attribute=topnav/ tiles:insert attribute=leftnav/ ... tiles:insert attribute=body/ tiles:insert attribute=bottomnav/ File: eligibility.jsp (This jsp gets called from Struts action) %@ page language=java% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % % session.setAttribute(navCode,GN2.02.01); % tiles:insert definition=bcbsri.layout tiles.put name=titleKey value=title / tiles:put name=body value=/eligibility.jsp / // the main JSP calling the logic:iterate /tiles:insert ../eligibility.jsp logic:iterate scope=request name=members id=member html:text size=30 readonly=true style=border:1 name=member property=formattedFullNameByFirst/ ... Access member properties // *Error member not defined /logic:iterate File:testTile.xml !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; !--%@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %-- tiles-definitions definition name=bcbsri.layout page=/bcbsriLayout.jsp put name=titleKey type=string / put name=header value=/HeaderIncDyn.jsp / put name=topnav value=/TopNavIncDyn.jsp / put name=leftnav value=/LeftNavIncDyn.jsp / put name=body type=page / put name=bottomnav value=BottomNavIncDyn.jsp / /definition definition name=basic.tiles page=/definitions.jsp put name=title value=Basic title/ put name=header value=test1 / put name=footer value=test2 / put name=menu value=test33 / put name=body value=test4 / /definition /tiles-definitions The members collection gets populated by an Action class. If I change the above scope to session and change my action class accordingly, this works. But I would like to get it working with scope as request. can you suggest a solution? Thanks a lot. Yogi We are running into a following problem. ** MAILSWEEPER This e-mail and any files transmitted with are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the information contained in this e-mail is prohibited. If you have received this e-mail in error, please immediately notify your e-mail administrator. Blue Cross Blue Shield of Rhode Island in state: 401.751.1673 out of state: 1.800.343.5743 ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles scope
Hi, The Cannot find bean org.apache.struts.taglib.html.BEAN in any scope' error is usually caused by a struts tag which doesn't find its needed bean. For example it can be caused by a html:form ... tag. Do you have such tag in c_search_form.jsp ? I suppose the answer is yes. The beans needed by struts tags are set in appropriate context by the struts RequestProcessor, which is called automatically when you hit an struts action address (*.do). To be short, to use a struts html tag, you need to go throw a struts action. So, if your c_search_form.jsp page have such tag, you need to access it throw an associated struts action which then forward to the jsp. Then, you specify the action URL in the tiles definition instead of the jsp url. Cedric Juri Smarschevski wrote: hi all, have a problem with tile's scopes. (struts-1.1-b2) my simple tiles structure looks as follows: [tiles-defs.xml] definition name=mainLayout path=/WEB-INF/tiles/layout_main.jsp put name=title value=Sample Page Title type=string / put name=headervalue=/WEB-INF/tiles/header.jsp / put name=js_header value= / put name=menu value=/WEB-INF/tiles/menu.jsp / put name=body value=/WEB-INF/tiles/body.jsp / put name=footervalue=/WEB-INF/tiles/footer.jsp / /definition definition name=searchAlb extends=mainLayout put name=body value=searchAlb.body / /definition definition name=searchAlb.body path=/WEB-INF/tiles/layout_search_alb_body.jsp put name=search_form value=/WEB-INF/contents/c_search_form.jsp / !-- etc. -- /definition [layout_search_alb_body.jsp] %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:get name=search_form/ [c_search_form.jsp] %@ taglib uri=/tags/struts-tiles prefix=tiles % %@ taglib uri=/tags/struts-html prefix=html % centerhi from search form/center the called jsp-page is [alb_search.jsp] %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:insert definition=searchAlb flush=true/ and the c_search_form.jsp throws the exception [ServletException in:/WEB-INF/contents/c_search_form.jsp] Cannot find bean org.apache.struts.taglib.html.BEAN in any scope' cause by the line %@ taglib uri=/tags/struts-html prefix=html % Any ideas why ? Have I (can I) to define a scope in the tiles definitions ? The http://jakarta.apache.org/struts/userGuide/struts-tiles.htm did not help me at this point. Any RTFM-links are welcome ;-) thx in advance and regards, juri -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tiles scope
hi all, have a problem with tile's scopes. (struts-1.1-b2) my simple tiles structure looks as follows: [tiles-defs.xml] definition name=mainLayout path=/WEB-INF/tiles/layout_main.jsp put name=title value=Sample Page Title type=string / put name=headervalue=/WEB-INF/tiles/header.jsp / put name=js_header value= / put name=menu value=/WEB-INF/tiles/menu.jsp / put name=body value=/WEB-INF/tiles/body.jsp / put name=footervalue=/WEB-INF/tiles/footer.jsp / /definition definition name=searchAlb extends=mainLayout put name=body value=searchAlb.body / /definition definition name=searchAlb.body path=/WEB-INF/tiles/layout_search_alb_body.jsp put name=search_form value=/WEB-INF/contents/c_search_form.jsp / !-- etc. -- /definition [layout_search_alb_body.jsp] %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:get name=search_form/ [c_search_form.jsp] %@ taglib uri=/tags/struts-tiles prefix=tiles % %@ taglib uri=/tags/struts-html prefix=html % centerhi from search form/center the called jsp-page is [alb_search.jsp] %@ taglib uri=/tags/struts-tiles prefix=tiles % tiles:insert definition=searchAlb flush=true/ and the c_search_form.jsp throws the exception [ServletException in:/WEB-INF/contents/c_search_form.jsp] Cannot find bean org.apache.struts.taglib.html.BEAN in any scope' cause by the line %@ taglib uri=/tags/struts-html prefix=html % Any ideas why ? Have I (can I) to define a scope in the tiles definitions ? The http://jakarta.apache.org/struts/userGuide/struts-tiles.htm did not help me at this point. Any RTFM-links are welcome ;-) thx in advance and regards, juri -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles scope issue with 'tile' scope
Thanks for the report, I will correct this problem asap. Cedric Wellie W. Chao wrote: Hi Cedric, Replacing the beanScope=tile by beanScope=template seems to work. It seems the documentation is inconsistent -- there are references to using beanScope=tile. Thanks for the tip. Wellie On Thu, 20 Jun 2002, Cedric Dumoulin wrote: Date: Thu, 20 Jun 2002 16:51:50 +0200 From: Cedric Dumoulin [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Tiles scope issue with 'tile' scope Hello, The error occur during an insert, so it can be sent by the inserted jsp page. The tile scope can only be used in tiles tags. Check if you don't use it with other kind of tags. Also, you can try to replace tile by a synonym template or component. Hope this help, Cedric Wellie W. Chao wrote: I recently upgraded to JBoss 3.0 final w/ Tomcat 4.0.3 and am now running into a problem with Tiles not recognizing the 'tile' scope. Here is a snippet from a JSP file: tiles:insert attribute=topNav tiles:put name=titleString beanName=titleString beanScope=tile/ tiles:put name=menuTile beanName=menuTile beanScope=tile/ tiles:put name=menuDefinition beanName=menuDefinition beanScope=tile/ tiles:put name=selectedMenuItem beanName=selectedMenuItem beanScope=tile/ tiles:put name=submenuTile beanName=submenuTile beanScope=tile/ tiles:put name=submenuDefinition beanName=submenuDefinition beanScope=tile/ /tiles:insert Here's the error I get: 13:37:29,049 ERROR [Engine] ApplicationDispatcher[/pressroom] Servlet.service() for servlet jsp threw exception javax.servlet.ServletException: Error - scope translation tag : unrecognized scope 'tile' at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:471) at org.apache.jsp.topNav$jsp._jspService(topNav$jsp.java:227) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat cher.java:497) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja va:820) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:3 91) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:757) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:369) at org.apache.jsp.rootLayout$jsp._jspService(rootLayout$jsp.java:392) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:431) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:355) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProc essor.java:181) Other than upgrading the JBoss 3.0 final, the only other change I made was to start using xdoclet to generate EJB deployment descriptors and boilerplate EJB classes. I didn't use it for the web deployment descriptors or web files though. Anyone ever experience this problem or have a recommendation on how to solve the problem? I want to place the attributes in the tile scope so that the inserted tile has access to the information. If there's another way to do this (while avoiding namespace clashes with other inserted tiles), I'd be open
Re: Tiles scope issue with 'tile' scope
Hi Cedric, Replacing the beanScope=tile by beanScope=template seems to work. It seems the documentation is inconsistent -- there are references to using beanScope=tile. Thanks for the tip. Wellie On Thu, 20 Jun 2002, Cedric Dumoulin wrote: Date: Thu, 20 Jun 2002 16:51:50 +0200 From: Cedric Dumoulin [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Tiles scope issue with 'tile' scope Hello, The error occur during an insert, so it can be sent by the inserted jsp page. The tile scope can only be used in tiles tags. Check if you don't use it with other kind of tags. Also, you can try to replace tile by a synonym template or component. Hope this help, Cedric Wellie W. Chao wrote: I recently upgraded to JBoss 3.0 final w/ Tomcat 4.0.3 and am now running into a problem with Tiles not recognizing the 'tile' scope. Here is a snippet from a JSP file: tiles:insert attribute=topNav tiles:put name=titleString beanName=titleString beanScope=tile/ tiles:put name=menuTile beanName=menuTile beanScope=tile/ tiles:put name=menuDefinition beanName=menuDefinition beanScope=tile/ tiles:put name=selectedMenuItem beanName=selectedMenuItem beanScope=tile/ tiles:put name=submenuTile beanName=submenuTile beanScope=tile/ tiles:put name=submenuDefinition beanName=submenuDefinition beanScope=tile/ /tiles:insert Here's the error I get: 13:37:29,049 ERROR [Engine] ApplicationDispatcher[/pressroom] Servlet.service() for servlet jsp threw exception javax.servlet.ServletException: Error - scope translation tag : unrecognized scope 'tile' at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:471) at org.apache.jsp.topNav$jsp._jspService(topNav$jsp.java:227) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat cher.java:497) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja va:820) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:3 91) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:757) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:369) at org.apache.jsp.rootLayout$jsp._jspService(rootLayout$jsp.java:392) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:431) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:355) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProc essor.java:181) Other than upgrading the JBoss 3.0 final, the only other change I made was to start using xdoclet to generate EJB deployment descriptors and boilerplate EJB classes. I didn't use it for the web deployment descriptors or web files though. Anyone ever experience this problem or have a recommendation on how to solve the problem? I want to place the attributes in the tile scope so that the inserted tile has access to the information. If there's another way to do this (while avoiding namespace clashes with other inserted tiles), I'd be open to that as well. Wellie -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional