Assume the following servlet definition:
<servletname="Build My Servlet"
key="myServlet"
class="com.whatever.MyServlet">
<description>Serves up build stuff</description>
<url-pattern>/MySummary</url-pattern>
<resource type="freemarker" name="edit"location="/templates/myServletTemplate.ftl"/>
</servlet>
From within the servlet class, and specifically the doGet method, how do I get ahold of that resources? I'd like to grab an instance of ModuleDescriptor somehow so that I can do something like the below but I can't seem to make anything work. Any suggestions would be great. Thanks.
ResourceLocation resourceLocation = moduleDescriptor.getResourceLocation("freemarker", "edit");
I got around this (or rather I did it the "correct" way) by using xwork/action instead of creating custom servlet.
I don't believe its easy to get a servlets resource without knowing how the guts of the Atlassian Plugin framework works. Have you tried getting the resource by calling getClass().getresourceasstream('/templates/myServletTemplate.ftl')?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.