Announcement Announcement Module
Collapse
No announcement yet.
JSP component-type using WebScriptProcessor? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSP component-type using WebScriptProcessor?

    I am trying to use the logout-success component-type provided with the spring-travel sample application:

    ------------------------------------------
    <component-type>
    <id>logout-success</id>
    <title>Logout Success Component Type</title>
    <description>Logout Success Component Type</description>

    <!-- Define the rendering processors for this component type -->
    <processor mode="view">
    <id>jsp</id>
    <jsp-path>/WEB-INF/jsp/logout-success.jsp</jsp-path>
    </processor>
    </component-type>
    ------------------------------------------

    I copied to logout-success.xml file from spring-travel to my sample application. I then created a simple page and added the following component:

    ------------------------------------------
    <component>
    <component-type>logout-success</component-type>
    <scope>page</scope>
    <region-id>top-left</region-id>
    <source-id>3column</source-id>
    </component>
    -------------------------------------------

    I know that this component is recognized as an error is generated if I make improper changes to the logout-success.xml file.

    The problem is that I get the NullPointerException below when I try to access the page. What is interesting is that the WebScriptProcessor class is on the stack rather than the JSPProcessor. There must be a mistake in the logout-success.xml? Any help appreciated!

    Thanks,

    Bob

    P.S. I have tried to run the spring-travel application stand-alone, but I am getting the error described in THIS forum post.

    -------------------------------------------------
    Caused by: java.lang.NullPointerException
    at org.springframework.extensions.surf.uri.UriUtils.r eplaceUriTokens(UriUtils.java:57)
    at org.springframework.extensions.webscripts.WebScrip tProcessor.executeHeader(WebScriptProcessor.java:1 49)
    at org.springframework.extensions.surf.render.Abstrac tProcessor.execute(AbstractProcessor.java:89)
    at org.springframework.extensions.surf.render.RenderS ervice.processComponent(RenderService.java:468)
    at org.springframework.extensions.surf.render.RenderS ervice.renderRawComponent(RenderService.java:970)
    at org.springframework.extensions.surf.render.bean.Co mponentRenderer.header(ComponentRenderer.java:67)
    ... 50 more

    -------------------------------------------------

  • #2
    Problem Solved

    I discovered the problem. The element name for the type declaration in the in the component definition (above) should be "component-type-id", not "component-type":


    <component-type-id>logout-success</component-type-id>

    The JSP executes properly!

    Thanks,

    Bob

    Comment


    • #3
      Good to know, thanks for posting that tip - could be an easy mistake to make!

      Cheers,

      Kev

      Comment

      Working...
      X