Add support for injecting cookies in the bridje-web
Closed this issue · 1 comments
gilbva commented
An annotation for injecting the cookies is needed, if the user made a request to the server with cookies
myCookie=somevalue
The user can specify that he whants the cookie injected from the request into the component he choose like this.
@Component(scope = WebRequestScope.class)
public MyController
{
@Cookie
private String myCookie;
//Or with the specific name.
@Cookie("myCookie")
private String otherCookie;
}
For now is only required that the framework handles native types like numers, dates, and strings. More complex objects mappings will be provided later with a new feature.
Important
The Cookie annotation must also specify the path, and expiration data like this
@Cookie("myCookie", path="/", exp=-1)
The framework must check when ever the cooke change his value during the request and if that the case the cookie must be updated back to the client. The cookie will be left untouch if it has the same value that the client send.
gilbva commented
Done