[
http://issues.apache.org/jira/browse/BEEHIVE-568?page=comments#action_63947 ]
Carlin Rogers commented on BEEHIVE-568:
---------------------------------------
The actionForm is null when evaluating the expression
"{actionForm.something2}" in tips.jsp, because it is a
different page context in tips.jsp. Tiles does an include.
It's similar to using a jsp:include, which you also have
in your example, pointing to navigate.jsp. If navigate.jsp
happened to contain the same textBox as tips.jsp, you would
see the same error.
The JSP being included has a different page context.
The actionForm is not available on this other page
context for tips.jsp. Just in the layout.jsp page.
I will attach a simple example that just uses a jsp:include
to demonstrate the error, without tiles.
I'm not sure from the example why you need the reuse of
a single textBox with one of the fields from the form
bean. The tiles definition is not really a layout template,
but just an include. In a case like this you could just use
<[EMAIL PROTECTED] file="/nae/nae011/tips.jsp"%>
Maybe another way to do this is to use a JSP 2.0 tagfiles.
Actually, I'm surprised that the error encountered wasn't a
"javax.servlet.jsp.JspException: Can't insert page '/nae/nae011/tips.jsp' :
Illegal to flush within a custom tag."
Maybe the closing </netui:form> tag was not in the same
location. But from the example you have, the <netui:form> tag
with a <tiles:insert> tag nested within, will hit a
specific tiles bug...
http://issues.apache.org/bugzilla/show_bug.cgi?id=21972
> Accesing actionForm in TILES
> ----------------------------
>
> Key: BEEHIVE-568
> URL: http://issues.apache.org/jira/browse/BEEHIVE-568
> Project: Beehive
> Type: Test
> Components: NetUI
> Versions: V1Beta
> Environment: Windows XP, Tomcat 5.0.28, JDK 1.5
> Reporter: V.Gnanasegaran
> Assignee: Carlin Rogers
>
> Pleace look into the sample code.
> Page A (some.jsp)
> <tiles:insert flush="true" page="/resources/jsp/mal/layout.jsp">
> <tiles:put name="sometips" value="/nae/nae011/tips.jsp"/>
> </tiles:insert>
> Layout page B (layout.jsp)
> <%@ page language="java" contentType="text/html;charset=UTF-8"%>
> <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
> <%@ taglib uri="bjeff.tld" prefix="bjeff"%>
> <html>
> <body>
>
> <netui:form action="goForward" tagId="htmlForm">
>
> <table cellspacing = "0" cellpadding = "0" border = "0">
> <tr>
> <td class = "layoutLeft" rowspan = "1">
> <jsp:include page="navigator.jsp" />
> </td>
>
> <td class="layoutContent content">
> <tiles:insert attribute="sometips" />
> </td>
> <td class = "layoutRight" rowspan = "2">
> <netui:content value = "${actionForm.something1}"/>
> </td>
> </netui:form>
> </body>
> </html>
> Inserted page C (tips.jsp)
> <%-- netui:form action is NOT defined here --%>
> <netui:textbox dataSource="actionForm.something2"/>
> As you see in the code sample when I run the code I have got two problems.
> 1) Occures an exception "Caught exception when evaluating expression
> "{actionForm.something2}" .Can not evaluate
> the identifier "something2" on a null value object". This means when
> the page C is executed the actionForm
> is null. If I define a netui:form then it desplays. As this page is
> inserted in the layout page actionForm
> must be available to page C.
> 2) When the form is submitted to the Controller, the controller does not get
> the updated form attribute values.
> I would like to know why actionForm is null when executing tips.jsp. But
> pageFlow is a valid instanse when
> executing tips.jsp. The second question is depend on the answer of the
> first one.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira