简体   繁体   English

检查标头是否存在令牌

[英]Checking header for token presence

Is it possible to check header for available token and other OAuth values with ActiveWeb ? 是否可以使用ActiveWeb检查标头中的可用令牌和其他OAuth值? Are there any examples repos ? 是否有任何示例存储库? Thank you. 谢谢。

There are no example repos, but you can access and set headers in controllers and filters: 没有示例存储库,但是您可以在控制器和过滤器中访问和设置标头:

http://javalite.github.io/activeweb/snapshot/org/javalite/activeweb/HttpSupport.html#header-java.lang.String- http://javalite.github.io/activeweb/snapshot/org/javalite/activeweb/HttpSupport.html#header-java.lang.String-

so: 所以:

header(String name,String value); // sets a header on response
headers();                        // gets all request headers
header(String name);              // returns a request header

Once you have a header, you can do whatever you need to. 有了标头后,您就可以执行所需的任何操作。

All controllers have these methods out of the box. 所有控制器均开箱即用。 If you need to do this in a filter, you would inherit this class: 如果需要在过滤器中执行此操作,则可以继承此类:

http://javalite.github.io/activeweb/snapshot/org/javalite/activeweb/controller_filters/HttpSupportFilter.html http://javalite.github.io/activeweb/snapshot/org/javalite/activeweb/controller_filters/HttpSupportFilter.html

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

相关问题
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM