I need to convert relative image path (inside some css files) to absolute on the fly, using a java servlet filter.
What is 开发者_运维知识库the best way?
Create a Filter
that intercepts the path to the CSS file. In that filter, load the CSS file and use a regex to match the CSS attribute you need to modify, capture the URL part, and replace it with what you need. Then write the modified CSS file to the servlet's output stream.
Give the CSS Parser Project a look...
精彩评论