- yum update --security
Reference: https://access.redhat.com/solutions/10021
My online tech scrapbook where I keep my notes in case I need to look them up later
#!/bin/sh
# chkconfig: 35 90 10
start(){
# start the service here
}
# --- snipped ---
|
keytool -genkey -alias tomcat -keyalg RSA
|
ln -sf /usr/share/zoneinfo/Singapore /etc/localtime
|
public class SimpleCorsResponseFilter implements ContainerResponseFilter {
@Override
public ContainerResponse filter(ContainerRequest req, ContainerResponse resp) {
String requestOrigin = req.getHeaderValue("Origin");
if (requestOrigin == null) {
return resp;
}
else{
MultivaluedMap<String, Object> headers = resp.getHttpHeaders();
headers.add("Access-Control-Allow-Origin", requestOrigin);
headers.add("Access-Control-Allow-Credentials", "true");
headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
headers.add("Access-Control-Allow-Headers", "Content-Type");
return resp;
}
}
}
|
public class SimpleCorsResponseFilter implements ContainerResponseFilter {
@Override
public ContainerResponse filter(ContainerRequest req, ContainerResponse resp) {
MultivaluedMap<String, Object> headers = resp.getHttpHeaders();
headers.add("Access-Control-Allow-Origin", "*");
headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
headers.add("Access-Control-Allow-Headers", "Content-Type");
return resp;
}
}
|
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>xxx.yyy.zzz.SimpleCorsResponseFilter</param-value>
</init-param>
|