Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Special Character handling in Struts Menu Component  RSS feed

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I have a requirement where I need to create a tree structure for an xml using Struts menu component and display that in ui. But problem is if XML contains any tags such as "type_org" then i am getting an error stating MenuComponent id cannot be null, not contain '*' or '_'.

Is there any solution to generate a tree structure which can contain such tags with underscore symbol

Thanks and regards
Dilip
 
Bartender
Posts: 9481
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts doesn't have a "menu component". Are you talking about the jQuery Tree from your previous post?
You need to Tell The Details. The better question you ask, the more help we can be.
 
Dilip H Pashupathi
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,

We are using Struts Layout API for this purpose. In Struts Layout there is a class called MenuComponent. This component allows us to create hierarchical tree structure which is used to navigate between the nodes and xml.

for example



This xml will be converted to a directory tree

+evprm
+ichicsr
+organisations

if "+" symbol is clicked on it has to expand and show the rest of the contents. But since <type_org> contains the underscore symbol in it, it's raising an exception.
Here is a fragment of the code that is used for tree creation.



Note:
JDK Version: 1.6.0_17

Struts Jars being used:

  • commons-codec.jar
  • commons-collections.jar
  • commons-digester-1.8.jar
  • commons-discovery-0.2.jar
  • commons-fileupload-1.1.1.jar
  • commons-httpclient-3.1.jar
  • commons-io-1.1.jar
  • commons-lang.jar
  • commons-logging-1.0.4.jar
  • commons-pool-1.4.jar
  • commons-resources.jar
  • commons-services.jar
  • commons-validator-1.3.1.jar
  • struts-core-1.3.8-sources.jar
  • struts-core-1.3.8.jar
  • struts-extras-1.3.8.jar
  • struts-layout.jar
  • struts-taglib-1.3.8.jar
  • struts-tiles-1.3.8.jar
  • strutstest-2.1.4.jar


  • Tag Library Descriptors:
  • struts-bean.tld
  • struts-html.tld
  • struts-layout.tld
  • struts-logic.tld
  • struts-nested.tld
  • struts-tiles.tld



  • Development Server: Apache Tomcat 6.0
    Deployment Server: Jboss 5.0 GA, and Jboss AS 7.0
     
    Joe Ess
    Bartender
    Posts: 9481
    12
    Linux Mac OS X Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    One of the things you should consider before choosing a dependency is how well supported the library is. I've never heard of this library, but it looks like the latest release, 1.4.0, was in July 2009. There are mailing lists, but that page says to use the forums, the latest post being nearly a year ago. I don't think I would trust my application on a dependency that has that little activity.
    If you want to proceed, look through the list of issues and see if someone has had the same problem and posted a work around. Search the mailing lists for the same. Last, try posting a message to the forums or mailing list.
     
    Dilip H Pashupathi
    Ranch Hand
    Posts: 53
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Joe,

    Is there any way through which we can create an xml by using the data available in database? I have a table where the tags are stored in format of parent and child relation
    for example:


    and so on

    Below is a link to a word document relating to xml document explained in detail.

    EMA Guidelines

    and
    EMA Webpage

    This data will be stored in db as shown above.

    Thanks and Regards
    Dilip
     
    Joe Ess
    Bartender
    Posts: 9481
    12
    Linux Mac OS X Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    If you searched the Ranch for how to create XML, you'd find useful posts like this one: this topic (pay particular attention to Rob's post).
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!