Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate into modules #36

Open
matiwinnetou opened this issue Nov 12, 2013 · 6 comments
Open

separate into modules #36

matiwinnetou opened this issue Nov 12, 2013 · 6 comments

Comments

@matiwinnetou
Copy link
Owner

It would be good if spring-mvc was just a plugin project, we could support other java/scala view technologies by having a generic core library. Experiment.

@phasebash
Copy link
Collaborator

Good idea. Just to throw in another perspective... we're rolling Soy templates out into a project heavily invested in JSP, which is requiring us to create wrapper Tag classes so old views can utilize the new templates. In order to utilize the same global and runtime models configured for the "new shit" I've based these tags on the renderer classes in soy-spring-view. FWIW. This would really help.

@matiwinnetou
Copy link
Owner Author

I investigates this a bit while converting spring-soy-view to play-soy-view for play framework 2.x. I realized that it may be possible to do this but one would have to assume at least a dependency on Servlet API. At the moment my real life projects vary between play and spring-mvc and layer of separation I cannot achieve there thus making this for me abstract or an academic endeavor.

As a side note, as not sure if you are aware, Play does not depend on servlet API at all.

@phasebash
Copy link
Collaborator

It would be awesome, generally speaking, to break the dependency on the Servlet API. What hard dependencies does spring-soy-view have on Servlet API? For example, in RenderRequest.java, could we use a Writer instead of a HttpServletResponse? I don't see that the HttpServletRequest is used anywhere but unit tests.

@matiwinnetou
Copy link
Owner Author

Well, it requires some thinking, I remember I may have used this object also in RuntimeRenderers, they need to access various things like Cookies, etc.

@matiwinnetou
Copy link
Owner Author

A no, I am looking at this now, technically it is not required right because RuntimeRenderes are invoked here in SoyView, which is a spring mvc specific class:

    final RenderRequest renderRequest = new RenderRequest.Builder()
            .compiledTemplates(compiledTemplates)
            .templateName(templateName)
            .model(adjustedModel)
            .request(request)
            .response(response)
            .globalRuntimeModel(globalRuntimeModelResolver.resolveData(request, response, model))
            .soyMsgBundle(soyMsgBundleResolver.resolve(localeProvider.resolveLocale(request)))
            .soyView(this)
            .build();

@matiwinnetou
Copy link
Owner Author

Unfortunately, having looked more into this I think it could maybe work only for servlet containers, in case of play, there are much more drastic changes that are needed, therefore it seems to be very hard to capture a generic abstraction. I think I will close this. Objections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants