image-download - adding jsp and plain copy to response method

This commit is contained in:
Slavisa Baeldung
2016-05-10 13:55:44 +02:00
parent a58a896ac8
commit a72def9d89
4 changed files with 67 additions and 34 deletions
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.baeldung.spring.controller"/>
<!-- Start: Mapping by bean name (BeanNameUrlHandlerMapping) -->
<bean
class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
<property name="order" value="1"/>
</bean>
@@ -0,0 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Image download examples</title>
</head>
<body>
<h1>Image download examples</h1>
<ul>
<li><a href="<c:url value="/image-manual-response" />">Image manually add to response</a></li>
<li><a href="<c:url value="/image-byte-array.jpg" />">Image Download <i>byte[]</i> Example</a></li>
<li><a href="<c:url value="/image-response-entity.jpg" />">Image Download <i>ResponseEntity</i> Example</a></li>
<li><a href="<c:url value="/image-resource.jpg" />">Image Download <i>Resource</i> Example</a></li>
</ul>
</body>
</html>
+1
View File
@@ -13,6 +13,7 @@
<ul>
<li><a href="employee">Welcome Page</a></li>
<li><a href="spring-handler-index.jsp">Spring Handler Mapping Examples</a></li>
<li><a href="image-view">Image Download Examples</a></li>
</ul>
</body>