- Posted
- Filed under spring framework
http://viralpatel.net/blogs/spring-mvc-multi-row-submit-java-list/
[정리]
ArrayList 형태의 DTO 또는 VO 객체를 생성후
그 beens 객체를 jstl foreach로 반복 해주면 됨 .
blog.visualp.com
<원문>http://nimba.tistory.com/m/post/457
@RequestMapping(value = "/servicelogo/{path1}/{file_name:.+}", method = RequestMethod.GET, produces = "application/octet-stream")
@ResponseBody
public FileSystemResource getPublicFile2(
@PathVariable("file_name") String fileName,
@PathVariable("path1") String path1,
HttpServletResponse response) throws Exception {
Map<String, Object> condition = new HashMap<String, Object>();
if(path1.equals("front")) {
condition.put("front_logo_img", fileName);
} else if(path1.equals("print")) {
condition.put("print_logo_img", fileName);
} else {
condition.put("front_logo_img", fileName);
}
String serverFileName = Admin2Service.getServiceLogoFileName(condition);
logger.debug("serverFileName= "+serverFileName);
if(serverFileName == null || serverFileName.length()==0 || serverFileName.equals("")) serverFileName = "temp.jpg";
String uploadDir = "/upload/serviceLogo";
File f = new File(messageBundle.getMessage("file.uploadPath") + uploadDir + "/" + serverFileName);
response.setContentType("application/octet-stream");
return new FileSystemResource(f);
}
<?php $thour=17 ?>
<script>
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
var hour = dateObj.getHours();
var minute = dateObj.getMinutes();
var second = dateObj.getSeconds();
//var end = new Date('13 Apr 2016 13:30:00');
var end = new Date(year,month-1,day,<?php echo $thour?>,0,0 );
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour *24;
var timer;
function showRemaining()
{
var now = new Date();
var distance = end - now;
if (distance < 0 ) {
// handle expiry here..
clearInterval( timer ); // stop the timer from continuing ..
location.reload();
//alert('Expired'); // alert a message that the timer has expired..
}
var days = Math.floor(distance / _day);
var hours = Math.floor( (distance % _day ) / _hour );
var minutes = Math.floor( (distance % _hour) / _minute );
var seconds = Math.floor( (distance % _minute) / _second );
var milliseconds = parseInt(distance % _second /10);
/*
var countdownElement = document.getElementById('timer');
countdownElement.innerHTML = days + 'd ' +
hours + 'h ' +
minutes + 'm ' +
seconds + 's ' +
milliseconds + 'ms';
*/
if(hours<10){
hours = "0" + hours;
}
if(minutes<10){
minutes = "0" + minutes;
}
if(seconds<10){
seconds = "0" + seconds;
}
if(milliseconds<10){
milliseconds = "0"+milliseconds;
}
var thour = document.getElementById('thour');
var tminute = document.getElementById('tminute');
var tsecond = document.getElementById('tsecond');
var tms = document.getElementById('tms');
thour.innerHTML = hours;
tminute.innerHTML=minutes;
tsecond.innerHTML=seconds;
tms.innerHTML=milliseconds;
}
timer = setInterval(showRemaining, 10);
</script>
<div id="timer">
<span id="thour"></span>
<span class="sp">:</span>
<span id="tminute"></span>
<span class="sp">:</span>
<span id="tsecond"></span>
<span class="sp">:</span>
<span id="tms"></span>
</div>
CENTOS 6.6 에 NGINX1.8 설치 해서 java 환경 세팅중
502 BAD GATEWay error 가 발생 한다.다음 2 명령어로 깔끔하게 해결 할 수 있다.
나와 같은 에러가 CentOS/RHEL 계열 OS에서 발생한다면 다음 두개의 명령으로 말끔히 해결!
setsebool -P httpd_can_network_connect 1
더욱더 견고하게! fix하고 싶다면...
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
shell> ctrl + z
- 현재 보던 창이 닫힌다.
shell> jobs
- 작업중인 목록이 보인다.
shell> fg
- 가장 최근에 편집한 파일이 열린다.
shell> fg [n]
- jobs 명령을 내렸을 때 보였던 작업번호를 치면, 해당 작업이 수행된다.
shell> kill %n
- n번 작업 삭제
I was trying to set up a reverse proxy for Atlassian Jira and Confluence by using nginx, connected to http://localhost:8080. This is the error I was getting in my logs:
2015/02/10 10:59:37 [crit] 21155#0: *12 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: a.b.c.d, server: x.y.z, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "x.y.z" 2015/02/10 10:59:38 [error] 21155#0: *15 no live upstreams while connecting to upstream, client: a.b.c.d, server: x.y.z, request: "GET / HTTP/1.1", upstream: "http://localhost/", host: "x.y.z"
Turns out it was just a SELinux issue. I’ve fixed the problem by issuing this command:
setsebool -P httpd_can_network_connect 1
If you want, you can even completely disable SELinux this way:
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
After installing vsftpd on CentOS 7 server, let us create a directory to store SSL certificates.
mkdir /etc/ssl/private
Then, create the certificate and key files using the following command:
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
You’ll be asked to enter the series of questions such as Country, State Code, Email address, Organization name etc. Enter the details one by one. Here is my sample output:
Generating a 1024 bit RSA private key ......++++++ .............++++++ writing new private key to '/etc/ssl/private/vsftpd.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:IN State or Province Name (full name) []:TN Locality Name (eg, city) [Default City]:Erode Organization Name (eg, company) [Default Company Ltd]:Unixmen Organizational Unit Name (eg, section) []:Technical Common Name (eg, your name or your server's hostname) []:server1.unixmen.local Email Address []:sk@unixmen.com
In the common name field, you can either use hostname or IP address of your vsftpd server.
Edit vsftpd configuration file /etc/vsftpd/vsftpd.conf,
vi /etc/vsftpd/vsftpd.conf
Add the following lines at the end:
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
Save and close the file. Restart vsftpd service.
systemctl restart vsftpd
Open Filezilla from your client system. Go to File -> Site Manager.
In the Site Manager window, select New Site.
Name your new site, or leave it as it is. In my case I name it as My local FTP. Enter the FTP server IP address, and select “Require explicit FTP over TLS” from the Encryption drop down box. In the Logon Type drop downbox, select Ask for password option, and enter your FTP user name. Finally click on the Connect button.
You’ll be asked to enter the ftp user password in the next screen.
Now, you”ll be asked to accept the certificate that is being used to make sure the server can be trusted. In the Certificate window, you may see the list of values which is entered during the certificate generation process. Click Ok to accept the certificate and establish the connection.
That’s it. Now you’ll be able to access your FTP server.
Note: if you keep getting the error “The data connection could not be established: EHOSTUNREACH – No route to host” after enabling SSL/TLS, disable iptables and try again.
That’s all for now. Cheers!