I'm attempting to use Spring service classes I've created inside custom JSP tags. For example given a conditional style tag, which will call a relationship service and then display the appropriate content.
I know you can access a spring bean in the custom JSP Java code via WebApplicationContextUtils, but this doesn't seem clean to me and I can see a problem with this if that service you call has other Autowired services, exceptions will occur.
I've read comments that this is accessing legacy code (JSP tags) with Spring, that you shouldn't access services in a tag as it breaks the MVC model.. what's the best way to be doing this? Should I create service classes specifically for use by the custom tags?