Questions tagged [static-resource]

70 questions
12
votes
2 answers

Serve static files (JavaScript) with Struts 2

I want to put some JavaScript files in one of my packages and make Struts serve them like /struts/js/foo.js Struts does that for files in 'template' package (that's where jQuery plugin's files are located, guarded by struts.ui.templateDir option).…
alamar
  • 18,729
  • 4
  • 64
  • 97
11
votes
2 answers

Binding a datacontext string property to a StaticResource key

I have an List values with a ResourceKey and a Caption, these values are both strings. The Resource is the name of an actual resource defined in a resource dictionary. Each of these ResourceKey Icons are Canvas's.
dvkwong
  • 543
  • 2
  • 4
  • 12
7
votes
2 answers

Loading static resources with Spring Boot and Thymeleaf

I want to get my static resources loaded. First I thought it already works, but that was just a trick of browser cache. I only get the html-files loaded as expected, but I dont get js, css, images and so on. ====== My…
Michael Hegner
  • 5,555
  • 9
  • 38
  • 64
6
votes
1 answer

Serve static resources within jar files by Spring boot

I'm developing a solution by multiple maven modules to handle different bounded contexts. Thanks to spring boot each module exposes own rest api and all of them hosted in one maven module with a class that annotated by @SpringBootApplication. The…
nsafari
  • 93
  • 1
  • 3
  • 11
6
votes
3 answers

ASP.NET MVC routing and static data (ie. images, scripts, etc)

If I have a request for a resource in my ASP.NET MVC1 (or 2) web app for a static resource, say ... an image or a javascript file or a css file ... does the .NET framework try and see if the request matches the route list ... and eventually can't…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
5
votes
1 answer

Serving static resources in spring security - Allow access to all files in '/resources/public'

I can serve static resources perfectly fine with this setup however I have to define on a file by file basis the files which are allowed to be served. My current use case is anything located in the /resources/public/ directory should have allowed…
ConsultingEasy
  • 385
  • 2
  • 5
  • 11
5
votes
3 answers

Tomcat serving static resources on Spring MVC app

I'm building a Spring MVC application, and the frontController servlet is mapped in "/" intercepting all requests, I'd to be able to serve the static contents (.js,.css,.png...) from tomcat and not by Spring. My app structure is -webapp/ …
Rigoni
  • 302
  • 1
  • 5
  • 15
5
votes
6 answers

Chrome warning about static resource (css/gif/png/js)

When ever the web page is loaded i am getting warning in the debugger as Resource interpreted as stylesheet but transferred with MIME type text/plain. I am getting the above warning when the browser requests for js, css, gif and png files. Any…
Niger
  • 3,916
  • 5
  • 30
  • 30
4
votes
1 answer

Spring Boot shared web modules (jar file overlay?)

Before for web development with .war output, there was option for modularization war overlays http://maven.apache.org/plugins/maven-war-plugin/overlays.html Now with Spring Boot adopting jar packaging, how can make some shared web resources? That is…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
4
votes
2 answers

How to prevent against path traversal attacks when using Class.getResource()

I am looking to provide users of my website access to some static resources which are provided within a JAR file. I am unable to provide a list of all files which the user should be able to access, but I can ensure that they are all contained within…
Armand
  • 23,463
  • 20
  • 90
  • 119
3
votes
0 answers

Versioning Static Resources with Struts2 and Maven

I built a web application using Apache Struts2 and need to version static resources in order to enable caching inside browsers. I have all the resources checked into Subversion. Is there a solution possible, such that Maven checks-out the static…
VarunGupta
  • 6,127
  • 5
  • 27
  • 31
3
votes
1 answer

What would be a good strategy for a variable for prefixing a static resource?

We are scaling a website and we would like to plan for the future where we may want to host our images in a sub-domain (or perhaps even a separate domain altogether, e.g. a CDN). We currently reference images in our HTML/PHP code using the following…
Tom
  • 14,041
  • 16
  • 64
  • 80
3
votes
1 answer

Static web resources in a Maven Jar?

Is it possible to package static resources (like Css, Js or images) in a Jar for use in a webapplication (war)? I would like to seperate parts of the app into modules, but these don't only depend on Java classes, like controllers or models, but on…
Stefan
  • 12,108
  • 5
  • 47
  • 66
3
votes
2 answers

Java web app: Force browser to load static content (js, css, html) if deployed file changed

We're trying to force the client's browser to reload static files when they change. Currently, we have our build scripts automatically creating a new directory with the build timestamp and replace the content in the code to point to that…
redwulf
  • 1,317
  • 3
  • 13
  • 35
3
votes
1 answer

Getting static web context resources to work on both bookmarkable and non-bookmarkable Wicket pages

In a Wicket 1.4 app, I have some static CSS & JS resources under [project root]/WebContent/css and [project root]/WebContent/js respectively. My Wicket HTML files are in src/resources/fi/company/product/pages with corresponding Java classes in…
Jonik
  • 80,077
  • 70
  • 264
  • 372
1
2 3 4 5