You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zsolt Koppany <zk...@web.de> on 2002/12/05 23:44:00 UTC

How to extend tiles SimpleMenuItem?

Hi,

I have written a class that extends SimpleMenuItem but when I want to assign 
new items (see example below) I get error logs. How can I fix it?

Example:

<item
	id="summary"
	value="Summary"
	selectionStyle="toolbar_summary_selected"
	link="/proj/summary.do"
	classtype="cv.struts.TilesMenuItem" />

Error messages:


ERROR commons.digester.Digester     - Parse Error at line 28 column -1: 
Attribute "loggedOn" is not declared for element "item". [main]
org.xml.sax.SAXParseException: Attribute "loggedOn" is not declared for 
element "item".
    at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to extend tiles SimpleMenuItem?

Posted by Cedric Dumoulin <ce...@apache.org>.

Zsolt Koppany wrote:

>Hi Cedric,
>
>where should I insert parserValidate="false"? 
>
  In the plugin declaration:
  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="parserValidate" value="false"/>
   ...

>Where should I use the <bean 
>tag? In which file and which block?
>
  In tiles config file, in place of <insert ...>.

  Check the tiles-config dtd 
http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd


   Cedric

>
>Zsolt
>
>On Friday 06 December 2002 10:56, Cedric Dumoulin wrote:
>  
>
>>  Hi,
>>
>>  You can extends  SimpleMenuItem:
>>
>>    * Write a class extending SimpleMenuItem, or implementing
>>      SimpleMenu. Add your new attributes
>>    * Declare your items in your tiles-config, and specify the classtype
>>      attribute: <item classtype="YourClassName" ..../>
>>    * Also specify your new attributes: <item ... myNewItem="aValue" .../>
>>    * Enable the parser to parse your new attribute.There is several
>>      possibilities:
>>          o Disable the parser validation. This can be done in the
>>            TilesPlugin configuration: parserValidate="false"
>>          o Or create your own DTD declaring your new attributes:
>>                + copy the original DTD, localize the item
>>                  specification, add your own attributes
>>                + Specify your new DTD  in the header of the
>>                  tiles-config file
>>
>>  Now the parser should be able to validate your new attributes.
>>
>>  Another possibility is to use the <bean .../> tag:
>>
>>          o
>>
>>
>>            <bean classtype="YourClassName">
>>              <set-property property="aName" value="aValue" />
>>              <set-property property="anotherName" value="anotherValue" />
>>              .....
>>            </bean>
>>
>>  Hope this help,
>>
>>        Cedric
>>
>>Zsolt Koppany wrote:
>>    
>>
>>>Hi,
>>>
>>>I have written a class that extends SimpleMenuItem but when I want to
>>>assign new items (see example below) I get error logs. How can I fix it?
>>>
>>>Example:
>>>
>>><item
>>>	id="summary"
>>>	value="Summary"
>>>	selectionStyle="toolbar_summary_selected"
>>>	link="/proj/summary.do"
>>>	classtype="cv.struts.TilesMenuItem" />
>>>
>>>Error messages:
>>>
>>>
>>>ERROR commons.digester.Digester     - Parse Error at line 28 column -1:
>>>Attribute "loggedOn" is not declared for element "item". [main]
>>>org.xml.sax.SAXParseException: Attribute "loggedOn" is not declared for
>>>element "item".
>>>   at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:  
>>><ma...@jakarta.apache.org> For additional
>>>commands, e-mail: <ma...@jakarta.apache.org>
>>>      
>>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to extend tiles SimpleMenuItem?

Posted by Zsolt Koppany <zk...@web.de>.
Hi Cedric,

where should I insert parserValidate="false"? Where should I use the <bean 
tag? In which file and which block?

Zsolt

On Friday 06 December 2002 10:56, Cedric Dumoulin wrote:
>   Hi,
>
>   You can extends  SimpleMenuItem:
>
>     * Write a class extending SimpleMenuItem, or implementing
>       SimpleMenu. Add your new attributes
>     * Declare your items in your tiles-config, and specify the classtype
>       attribute: <item classtype="YourClassName" ..../>
>     * Also specify your new attributes: <item ... myNewItem="aValue" .../>
>     * Enable the parser to parse your new attribute.There is several
>       possibilities:
>           o Disable the parser validation. This can be done in the
>             TilesPlugin configuration: parserValidate="false"
>           o Or create your own DTD declaring your new attributes:
>                 + copy the original DTD, localize the item
>                   specification, add your own attributes
>                 + Specify your new DTD  in the header of the
>                   tiles-config file
>
>   Now the parser should be able to validate your new attributes.
>
>   Another possibility is to use the <bean .../> tag:
>
>           o
>
>
>             <bean classtype="YourClassName">
>               <set-property property="aName" value="aValue" />
>               <set-property property="anotherName" value="anotherValue" />
>               .....
>             </bean>
>
>   Hope this help,
>
>         Cedric
>
> Zsolt Koppany wrote:
> >Hi,
> >
> >I have written a class that extends SimpleMenuItem but when I want to
> > assign new items (see example below) I get error logs. How can I fix it?
> >
> >Example:
> >
> ><item
> >	id="summary"
> >	value="Summary"
> >	selectionStyle="toolbar_summary_selected"
> >	link="/proj/summary.do"
> >	classtype="cv.struts.TilesMenuItem" />
> >
> >Error messages:
> >
> >
> >ERROR commons.digester.Digester     - Parse Error at line 28 column -1:
> >Attribute "loggedOn" is not declared for element "item". [main]
> >org.xml.sax.SAXParseException: Attribute "loggedOn" is not declared for
> >element "item".
> >    at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
> >
> >
> >--
> >To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org> For additional
> > commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to extend tiles SimpleMenuItem?

Posted by Cedric Dumoulin <ce...@apache.org>.
  Hi,

  You can extends  SimpleMenuItem:

    * Write a class extending SimpleMenuItem, or implementing
      SimpleMenu. Add your new attributes
    * Declare your items in your tiles-config, and specify the classtype
      attribute: <item classtype="YourClassName" ..../>
    * Also specify your new attributes: <item ... myNewItem="aValue" .../>
    * Enable the parser to parse your new attribute.There is several
      possibilities:
          o Disable the parser validation. This can be done in the
            TilesPlugin configuration: parserValidate="false"
          o Or create your own DTD declaring your new attributes: 
                + copy the original DTD, localize the item
                  specification, add your own attributes
                + Specify your new DTD  in the header of the
                  tiles-config file

  Now the parser should be able to validate your new attributes.

  Another possibility is to use the <bean .../> tag:

          o


            <bean classtype="YourClassName">
              <set-property property="aName" value="aValue" />
              <set-property property="anotherName" value="anotherValue" />
              .....
            </bean>

  Hope this help,

        Cedric

Zsolt Koppany wrote:

>Hi,
>
>I have written a class that extends SimpleMenuItem but when I want to assign 
>new items (see example below) I get error logs. How can I fix it?
>
>Example:
>
><item
>	id="summary"
>	value="Summary"
>	selectionStyle="toolbar_summary_selected"
>	link="/proj/summary.do"
>	classtype="cv.struts.TilesMenuItem" />
>
>Error messages:
>
>
>ERROR commons.digester.Digester     - Parse Error at line 28 column -1: 
>Attribute "loggedOn" is not declared for element "item". [main]
>org.xml.sax.SAXParseException: Attribute "loggedOn" is not declared for 
>element "item".
>    at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>