JSP Renderer + Java DeclarativeWebScript
I have a working JSP Renderer as per THIS earlier post to this forum. I also have a working Java DeclarativeWebScript modeled after the org.springframework.extensions.webeditor.webscript s.WEFApplicationGet class by Gavin Cornwell.
What I need now is to COMBINE a JSP Renderer with a Java DeclarativeWebScript. I'm encountering a problem when I try to provide the <package> value for the DeclarativeWebScript bean declaration. Let me explain...
The <component-type> definition for the JSP Renderer declares the path to the JSP file. This bypasses the need for any artifacts in the "webscripts" directory. Example from spring-surf-application-spring-travel:
Code:
<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>
The <component> element in the page definition then references the component-type-id (e.g. "logout-success"):
Code:
<page>
<id>logoutSuccess</id>
<title>logout success</title>
<template-instance>standard</template-instance>
<authentication>none</authentication>
<components>
<component>
<region-id>body</region-id>
<component-type-id>logout-success</component-type-id>
</component>
</components>
</page>
This is different from a "normal" component element in a page definition where a url to the Web Script (in the "webscript") directory is required. The logout-success component works without a reference to a Web Script. You can hit the logoutSuccess page and it runs the logout-success.jsp as expected.
The problem surfaces when you try to associate a Java DeclarativeWebScript with the JSP Renderer (e.g. logout-success). The DeclarativeWebScript bean definition requires an "id" attribute:
id="webscript.<packageId>.<serviceId>.<httpMethod> "
What value do you provide for the <packageId> token? The <packageId> appears to reference within the "webscripts" directory. But the JSP Renderer (logout-success) has no artifacts under "webscripts".
I am hoping that there is a way to combine a JSP Renderers with a Java DeclarativeWebScript. Perhaps there is a <packageId> for the JSP Renderer that I am unaware of? Or, a way to define a JSP Renderer such that it is a first class Web Script (i.e. has artifacts under the "webscripts" directory).
Thanks,
Bob
Acknowledge JSP not supported
Dave,
Thanks for the reply. We will adjust our implementation accordingly.
To clarify the point, I am not asking to "change the WebScript rendering engine from using FreeMarker to using JSP" Rather to abstract the WebScript rendering engine to dynamically allow for plug-in implementations of the rendering software. FreeMarker would be the default. JSP and other can be configured.
I thought this was possible after reading a couple statements on this point:
From http://www.springsurf.org/sites/1.0....eginning.html:
Quote:
A Surf page object has a required field for template instance therefore the Surf dispatcher knows which template to use to render view for the page. Other types of templates that Surf supports are JSP and Webscript.
From http://wiki.alfresco.com/wiki/Surf:
Quote:
Develop views using best-of-breed scripting technologies including Freemarker, Groovy, PHP and server-side Javascript.
By "template" above, I was thinking "template engine", such as FreeMarker. The idea being that we are simply creating a model and passing it to a template technology for rendering. in the case of JSP, you could simply put the "model" Map object in request scope.
I misunderstood. However, it would be nice if multiple rendering technologies were supported.
Regards,
Bob