You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joel Wickard <jw...@litriusgroup.com> on 2003/03/26 17:31:48 UTC
[Tiles-Definitions] can't find bean in request.
Here's the first few lines of the root cause of the exception I'm getting:
root cause
javax.servlet.ServletException: Error - Tag Insert : No value defined for bean 'admin' with property 'null' in scope 'request'.
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:494)
at org.apache.jsp.employeeLanding_jsp._jspService(employeeLanding_jsp.java:59)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
Here's my web.xml entries:
<taglib>
<taglib-uri>/WEB-INF/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
Here's my struts-config entries:
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-debug" value="2" />
</plug-in>
Here's my tiles-defs.xml entries:
<tiles-definitions>
<definition name="admin" path="/admin/templates/backendMain.jsp">
<put name="page-title" value="QuatraData :: Default" />
<put name="logo-content" value="/logoDefault.jsp" />
<put name="menu-layout" value="/menuBar.jsp" />
</definition>
</tiles-definitions>
Here's the page I'm trying to use the template in:
<%@page contentType="text/html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert beanName="admin" beanScope="request"/>
( what I'm trying to do is just have a page that uses all the defaults specified in tiles-defs, that's why I have no put tags )
Here's the template itself:
<%@page contentType="text/html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<html>
<head>
<title><tiles:getAsString name="page-title" /></title>
<script language="Javascript">
function launchTimeClock(){
window.open( "./timeclock/timeClock.jsp", "puchClock", "resizeable=no, height=170, width=230");
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#CCCCCC" onLoad="launchTimeClock();">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="300">
<!-- Logo Content -->
<tiles:insert name="logo-content" />
</td>
<td valign="top">
<tiles:insert name="menu-layout" />
</td>
</tr>
</table>
</body>
</html>
Here's the pages that should be inserted:
logoDefault.jsp:
I am a logo
menuBar.jsp:
My Menu Bar
If I don't use definition, if I just use a template and then manually use tiles:put, it works fine.
Any help would be great, I can supply any other requested information.
Re: [Tiles-Definitions] can't find bean in request.
Posted by Joel Wickard <jw...@litriusgroup.com>.
Cedric Dumoulin wrote:
>
> So you have an error in your config or in your definition declaration.
> Please, check the examples in the tiles-documentation.war. You can
> also check one of the following articles:
>
> * http://blogs.browsermedia.com/patrick/index.do?date=20030210#120914
> *
> http://www.onjava.com/pub/a/onjava/excerpt/progjakstruts_14/index1.html
> * http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
> * http://www-106.ibm.com/developerworks/java/library/j-strutstiles.html
> * and many other ...
>
> Cedric
>
>
Well I didn't end up altering the definitions file, I found out from
somone else that if I used
<tiles:insert definition="admin" flush="true" />
then it works perfectly, thanks for all your help though
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: [Tiles-Definitions] can't find bean in request.
Posted by Cedric Dumoulin <ce...@apache.org>.
Joel Wickard wrote:
>
>
> Cedric Dumoulin wrote:
>
>>
>> Hi,
>>
>> The definition from the tiles file are stored in the factory.
>> You should use the following to insert a definition:
>> <tiles:insert name="admin" />
>
>
> the above method of trying to insert the predefined defs results in
> the following exception when I try to view the page.
So you have an error in your config or in your definition declaration.
Please, check the examples in the tiles-documentation.war. You can
also check one of the following articles:
* http://blogs.browsermedia.com/patrick/index.do?date=20030210#120914
*
http://www.onjava.com/pub/a/onjava/excerpt/progjakstruts_14/index1.html
* http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
* http://www-106.ibm.com/developerworks/java/library/j-strutstiles.html
* and many other ...
Cedric
>
>
> java.lang.NullPointerException
> at
> org.apache.struts.taglib.tiles.InsertTag.processName(InsertTag.java:527)
> at
> org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:486)
> at
> org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:444)
> at
> org.apache.jsp.employeeLanding_jsp._jspx_meth_tiles_insert_0(employeeLanding_jsp.java:75)
> at
> org.apache.jsp.employeeLanding_jsp._jspService(employeeLanding_jsp.java:54)
>
>
>
>>
>> Check the tag syntax :-)
>>
>> Cedric
>>
>>
>> Joel Wickard wrote:
>>
>>> Here's the first few lines of the root cause of the exception I'm
>>> getting:
>>>
>>> root cause
>>>
>>> javax.servlet.ServletException: Error - Tag Insert : No value
>>> defined for bean 'admin' with property 'null' in scope 'request'.
>>> at
>>> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:494)
>>>
>>> at
>>> org.apache.jsp.employeeLanding_jsp._jspService(employeeLanding_jsp.java:59)
>>>
>>> at
>>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>>
>>>
>>> Here's my web.xml entries:
>>>
>>> <taglib>
>>> <taglib-uri>/WEB-INF/struts-tiles</taglib-uri>
>>> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
>>> </taglib>
>>>
>>> Here's my struts-config entries:
>>>
>>>
>>> <plug-in className="org.apache.struts.tiles.TilesPlugin" >
>>> <set-property property="definitions-config"
>>> value="/WEB-INF/tiles-defs.xml" />
>>> <set-property property="definitions-debug" value="2" />
>>> </plug-in>
>>>
>>>
>>> Here's my tiles-defs.xml entries:
>>>
>>> <tiles-definitions>
>>> <definition name="admin"
>>> path="/admin/templates/backendMain.jsp"> <put
>>> name="page-title" value="QuatraData :: Default" />
>>> <put name="logo-content" value="/logoDefault.jsp" />
>>> <put name="menu-layout" value="/menuBar.jsp" />
>>> </definition>
>>> </tiles-definitions>
>>>
>>>
>>>
>>>
>>> Here's the page I'm trying to use the template in:
>>>
>>> <%@page contentType="text/html"%>
>>> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>>>
>>> <tiles:insert beanName="admin" beanScope="request"/>
>>>
>>> ( what I'm trying to do is just have a page that uses all the
>>> defaults specified in tiles-defs, that's why I have no put tags )
>>>
>>>
>>> Here's the template itself:
>>>
>>> <%@page contentType="text/html"%>
>>> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>>> <html>
>>> <head>
>>> <title><tiles:getAsString name="page-title" /></title>
>>> <script language="Javascript">
>>> function launchTimeClock(){
>>> window.open( "./timeclock/timeClock.jsp",
>>> "puchClock", "resizeable=no, height=170, width=230");
>>> }
>>>
>>> </script>
>>> </head>
>>>
>>> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
>>> bgcolor="#CCCCCC" onLoad="launchTimeClock();">
>>> <table cellspacing="0" cellpadding="0" border="0">
>>> <tr>
>>> <td width="300">
>>> <!-- Logo Content -->
>>> <tiles:insert name="logo-content" />
>>> </td>
>>> <td valign="top">
>>> <tiles:insert name="menu-layout" />
>>> </td> </tr>
>>> </table>
>>> </body>
>>> </html>
>>>
>>>
>>>
>>> Here's the pages that should be inserted:
>>>
>>> logoDefault.jsp:
>>>
>>> I am a logo
>>>
>>> menuBar.jsp:
>>>
>>> My Menu Bar
>>>
>>>
>>>
>>>
>>> If I don't use definition, if I just use a template and then
>>> manually use tiles:put, it works fine.
>>>
>>> Any help would be great, I can supply any other requested information.
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: [Tiles-Definitions] can't find bean in request.
Posted by Joel Wickard <jw...@litriusgroup.com>.
Cedric Dumoulin wrote:
>
> Hi,
>
> The definition from the tiles file are stored in the factory.
> You should use the following to insert a definition:
> <tiles:insert name="admin" />
the above method of trying to insert the predefined defs results in the
following exception when I try to view the page.
java.lang.NullPointerException
at org.apache.struts.taglib.tiles.InsertTag.processName(InsertTag.java:527)
at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:486)
at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:444)
at org.apache.jsp.employeeLanding_jsp._jspx_meth_tiles_insert_0(employeeLanding_jsp.java:75)
at org.apache.jsp.employeeLanding_jsp._jspService(employeeLanding_jsp.java:54)
>
> Check the tag syntax :-)
>
> Cedric
>
>
> Joel Wickard wrote:
>
>> Here's the first few lines of the root cause of the exception I'm
>> getting:
>>
>> root cause
>>
>> javax.servlet.ServletException: Error - Tag Insert : No value defined
>> for bean 'admin' with property 'null' in scope 'request'.
>> at
>> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:494)
>>
>> at
>> org.apache.jsp.employeeLanding_jsp._jspService(employeeLanding_jsp.java:59)
>>
>> at
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>
>>
>> Here's my web.xml entries:
>>
>> <taglib>
>> <taglib-uri>/WEB-INF/struts-tiles</taglib-uri>
>> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
>> </taglib>
>>
>> Here's my struts-config entries:
>>
>>
>> <plug-in className="org.apache.struts.tiles.TilesPlugin" >
>> <set-property property="definitions-config"
>> value="/WEB-INF/tiles-defs.xml" />
>> <set-property property="definitions-debug" value="2" />
>> </plug-in>
>>
>>
>> Here's my tiles-defs.xml entries:
>>
>> <tiles-definitions>
>> <definition name="admin"
>> path="/admin/templates/backendMain.jsp"> <put
>> name="page-title" value="QuatraData :: Default" />
>> <put name="logo-content" value="/logoDefault.jsp" />
>> <put name="menu-layout" value="/menuBar.jsp" /> </definition>
>> </tiles-definitions>
>>
>>
>>
>>
>> Here's the page I'm trying to use the template in:
>>
>> <%@page contentType="text/html"%>
>> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>>
>> <tiles:insert beanName="admin" beanScope="request"/>
>>
>> ( what I'm trying to do is just have a page that uses all the
>> defaults specified in tiles-defs, that's why I have no put tags )
>>
>>
>> Here's the template itself:
>>
>> <%@page contentType="text/html"%>
>> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>> <html>
>> <head>
>> <title><tiles:getAsString name="page-title" /></title>
>> <script language="Javascript">
>> function launchTimeClock(){
>> window.open( "./timeclock/timeClock.jsp", "puchClock",
>> "resizeable=no, height=170, width=230");
>> }
>>
>> </script>
>> </head>
>>
>> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
>> bgcolor="#CCCCCC" onLoad="launchTimeClock();">
>> <table cellspacing="0" cellpadding="0" border="0">
>> <tr>
>> <td width="300">
>> <!-- Logo Content -->
>> <tiles:insert name="logo-content" />
>> </td>
>> <td valign="top">
>> <tiles:insert name="menu-layout" />
>> </td> </tr>
>> </table>
>> </body>
>> </html>
>>
>>
>>
>> Here's the pages that should be inserted:
>>
>> logoDefault.jsp:
>>
>> I am a logo
>>
>> menuBar.jsp:
>>
>> My Menu Bar
>>
>>
>>
>>
>> If I don't use definition, if I just use a template and then manually
>> use tiles:put, it works fine.
>>
>> Any help would be great, I can supply any other requested information.
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: [Tiles-Definitions] can't find bean in request.
Posted by Cedric Dumoulin <ce...@apache.org>.
Hi,
The definition from the tiles file are stored in the factory.
You should use the following to insert a definition:
<tiles:insert name="admin" />
Check the tag syntax :-)
Cedric
Joel Wickard wrote:
> Here's the first few lines of the root cause of the exception I'm
> getting:
>
> root cause
>
> javax.servlet.ServletException: Error - Tag Insert : No value defined
> for bean 'admin' with property 'null' in scope 'request'.
> at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:494)
> at
> org.apache.jsp.employeeLanding_jsp._jspService(employeeLanding_jsp.java:59)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>
> Here's my web.xml entries:
>
> <taglib>
> <taglib-uri>/WEB-INF/struts-tiles</taglib-uri>
> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
> </taglib>
>
> Here's my struts-config entries:
>
>
> <plug-in className="org.apache.struts.tiles.TilesPlugin" >
> <set-property property="definitions-config"
> value="/WEB-INF/tiles-defs.xml" />
> <set-property property="definitions-debug" value="2" />
> </plug-in>
>
>
> Here's my tiles-defs.xml entries:
>
> <tiles-definitions>
> <definition name="admin"
> path="/admin/templates/backendMain.jsp"> <put
> name="page-title" value="QuatraData :: Default" />
> <put name="logo-content" value="/logoDefault.jsp" />
> <put name="menu-layout" value="/menuBar.jsp" /> </definition>
> </tiles-definitions>
>
>
>
>
> Here's the page I'm trying to use the template in:
>
> <%@page contentType="text/html"%>
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>
> <tiles:insert beanName="admin" beanScope="request"/>
>
> ( what I'm trying to do is just have a page that uses all the defaults
> specified in tiles-defs, that's why I have no put tags )
>
>
> Here's the template itself:
>
> <%@page contentType="text/html"%>
> <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
> <html>
> <head>
> <title><tiles:getAsString name="page-title" /></title>
> <script language="Javascript">
> function launchTimeClock(){
> window.open( "./timeclock/timeClock.jsp", "puchClock",
> "resizeable=no, height=170, width=230");
> }
>
> </script>
> </head>
>
> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
> bgcolor="#CCCCCC" onLoad="launchTimeClock();">
>
> <table cellspacing="0" cellpadding="0" border="0">
> <tr>
> <td width="300">
> <!-- Logo Content -->
> <tiles:insert name="logo-content" />
> </td>
> <td valign="top">
> <tiles:insert name="menu-layout" />
> </td> </tr>
> </table>
> </body>
> </html>
>
>
>
> Here's the pages that should be inserted:
>
> logoDefault.jsp:
>
> I am a logo
>
> menuBar.jsp:
>
> My Menu Bar
>
>
>
>
> If I don't use definition, if I just use a template and then manually
> use tiles:put, it works fine.
>
> Any help would be great, I can supply any other requested information.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org