via http://docs.djangoproject.com/en/dev/topics/http/sessions/
在view当中使用session的部分,最好改为
request.session.set_test_cookie()
if request.session.test_cookie_worked():
request.session.delete_test_cookie()
else:
return HttpResponse("Please enable cookies and try again.")
/**
* 要执行的算法,返回结果v
*/
public interface Computable<A, V> {
public V comput(final A arg);
}
/**
* 用于缓存数据
*/
public class Memoizer<A, V> implements Computable<A,