You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Simons Kevin <fb...@skynet.be> on 2005/10/19 18:10:46 UTC

struts1.2.7 and tiles definitions

All,

I have used tiles and struts1.2.7 without definitions. The test worked. Now 
I wanted to test struts and tiles with definitions.
This is the tiles-defs.xml file (stored in my web-app web-inf folder)
<tiles-definitions>
<definition name="tests.test" path="/tests/x.jsp"/>
</tiles-definitions>

I also tried
<tiles-definitions>
<definition name="tests.test" path="/x.jsp"/>
</tiles-definitions>

this is my test jsp (index.jsp)

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<html>
<head>
</head>
<body>
<html:form action="/index.do" focus="name">
<html:errors/>
<tiles:insert beanName="tests.test" flush="true"/>
<table>
<tr>
    <td >Name:</td>
    <td><html:text property="name"/></td>
</tr>
</table>
<html:submit>ok</html:submit>
</html:form>
</body>
</html>
I have the following plug in inside struts-config.xml
<plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config" 
value="/WEB-INF/tiles-defs.xml"/>
  </plug-in>
And this is the test file for tiles (x.jsp)
<html>
<head>
</head>
<body>
<hr>
</body>
</html>

When I start this I get the following error :
javax.servlet.jsp.JspException: Error - Tag Insert : No value defined for
bean 'tests.test' with property 'null' in scope 'null'.

Can anyone help me out... 



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/142 - Release Date: 18/10/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1.2.7 and tiles definitions

Posted by Thomas Joseph <th...@uaeexchange.co.in>.
+1
Try <tiles:insert name="tests.test" ... />
        OR <tiles:insert attribute="tests.test" />

Cheers,
Thomas Joseph
thomasj@uaeexchange.co.in

From: "Wendy Smoak" <ja...@wendysmoak.com>


> From: "Simons Kevin" <fb...@skynet.be>
>
> > I have used tiles and struts1.2.7 without definitions. The test worked.
> > Now I wanted to test struts and tiles with definitions.
> > This is the tiles-defs.xml file (stored in my web-app web-inf folder)
> > <tiles-definitions>
> > <definition name="tests.test" path="/tests/x.jsp"/>
> > </tiles-definitions>
> >
> > <tiles:insert beanName="tests.test" flush="true"/>
>
> I'm think you want 'name' not 'beanName'.  Try this:
>
>    <tiles:insert name="tests.test" ... />
>
>
http://struts.apache.org/struts-tiles/tagreference-struts-tiles.html#insert
>
> --
> Wendy Smoak



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1.2.7 and tiles definitions

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Simons Kevin" <fb...@skynet.be>

> I have used tiles and struts1.2.7 without definitions. The test worked. 
> Now I wanted to test struts and tiles with definitions.
> This is the tiles-defs.xml file (stored in my web-app web-inf folder)
> <tiles-definitions>
> <definition name="tests.test" path="/tests/x.jsp"/>
> </tiles-definitions>
>
> <tiles:insert beanName="tests.test" flush="true"/>

I'm think you want 'name' not 'beanName'.  Try this:

   <tiles:insert name="tests.test" ... />

http://struts.apache.org/struts-tiles/tagreference-struts-tiles.html#insert

-- 
Wendy Smoak 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1.2.7 and tiles definitions

Posted by Simons Kevin <fb...@skynet.be>.
Senji,

Thx. I have tried with definition instead of beanName and it worked. (I 
needed to do some small changes but it just took me a minute and  it 
worked.) Thx.
Now the strange thing is that in my book (O'Reilly) they never spoke about 
using definition inside the jsp. So I was wondering did this change someday 
by one of the versions?


For those who guessed name. I tried too (without changing my code) but it 
didn't work. It can be however that the code works.

The code in my book includes the definition file and uses the beanName and 
beanScope attributes.Now since I used definition can I set the scope too? 
And will it be definitionScope or beanScope?

Regards,

----- Original Message ----- 
From: "Kishore Senji" <ki...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, October 20, 2005 7:35 AM
Subject: Re: struts1.2.7 and tiles definitions


> <tiles:insert beanName="tests.test" flush="true"/>


Try "definition" instead of "beanName" as in
<tiles:insert definition="tests.test" flush="true"/>



--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/142 - Release Date: 18/10/2005



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/142 - Release Date: 18/10/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts1.2.7 and tiles definitions

Posted by Kishore Senji <ki...@gmail.com>.
> <tiles:insert beanName="tests.test" flush="true"/>


Try "definition" instead of "beanName" as in
<tiles:insert definition="tests.test" flush="true"/>

Re: tag allow maxlength???

Posted by Larry Meadors <lm...@apache.org>.
The HTML textarea tag has no maxlength attribute - this has nothing to
do with struts.

You can however add an onchange java script to do it, and then also
check it on the back-end.

Larry


On 10/21/05, Carl Smith <cc...@yahoo.com> wrote:
> I need disallow a user from entering more than 2000 character in the <html:textarea>
> tag, however,struts disallow the maxlength attribute on this tag, and suggestions or
> workaround?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: tag allow maxlength???

Posted by Dilip Ladhani <di...@hotmail.com>.
I don't believe you can do a maxlength on a textarea in html. You may have 
to put in a validation (javascript or server side) to return an error 
message  in case the user exceeds the count.


>From: Carl Smith <cc...@yahoo.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: user@struts.apache.org
>Subject: <html:textarea> tag allow maxlength???
>Date: Fri, 21 Oct 2005 08:33:01 -0700 (PDT)
>
>I need disallow a user from entering more than 2000 character in the 
><html:textarea> tag, however,struts disallow the maxlength attribute on 
>this tag, and suggestions or workaround?
>
>
>
>---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in one click.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


tag allow maxlength???

Posted by Carl Smith <cc...@yahoo.com>.
I need disallow a user from entering more than 2000 character in the <html:textarea> tag, however,struts disallow the maxlength attribute on this tag, and suggestions or workaround?


		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.