简体   繁体   English

JSF2 f:ajax ajax 请求没有查询字符串?

[英]JSF2 f:ajax ajax requests without query string?

Right now on each f:ajax (or a4j:ajax) request I'm making, the POST includes the query string which I don't want.现在,在我发出的每个 f:ajax(或 a4j:ajax)请求上,POST 都包含我不想要的查询字符串。 Is there a way to not have it pass them on?有没有办法让它不传递? I don't understand why it does this anyways.我不明白为什么它会这样做。

Example: Request page示例:请求页面

GET /mypage.xhtml?zipcode=10101获取 /mypage.xhtml?zipcode=10101

Then any ajax calls fired by f:ajax on that page does a post like so:然后在该页面上由 f:ajax 触发的任何 ajax 调用都会发布如下帖子:

POST /mypage.xhtml?zipcode=10101发布 /mypage.xhtml?zipcode=10101

This causes a lot of problems because if i changed the form element for zip on the page with ajax, any other ajax post will actually cause the original zip code passed into the page to get re-read and reset on my backing bean. This causes a lot of problems because if i changed the form element for zip on the page with ajax, any other ajax post will actually cause the original zip code passed into the page to get re-read and reset on my backing bean.

I really want to tell all f:ajax calls to STOP putting the request parameters in the URL, like so:我真的很想告诉所有 f:ajax 调用 STOP 将请求参数放入 URL 中,如下所示:

POST /mypage.xhtml (regardless of what request paremteres were on the original page GET). POST /mypage.xhtml(不管原始页面 GET 上的请求参数是什么)。

This may happen if you have view params defined.如果您定义了视图参数,则可能会发生这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM