0

私はフィルターの概念を読んでいましたが、JSF アプリケーションで AJAX 要求に対してフィルターが呼び出されるかどうか疑問に思っています。

フィルター マッピングは次のとおりです。

<filter-mapping>
    <filter-name>ModuleSecurityFilter</filter-name>
    <url-pattern>/protected/*</url-pattern>
</filter-mapping>
4

1 に答える 1

2

Yes.The filter will be invoked as long as the submits from your JSF views are to the URL matching the filter's url-pattern. In your case if the submit is for any "/protected/anything"

With JSF1.2, all your command actions (commandbutton/commandlinks) will be forced to POST submit the form data to the same view.

Say your current view is /protected/firstview.jsf , then all your <h:commandButton /> , <h:commandLink />, <a4j:commandButton /> <a4j:commandLink /> , <a4j:support action="" /> will be submitting a POST reqest to the same view /protected/firstview.jsf. So all therequests will have to go through the filter.

于 2012-05-29T04:28:09.633 に答える