You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rod Bollinger <te...@portablegenius.com> on 2007/04/13 21:54:10 UTC

tiles-defs.xml and extended attributes...

Hello,

I have a menuing system using a custom tag to create menus based on
configurations specified in Tiles. I needed to create a more robust solution
for menu specification than was provided by the
org.apache.struts.tiles.beans.SimpleMenuItem. I extended the
org.apache.struts.tiles.beans.MenuItem interface as well. I now have a new
MenuItemExt class that extends SimpleMenuItem and implements my new
IMenuItemExt that extends MenuItem. The extension provides several
additional attributes to a menu item definition beyond that provided "out of
the box".

My problem is this: the new attributes, when specified in tiles-def.xml, are
flagged as errors - 

	"Attribute 'xyz' must be declared for element 'item'".

Is there a way to define these extended attributes in my TLD file or would
this require an extension to the tiles-config_1_3.dtd (not really
preferable)? What is the correct procedure for declaring these "extra"
attributes such that they are considered "valid"?

Thanks,
-Rod




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


Re: tiles-defs.xml and extended attributes...

Posted by Antonio Petrelli <an...@gmail.com>.
2007/4/17, Rod Bollinger <te...@portablegenius.com>:
> Hi Antonio,
>
> I agree that that works. In fact, both approaches function identically. That
> is not the issue. The only issue I was raising was how to make the
> SimpleMenuItem extension attributes validate properly in an IDE. Since, they
> are not declared in the DTD, I fear that XML validation will not be possible
> (without raising the errors of course).

What do you mean with "extension attributes"? Are they bean properties
of your SimpleMenuItem-subclassed class?

Antonio

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


Re: tiles-defs.xml and extended attributes...

Posted by Martin Gainty <mg...@hotmail.com>.
which IDE???

M
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Dave Newton" <ne...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>; "Martin Gainty" 
<mg...@hotmail.com>
Sent: Monday, April 16, 2007 8:56 PM
Subject: Re: tiles-defs.xml and extended attributes...


> --- Martin Gainty <mg...@hotmail.com> wrote:
>> Apologies for jumping in mid-thread..Can I assume by
>> 'extension' you mean VaLang? In which case have you
>> looked at implementing Validation with Spring
>> Validators?
>
> Whahuh? He's talking about the validation of an XML
> configuration file from within his IDE.
>
>> From: "Rod Bollinger" <te...@portablegenius.com>
>>> The only issue I was raising was how to make the
>>> SimpleMenuItem extension attributes validate
>>> properly in an IDE. Since, they are not declared in
>
>>> the DTD, I fear that XML validation will not be
>>> possible
>
> d.
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 


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


Re: tiles-defs.xml and extended attributes...

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Gainty <mg...@hotmail.com> wrote:
> Apologies for jumping in mid-thread..Can I assume by
> 'extension' you mean VaLang? In which case have you 
> looked at implementing Validation with Spring 
> Validators?

Whahuh? He's talking about the validation of an XML
configuration file from within his IDE.

> From: "Rod Bollinger" <te...@portablegenius.com>
>> The only issue I was raising was how to make the
>> SimpleMenuItem extension attributes validate
>> properly in an IDE. Since, they are not declared in

>> the DTD, I fear that XML validation will not be 
>> possible

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: tiles-defs.xml and extended attributes...

Posted by Martin Gainty <mg...@hotmail.com>.
Apologies for jumping in mid-thread..Can I assume by 'extension' you mean 
VaLang?
In which case have you looked at implementing Validation with Spring 
Validators?
https://springmodules.dev.java.net/docs/reference/0.8/html/validation.html

M
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Rod Bollinger" <te...@portablegenius.com>
To: "'Struts Users Mailing List'" <us...@struts.apache.org>
Sent: Monday, April 16, 2007 6:41 PM
Subject: RE: tiles-defs.xml and extended attributes...


> Hi Antonio,
>
> I agree that that works. In fact, both approaches function identically. 
> That
> is not the issue. The only issue I was raising was how to make the
> SimpleMenuItem extension attributes validate properly in an IDE. Since, 
> they
> are not declared in the DTD, I fear that XML validation will not be 
> possible
> (without raising the errors of course).
>
> My choice then is to either allow validation to take place and ignore any
> errors regarding the extension attributes -or- disable validation (with 
> the
> possible negative side-effect of missing something that should have been
> caught by validation - not good). The annoyance of the bogus validation
> errors is outweighed by the value of having the rest of the page validated
> at design-time and so appears to be the best choice.
>
> Of course, I could always go and change all menu templates to use the bean
> definition approach instead - it makes no difference to the code, 
> everything
> works just fine.
>
> Thanks for the response,
> -Rod
>
>
> -----Original Message-----
> From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com]
> Sent: Monday, April 16, 2007 02:52
> To: Struts Users Mailing List
> Subject: Re: tiles-defs.xml and extended attributes...
>
> 2007/4/13, Rod Bollinger <te...@portablegenius.com>:
>> Is there a way to define these extended attributes in my TLD file or 
>> would
>> this require an extension to the tiles-config_1_3.dtd (not really
>> preferable)? What is the correct procedure for declaring these "extra"
>> attributes such that they are considered "valid"?
>
> I think that you should use <bean> instead of <item>, that takes
> <set-property> elements too.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 


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


RE: tiles-defs.xml and extended attributes...

Posted by Rod Bollinger <te...@portablegenius.com>.
Hi Antonio,

I agree that that works. In fact, both approaches function identically. That
is not the issue. The only issue I was raising was how to make the
SimpleMenuItem extension attributes validate properly in an IDE. Since, they
are not declared in the DTD, I fear that XML validation will not be possible
(without raising the errors of course).

My choice then is to either allow validation to take place and ignore any
errors regarding the extension attributes -or- disable validation (with the
possible negative side-effect of missing something that should have been
caught by validation - not good). The annoyance of the bogus validation
errors is outweighed by the value of having the rest of the page validated
at design-time and so appears to be the best choice.

Of course, I could always go and change all menu templates to use the bean
definition approach instead - it makes no difference to the code, everything
works just fine.

Thanks for the response,
-Rod


-----Original Message-----
From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com] 
Sent: Monday, April 16, 2007 02:52
To: Struts Users Mailing List
Subject: Re: tiles-defs.xml and extended attributes...

2007/4/13, Rod Bollinger <te...@portablegenius.com>:
> Is there a way to define these extended attributes in my TLD file or would
> this require an extension to the tiles-config_1_3.dtd (not really
> preferable)? What is the correct procedure for declaring these "extra"
> attributes such that they are considered "valid"?

I think that you should use <bean> instead of <item>, that takes
<set-property> elements too.

Antonio

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




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


Re: tiles-defs.xml and extended attributes...

Posted by Antonio Petrelli <an...@gmail.com>.
2007/4/13, Rod Bollinger <te...@portablegenius.com>:
> Is there a way to define these extended attributes in my TLD file or would
> this require an extension to the tiles-config_1_3.dtd (not really
> preferable)? What is the correct procedure for declaring these "extra"
> attributes such that they are considered "valid"?

I think that you should use <bean> instead of <item>, that takes
<set-property> elements too.

Antonio

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