org.brutusin.demo.spring.GetDateAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rpc-demo Show documentation
Show all versions of rpc-demo Show documentation
Demo app for brutusin:rcp
The newest version!
package org.brutusin.demo.spring;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.brutusin.rpc.http.Cacheable;
import org.brutusin.rpc.http.SafeAction;
public class GetDateAction extends SafeAction {
private SimpleDateFormat dateFormat = new SimpleDateFormat();
@Override
public Cacheable execute(Void input) throws Exception {
return Cacheable.never(dateFormat.format(new Date()));
}
public void setDatePattern(String pattern) {
dateFormat = new SimpleDateFormat(pattern);
}
}