Announcement Announcement Module
Collapse
No announcement yet.
XSLT View Problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XSLT View Problems

    I am working to understand using XSLT as my viewing technology. Using the code snippets from "Section 14.5 - XSLT" (pg 183 v1.2.6), I have implemented the web application but cannot get past the following problem:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'home' defined in null: Initialization of bean failed; nested exception is org.springframework.context.ApplicationContextExce ption: Can't load stylesheet from ServletContext resource [/WEB-INF/xsl/home.xslt] in XSLT view 'home'; nested exception is javax.xml.transform.TransformerConfigurationExcept ion: Could not compile stylesheet
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:370)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:275)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:320)
    org.springframework.web.servlet.view.ResourceBundl eViewResolver.initFactory(ResourceBundleViewResolv er.java:202)
    org.springframework.web.servlet.view.ResourceBundl eViewResolver.loadView(ResourceBundleViewResolver. java:148)
    org.springframework.web.servlet.view.AbstractCachi ngViewResolver.createView(AbstractCachingViewResol ver.java:141)
    org.springframework.web.servlet.view.AbstractCachi ngViewResolver.resolveViewName(AbstractCachingView Resolver.java:79)
    org.springframework.web.servlet.DispatcherServlet. resolveViewName(DispatcherServlet.java:983)
    org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:942)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:738)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:658)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:392)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

    The error suggests the obvious problem is with the home.xslt file. Now, I am not an XSLT expert but others who know XSLT have examined this file and see nothing obviously wrong. Here is the file:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="text/html" omit-xml-declaration="yes">
    </xsl:output>

    <xsl:template match="/">
    <html>
    <head><title>Hello!</title></head>
    <body>
    <h1>My First Words</h1>
    <xsl:for-each select="wordList/word">
    <xsl:value-of select="."/><br />
    </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

    I am using the following:
    -Tomcat 5.5.9
    -Spring 1.2.6
    -J2SE 5.0 Update 6

    If someone has a working version of the XSLT View code from Section 14.5 I'd love to see it and attempt to make it work in my environment.

    A quick search of the web seems to hint that in general others are having issues with TransformerConfigurationException when migrating from JDK 1.4.x to JDK 5.

    Thanks in advance,
    Matt Lumsden
Working...
X