static-content

Reloading the static files in Spark/Jetty-server

这一生的挚爱 提交于 2019-12-01 16:46:40
问题 I have a bit similar problem described here: Refresh static files served by SparkJava In my application user can upload the content to one folder that is also served to user with Spark.staticFileLocation("/public"); feature. I've understood that SparkJava is reading the 'static' content from that folder only once at startup and it is not aware of changes there. Is it possible to ask Spark (or Jetty via Spark) to reload the changes in static folder? 回答1: Move to externalStaticFileLocation("

IIS 8.5 is not serving JS, CSS, and Image files (static content)

霸气de小男生 提交于 2019-11-30 23:02:24
问题 The problem We're running IIS on Windows 8.1 with Update. We're at the Orchard CMS first time setup screen, and IIS is giving 401s for all static content. We have read the following to no avail: IIS 7.5 no images css js showing IIS 7.5 no images css js showing The official Orchard deployment documentation Based on those, this is what I have tried that doesn't work . Turn on the IIS feature to Serve Static Content. Give IIS_IUSRS permission to Read, write & execute. Give the site's application

How to serve static content using Webflux?

本秂侑毒 提交于 2019-11-30 11:07:12
I am learning webflux and I would like to know how to serve static content on a MicroService using webflux but I didn´t find information to do it. Juan Medina Try this RouterFunction router = resources("/**", new ClassPathResource("public/")); UPDATE: Don't forget to specify a name of the static file in the URL when accessing it from outside, like localhost:8080/index.html Juan Medina is right. I just want to make it even more clear and provide a reference link . In fact, you just have to add a RouterFunction bean to handle static resources. You don't have to implement your own RouterFunction

Azure, best way to store and deploy static content (e.g. images/css)?

試著忘記壹切 提交于 2019-11-29 21:07:35
We're about to deploy our .NET web application to an Azure Web Role. I'm just wondering how others have handled their static content, specifically images and css? At the moment our application package is about 25mb but 18mb of that is derived purely from images, things like navigation buttons, icons and template components that rarely ever get updated. Would it be wise to partition this out of the deployment package and move it to blob storage? I have a few doubts about this approach that I'm wondering are valid... 80% of our site runs in a HTTPS environment. Will accessing images in a blob

Spring Boot images uploading and serving

末鹿安然 提交于 2019-11-29 19:21:15
问题 I'm making new Spring Boot app and want to be able to store and serve images, I want images to be stored in applications directory showed here this is what uploading looks like for now: @PostMapping("/") @ResponseBody public String upload(@RequestPart String title, @RequestPart MultipartFile img) throws IOException{ String imgName = img.getOriginalFilename(); Post p = new Post(); p.setTitle(title); p.setImageName(imgName); postService.add(p); File upl = new File("images/" + imgName); upl

How to serve static content using Webflux?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 17:07:06
问题 I am learning webflux and I would like to know how to serve static content on a MicroService using webflux but I didn´t find information to do it. 回答1: Try this RouterFunction router = resources("/**", new ClassPathResource("public/")); UPDATE: Don't forget to specify a name of the static file in the URL when accessing it from outside, like localhost:8080/index.html 回答2: Juan Medina is right. I just want to make it even more clear and provide a reference link. In fact, you just have to add a

JSP doesn't open CSS, Images and JS

这一生的挚爱 提交于 2019-11-29 12:30:27
I'm trying to put CSS, JS and IMGs on my JSP, but doesn't work, it's strange because I use c:url and "jstl/core" I'm use JSP, jstl and servlet, no frameworks. <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>clientes atuantes</title> <link rel="stylesheet" href="<c:url value="/bootstrap/css/bootstrap.min.css"/>"> <link rel="stylesheet" href="<c:url value="

Can DropWizard serve assets from outside the jar file?

百般思念 提交于 2019-11-29 11:47:08
问题 In looking at the documentation, it appears that DropWizard is only able to serve static content living in src/main/resources. I'd like to keep my static files in a separate directory outside the jar file. Is that possible? Or do most people use nginx/Apache for their static content? 回答1: yes, it can, using this plugin - https://github.com/bazaarvoice/dropwizard-configurable-assets-bundle 回答2: Working off of Marcello Nuccio's answer, it still took me the better part of my day to get it right,

Azure Website slow to serve static JS/CSS but not binary

混江龙づ霸主 提交于 2019-11-28 19:09:53
I have an Azure Website/Web App that is incredibly slow to serve static JS and CSS files but seems perfectly fine serving binary. To test the problem I uploaded two 30MB files, one big.js and the other big.rar . The JS file downloads at around 100KB/s if I'm lucky. The RAR file downloads at around 4,000KB/s. The results are extremely consistent. I've checked in Fiddler and gzip compression is occurring in both cases. As expected, the JS file is being sent with the MIME type application/x-javascript whereas the RAR file is being served as application/octet-stream . I am struggling to understand

Azure, best way to store and deploy static content (e.g. images/css)?

孤人 提交于 2019-11-28 16:29:49
问题 We're about to deploy our .NET web application to an Azure Web Role. I'm just wondering how others have handled their static content, specifically images and css? At the moment our application package is about 25mb but 18mb of that is derived purely from images, things like navigation buttons, icons and template components that rarely ever get updated. Would it be wise to partition this out of the deployment package and move it to blob storage? I have a few doubts about this approach that I'm