我需要停止网站上图像目录的目录列表.我正在为网站上的图像和javascripts配置cookieless域.我已经完成了CNAME配置,并在httpd.conf文件中添加了虚拟主机配置.但是,如果我直接访问这个无cookie域,它列出整个目录内容.如何解决这个问题呢?
<VirtualHost ipaddr:80>
ServerAdmin webmaster@site.com
ServerName imgs.site.com
ServerAlias www.imgs.site.com
DocumentRoot /usr/tomcat/webapps/site/images
<Directory /usr/tomcat/webapps/site/images>
Options -Indexes FollowSymLinks
AllowOverride none
</Directory>
CustomLog logs/imgs.site.com_access_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
ErrorLog logs/imgs.site.com_error_log
</VirtualHost>
<VirtualHost ipaddr:80>
ServerAdmin webmaster@site.com
ServerName imgs.site.com
ServerAlias www.imgs.site.com imgs.site.net
DocumentRoot /usr/tomcat/webapps/site/images
<Directory /usr/tomcat/webapps/site/images>
Options -Indexes FollowSymLinks
AllowOverride none
</Directory>
CustomLog logs/imgs.site.com_access_log "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
ErrorLog logs/imgs.site.com_error_log
</VirtualHost>
我有一个 html 页面,其中包含以下主重置 css。我将在 java 中将 html 代码作为字符串获取,我必须从中删除/替换/注释以下使用 java 的 css 代码。在删除/替换 css 下方时,我必须排除其他内联 css 样式。我尝试使用 StringUtils 类,但它不起作用。我怎么能在java中做到这一点?
<style type="text/css">
@charset "utf-8";
/* CSS Document */
/* Ver 1.0 Author*/
/* master reset */
a,abbr,acronym,address,applet,b,big,blockquote,body,button,caption,center,cite,code,dd,del,dfn,
dir,div,dl,dt,em,embed,fieldset,font,form,frame,h1,h2,h3,h4,h5,h6,hr,html,i,iframe,img,input,
ins,kbd,label,legend,li,menu,object,ol,option,p,pre,q,s,samp,select,small,span,strike,strong,
sub,sup,table,tbody,td,textarea,tfoot,th,thead,tr,tt,u,ul,var
{background:transparent;border:0;font-family:inherit;font-size:100%;font-style:inherit;
font-weight:inherit;margin:0;outline:0;padding:0;vertical-align:baseline;}
html {font-size:1em;overflow-y:scroll;}
body {background:white;color:black;line-height:1;}
a,ins {text-decoration:none;}
blockquote,q{quotes:none;quotes:"" "";}
blockquote:before,blockquote:after,q:before,q:after {content:"";content:none;}
caption,center,td,th {text-align:left;}
del {text-decoration:line-through;}
dir,menu,ol,ul {list-style:none;}
table {border-collapse:collapse;border-spacing:0;}
textarea {overflow-y:auto;}
</style>
Run Code Online (Sandbox Code Playgroud) 我想将日期从MM/YYYY转换为MM/DD/YYYY,我如何使用Java中的SimpleDateFormat来做到这一点?(注意:DD可以是该月的开始日期)