Guest User

Untitled

a guest
Dec 13th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. server:
  2. port: 8090
  3. contextPath: /zpa
  4.  
  5. @Configuration
  6. public class StaticResourceConfiguration extends WebMvcConfigurerAdapter {
  7. @Override
  8. public void addResourceHandlers(ResourceHandlerRegistry registry) {
  9. registry.addResourceHandler("/pngFiles/**")
  10. .addResourceLocations("file:ext-resources/")
  11. .setCachePeriod(0);
  12. }
  13.  
  14. <img src="build/resources/main/static/images/zpl-1.png" >
  15.  
  16. public class StaticResourceConfiguration extends WebMvcConfigurerAdapter{
  17. @Override
  18. public void addResourceHandlers(ResourceHandlerRegistry registry) {
  19.  
  20. String filePath = "E:/AshokParmar/Project/imges/";
  21. registry.addResourceHandler("/img/qrcode/**")
  22. .addResourceLocations("file:/"+filePath)
  23. .setCachePeriod(0);
  24. }
  25. }
  26. in html file use below tags it works
  27. <img src="<c:url value="/img/qrcode/0012340012.png" />"/>
Add Comment
Please, Sign In to add comment