Unable to display images in FTL template (Java, FreeMaker, Vaadin) -
i can't display images in ftl template (freemaker tool). images loading web content, can't load app resources. in app use vaadin, spring framework , freemaker. how fix problem? reply.
login.ftl: http://pastebin.com/n1vx30zr1
servlet-context.xml: http://pastebin.com/1sfswmjt1
web.xml: http://pastebin.com/ntzd5zsy1
logincontroller.java:
package pl.controlprocess.flota.web; import com.vaadin.server.themeresource; import java.io.serializable; import javax.servlet.http.httpservletrequest; import org.springframework.stereotype.controller; import org.springframework.ui.modelmap; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.web.bind.annotation.requestparam; @controller @requestmapping("/") public class logincontroller implements serializable { private static final long serialversionuid = 1l; @requestmapping(value = "/", method = requestmethod.get) public string login(httpservletrequest request, @requestparam(value = "error", defaultvalue = "false", required = false)boolean iserror, modelmap model) { if (iserror) { model.put("iserror", iserror); } model.put("app_ctx", request.getcontextpath()); return "login"; }
this complex configuration scan on - believe problem you've configured vaadin servlet pick requests root of context (servlet mapping /*).
vaadin serve static resources underneath vaadin/ subdirectory (and then, it's more complicated - you'd need put images in directory related theme vaadin app using).
i note, though, has thought of this, they've created mapping /static/ default servlet.
if add images "static" subdirectory of root of webapplication, , change references in template ${app_ctx}/static/cam00127.jpg
, should fine.
Comments
Post a Comment