Hello,
I have the following problem with Struts1.1 and the included Tiles package.
I have a master definition, which I want to extend for the other pages. Now
the problem is that the sub-tiles' content doesn't get inserted, and the
content of the master tile is cut off. Here is how I do it currently:
---struts-config.xml---
<struts-config>
<form-beans>
<form-bean
name="loginForm"
type="org.apache.struts.action.DynaActionForm"
>
<form-property name="login" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
</form-bean>
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<message-resources parameter="resources.application"/>
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml"
/>
<set-property property="moduleAware" value="true"/>
<set-property property="definitions-parser-validate" value="true"/>
</plug-in>
<action-mappings>
<action path="/login" forward=".editor.master.layout"/>
<action
path="/loginSubmit"
type="de.rpf.customer.idg.mafo2.struts.MafoAction"
name="loginForm"
scope="request"
/>
</action-mappings>
</struts-config>
---
---tiles-defs.xml---
<tiles-definitions>
<definition name=".editor.master.layout"
page="/pages/editor/master/layout.jsp">
<put name="title" value="empty"/>
<put name="menu" value="/pages/editor/master/empty.jsp"/>
<put name="editArea" value="/pages/editor/master/empty.jsp"/>
<put name="help" value="empty.key"/>
<put name="formAction" value="/loginSubmit.do"/>
</definition>
<definition name=".editor.login" extends=".editor.master.layout">
<put name="title" value="editor.login.title"/>
<put name="editArea" value="/pages/editor/master/empty.jsp"/>
<put name="help" value="empty.key"/>
<put name="formAction" value="/loginSubmit.do"/>
</definition>
</tiles-definitions>
---
---application.properties---
editor.login.title = Webmonitor 2: Login
empty = ***EMPTY_KEY***
---
---empty.jsp---
---
---layout.jsp---
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/tags/struts-html-el" prefix="html-el" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<tiles:importAttribute scope="request"/>
<html-el:html>
<head>
<title><bean-el:message key="${title}"/></title>
<link rel="stylesheet" href="<html-el:rewrite
page='/pages/editor/master/styles.css'/>"/>
</head>
<body>
<bean-el:message key="${title}"/>
<div id="mainform">
<html-el:form action="${formAction}">
<table>
<tr>
<td>
<tiles:insert attribute="menu"/>
</td>
<td>
<tiles:insert attribute="editArea"/>
</td>
<td>
<bean-el:message key="${help}"/>
</td>
</tr>
</table>
</html-el:form>
</div>
</body>
</html-el:html>
---
---login.jsp---
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/tags/struts-html-el" prefix="html-el" %>
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<table>
<tr>
<th colspan="2"><bean-el:message key="editor.login.message"/></th>
</tr>
<tr>
<th><bean-el:message key="editor.login.login"/></th>
<td><html-el:text property="login"/></td>
</tr>
<tr>
<th><bean-el:message key="editor.login.password"/></th>
<td><html-el:password property="password"/></td>
</tr>
<tr>
<th></th>
<td><html-el:submit altKey="editor.master.submit"
titleKey="editor.master.submit"/></td>
</tr>
</table>
---
When I call the login.do action now, instead of the expected combination of
layout.jsp and login.jsp, I get only the following fragment:
---
<html>
<head>
<title>***EMPTY_KEY***</title>
<link rel="stylesheet"
href="/mafo2-dev/pages/editor/master/styles.css"/>
</head>
<body>
***EMPTY_KEY***
<div id="mainform">
<form name="loginForm" method="post"
action="/mafo2-dev/loginSubmit.do">
<table>
<tr>
<td>
</td>
<td>
---
The first <td> in that table is empty, that is OK. But after that it breaks
off completely. I have no idea what is happening there, the logs don't
offer any insight either: no exceptions, no nothing.
Thanks for any help you can offer!
Carl-Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]