Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to call a bean from within XSL? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to call a bean from within XSL?

    Hi all,

    Just wondering if it's possible to call/get a bean (the ones defined in applicationContext.xml) from within XSL? I'm transforming XML files with XSL and need to populate and display some data from this bean class.

    Thanks,


    nandipinto

  • #2
    getParamters

    Hi nandipinto,

    Can you override the getParameters method of the AbstractXsltView class to add parameters for the transformation? You could create a Map instance property in your subclass and inject a map of Strings into it to be returned by your getParameters() method. For instance:

    Code:
    public abstract class AbstractParameterizedXsltView extends AbstractXsltView {
    
      private Map parameters;
    
      @Override
      public Map getParameters() {
        return this.parameters;
      }
    
      /**
       * Sets the parameters to be used as transformer parameters.
       * 
       * @param parameters the parameters to be used as transformer parameters.
       */
      public void setParameters(Map parameters) {
        this.parameters = parameters;
      }
    	
    }
    You could then configure the map that you are going to inject. Just a thought...

    -Arthur Loder
    Last edited by Arthur Loder; Sep 22nd, 2006, 07:59 AM.

    Comment


    • #3
      Thanks

      Hi Arthur,

      Thanks for the help, really appreciate it. I'll give it a try and let you know if it works.

      -n

      Comment

      Working...
      X