我无法在 FTL 模板(FreeMaker 工具)中显示图像。图片是从网页内容加载的,但我无法从应用程序资源加载它。在我的应用程序中,我使用 Vaadin、Spring Framework 和 FreeMaker。如何解决这个问题?谢谢您的回复。
login.ftl:http ://pastebin.com/N1VX30Zr 1
servlet-context.xml: http: //pastebin.com/1SFSwmJT 1
web.xml: http: //pastebin.com/NtZD5zSY 1
登录控制器.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";
}