在我的spring-application中,我尝试设置一个cookie,然后重定向到读取cookie的页面.重定向到另一个网页有效,但设置cookie仅在IE9中失败.
Cookie cookie = MyCookieHandler.createCookie(parameters, domain);
response.addCookie(cookie);
Run Code Online (Sandbox Code Playgroud)
处理重定向购买设置ModelAndView
modelView = new ModelAndView("redirect:" + getCallback());
Run Code Online (Sandbox Code Playgroud)
正如我所说,在FF3 +,Chrome和IE7/IE8中工作正常.我的应用程序有什么问题?有什么建议?
我正在尝试使用不同的方法,具体取决于从哪个域发送请求。
例如
@RequestMapping(value = "/index.html", domain = "google.de", method = RequestMethod.GET)
public ModelAndView handleDeRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
}
@RequestMapping(value = "/index.html", domain = "google.com", method = RequestMethod.GET)
public ModelAndView handleComRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
}
Run Code Online (Sandbox Code Playgroud)
这两个域路由到相同的服务器和Web应用程序,但是我想根据需求来自哪个URL,在controller类中返回不同的modelAndView。
有任何想法吗?
干杯。
我尝试将文件大小为4GB的文件发布到REST API。
cURL不会上传具有该大小的文件,而是发布Content-Length:0的文件。
curl -v -i -d @"/work/large.png" -H "Transfer-Encoding: chunked" http://localhost:8080/files
* Adding handle: conn: 0x7fcafc00aa00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fcafc00aa00) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
* Trying localhost...
* Connected to localhost (localhost) port 8080 (#0)
> POST /files HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:8080
> Accept: */*
> Transfer-Encoding: chunked
> Authorization: bearer XXX.XXX.XXX …Run Code Online (Sandbox Code Playgroud) 是否有最佳实践如何提高spring webapps的性能?
我使用ehcache作为静态内容,尝试在我的应用程序结束时加载JavaScript,但应用程序运行不顺畅.对于一个简单的注册只有GET请求来映射url和initalize session和bean lastet超过7秒.
当然,你可以针对具体情况进行优化,但我想知道generell性能问题以及如何处理这些问题.
模式,最佳实践等在这里非常受欢迎.
我喜欢在我的 Tapestry 页面中呈现一个 reqeustParameter "id"。
就像是:
<span>${id}</span>
Run Code Online (Sandbox Code Playgroud)
如果我请求带有google.com?id=1它的页面应该呈现<span>1</span>应该是可能的,但找不到解决方案。
该文档建议在 Java 类中使用 @Property,但我无法导入它。--> http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html
谢谢
java ×3
spring ×3
cookies ×1
curl ×1
dns ×1
optimization ×1
parameters ×1
performance ×1
redirect ×1
shell ×1
spring-mvc ×1
tapestry ×1
url ×1