I have created a JIRA plugin and added REST module. Now I am calling velocity template using REST module, like this -
@GET
@Path("/login")
@AnonymousAllowed
@Produces({ MediaType.TEXT_HTML })
public Response getLoginPage(@PathParam("projectId") final String projectId) {
try {
Map<String, Object> context = new HashMap<>();
context.put("loginUri", loginUri);
httpServletResponse.setContentType("text/html;charset=utf-8");
templateRenderer.render("/templates/login.vm", context, httpServletResponse.getWriter());
} catch (Exception e) {
throw new WebApplicationException(e);
}
return Response.ok().build();
}
The velocity template looks like this -
<html>
<head>
<title>Login</title>
<meta name="decorator" content="atl.admin" />
<script>/*javascript code*/</script>
</head>
<body>
/*Login UI*/
</body>
</html>
But the login UI is not getting embedded inside Atlassian UI. It is getting rendered as a separate HTML file. It works fine with Servlet module, but doesn't work same with REST module.
How can I render Velocity Template inside Atlassian UI from REST module ?