Skip to content

Commit e92340f

Browse files
committed
Revert "Removed deprecated code since 1.3"
This reverts commit ac0e9b9.
1 parent e001fb5 commit e92340f

File tree

35 files changed

+312
-47
lines changed

35 files changed

+312
-47
lines changed

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/OldDelegatingAsyncCallback.java

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
* {@code AsyncCallback} implementation wrapping another {@link AsyncCallback} object used by a
2828
* {@link ClientActionHandler} to delegate the execution result.
2929
*
30-
* @deprecated Since 1.4.
31-
*
3230
* @param <A> the {@link TypedAction} type.
3331
* @param <R> the result type for this action.
3432
*/

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/AbstractClientActionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* Simple abstract super-class for {@link ClientActionHandler} implementations that forces the action class to be passed
2121
* in as a constructor to the handler.
2222
*
23-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.AbstractRpcInterceptor}
23+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.AbstractRpcInterceptor}
2424
*
2525
* @param <A> The action type.
2626
* @param <R> The result type.

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/ClientActionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
* </code>
103103
* </pre>
104104
*
105-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.client.interceptor.Interceptor}
105+
* @deprecated use {@link com.gwtplatform.dispatch.client.interceptor.Interceptor}
106106
*
107107
* @param <A> The type of the action.
108108
* @param <R> The type of the result.

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/ClientActionHandlerMismatchException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* A provider was registered to provide a client-side action handler for an action, but this action was not the same
2222
* action as specified by {@link ClientActionHandler#getActionType()}.
2323
*
24-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.client.interceptor.InterceptorMismatchException}
24+
* @deprecated use {@link com.gwtplatform.dispatch.client.interceptor.InterceptorMismatchException}
2525
*/
2626
@Deprecated
2727
public class ClientActionHandlerMismatchException extends RuntimeException {

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/ClientActionHandlerRegistry.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* {@link com.gwtplatform.dispatch.rest.shared.RestDispatch RestDispatch} implementation to find client-side action
2525
* handlers.
2626
*
27-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.RpcInterceptorRegistry}
27+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.RpcInterceptorRegistry}
2828
*/
2929
@Deprecated
3030
public interface ClientActionHandlerRegistry {

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/DefaultClientActionHandlerRegistry.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* </code>
6868
* </pre>
6969
*
70-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.DefaultRpcInterceptorRegistry}
70+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.DefaultRpcInterceptorRegistry}
7171
*/
7272
@Deprecated
7373
public class DefaultClientActionHandlerRegistry implements ClientActionHandlerRegistry {

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/ExecuteCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* The interface that {@link ClientActionHandler}s use to send the action to execute to the server.
2424
*
25-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.client.interceptor.ExecuteCommand}
25+
* @deprecated use {@link com.gwtplatform.dispatch.client.interceptor.ExecuteCommand}
2626
*
2727
* @param <A> The action type.
2828
* @param <R> The result type.

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/UndoCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/**
2323
* The interface that {@link ClientActionHandler}s use to send the action to undo to the server.
2424
*
25-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.client.interceptor.UndoCommand}
25+
* @deprecated use {@link com.gwtplatform.dispatch.client.interceptor.UndoCommand}
2626
*
2727
* @param <A> The action type.
2828
* @param <R> The result type.

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/caching/AbstractCachingClientActionHandler.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
* Flexibility of cache implementation to support custom caching
4949
* </li>
5050
* </ol>
51-
* @deprecated Since 1.4.
52-
* Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.AbstractCachingRpcInterceptor}
51+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.AbstractCachingRpcInterceptor}
5352
*
5453
* @param <A> The type of the action.
5554
* @param <R> The type of the result.

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/caching/ActionCachingHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* Default implementation of {@link AbstractCachingClientActionHandler}. It supports action caching
2121
*
22-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.CachingInterceptor}
22+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.CachingInterceptor}
2323
*
2424
* @param <A> The type of the action.
2525
* @param <R> The type of the result.

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/caching/Cache.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* Interface for client side caching.
2121
*
22-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.Cache}
22+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.Cache}
2323
*/
2424
@Deprecated
2525
public interface Cache {

gwtp-core/gwtp-dispatch-common-client/src/main/java/com/gwtplatform/dispatch/client/actionhandler/caching/DefaultCacheImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* Default Implementation for {@link Cache}, backed by an {@link java.util.HashMap}.
2525
*
26-
* @deprecated Since 1.4. Use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.DefaultCacheImpl}
26+
* @deprecated use {@link com.gwtplatform.dispatch.rpc.client.interceptor.caching.DefaultCacheImpl}
2727
*/
2828
@Deprecated
2929
public class DefaultCacheImpl implements Cache {

gwtp-core/gwtp-dispatch-rest/src/main/java/com/gwtplatform/dispatch/rest/client/gin/BaseRestDispatchModuleBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public B requestTimeout(int timeoutMs) {
110110
/**
111111
* Specify the XSRF token header name.
112112
*
113-
* @deprecated Since 1.4. Use {@link #xsrfTokenHeaderName(String)}
113+
* @deprecated See {@link #xsrfTokenHeaderName(String)}
114114
*/
115115
@Deprecated
116116
public B xcsrfTokenHeaderName(String xsrfTokenHeaderName) {

gwtp-core/gwtp-dispatch-rpc-client/src/main/java/com/gwtplatform/dispatch/rpc/client/RpcDispatchExecuteCall.java

-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ public void onSuccess(R result) {
115115
));
116116
}
117117

118-
/**
119-
* @deprecated Since 1.4.
120-
*/
121118
@Deprecated
122119
private DispatchRequest findClientActionHandlerRequest() {
123120
DispatchRequest request = null;

gwtp-core/gwtp-dispatch-rpc-client/src/main/java/com/gwtplatform/dispatch/rpc/client/RpcDispatchUndoCall.java

-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ public void onSuccess(Void nothing) {
114114
));
115115
}
116116

117-
/**
118-
* @deprecated Since 1.4.
119-
*/
120117
@Deprecated
121118
private DispatchRequest findClientActionHandlerRequest() {
122119
DispatchRequest request = null;

gwtp-core/gwtp-dispatch-rpc-client/src/main/java/com/gwtplatform/dispatch/rpc/client/gin/PhoneGapDispatchAsyncModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public PhoneGapDispatchAsyncModule build() {
3939
}
4040

4141
/**
42-
* @deprecated Since 1.4. Use the PhoneGapDispatchAsyncModule.Builder class
42+
* @deprecated Use the PhoneGapDispatchAsyncModule.Builder class
4343
*/
4444
@Deprecated
4545
public PhoneGapDispatchAsyncModule() {

gwtp-core/gwtp-dispatch-rpc-client/src/main/java/com/gwtplatform/dispatch/rpc/client/gin/RpcDispatchAsyncModule.java

-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public static class Builder extends AbstractDispatchAsyncModule.Builder<Builder>
5858
private Class<? extends RpcDispatchHooks> dispatchHooks = DefaultRpcDispatchHooks.class;
5959
private Class<? extends RpcInterceptorRegistry> interceptorRegistry = DefaultRpcInterceptorRegistry.class;
6060

61-
/**
62-
* @deprecated Since 1.4.
63-
*/
6461
@Deprecated
6562
private Class<? extends ClientActionHandlerRegistry> clientActionHandlerRegistryType =
6663
DefaultClientActionHandlerRegistry.class;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright 2011 ArcBees Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package com.gwtplatform.dispatch.rpc.server.guice;
18+
19+
import javax.inject.Inject;
20+
import javax.inject.Provider;
21+
import javax.inject.Singleton;
22+
import javax.servlet.http.HttpSession;
23+
24+
import com.gwtplatform.dispatch.rpc.server.AbstractHttpSessionSecurityCookieFilter;
25+
import com.gwtplatform.dispatch.shared.SecurityCookie;
26+
27+
/**
28+
* This filter will automatically inject a security cookie inside the request the first time the page is loaded. This
29+
* security cookie is based on the {@link HttpSession} and will only work if the session is enabled. To setup this
30+
* filter, add the following line at before any other {@code serve} call in your own
31+
* {@link com.google.inject.servlet.ServletModule#configureServlets}:
32+
* <p/>
33+
* <pre>
34+
* filter(&quot;*.jsp&quot;).through(HttpSessionSecurityCookieFilter.class);
35+
* </pre>
36+
* <p/>
37+
* You also have to use a {@code .jsp} file instead of a {@code .html} as your main GWT file.
38+
*
39+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.guice.RandomSecurityCookieFilter}.
40+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
41+
*/
42+
@Deprecated
43+
@Singleton
44+
public class HttpSessionSecurityCookieFilter extends AbstractHttpSessionSecurityCookieFilter {
45+
46+
private final Provider<HttpSession> session;
47+
48+
@Inject
49+
HttpSessionSecurityCookieFilter(@SecurityCookie String securityCookieName, Provider<HttpSession> session) {
50+
super(securityCookieName);
51+
this.session = session;
52+
}
53+
54+
@Override
55+
protected HttpSession getSession() {
56+
return session.get();
57+
}
58+
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2011 ArcBees Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package com.gwtplatform.dispatch.rpc.server.spring;
18+
19+
import javax.servlet.http.HttpSession;
20+
21+
import org.springframework.web.context.request.RequestContextHolder;
22+
import org.springframework.web.context.request.ServletRequestAttributes;
23+
24+
import com.gwtplatform.dispatch.rpc.server.AbstractHttpSessionSecurityCookieFilter;
25+
26+
/**
27+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.spring.RandomSecurityCookieFilter}.
28+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
29+
*/
30+
@Deprecated
31+
public class HttpSessionSecurityCookieFilter extends AbstractHttpSessionSecurityCookieFilter {
32+
public HttpSessionSecurityCookieFilter(String securityCookieName) {
33+
super(securityCookieName);
34+
}
35+
36+
@Override
37+
protected HttpSession getSession() {
38+
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getSession();
39+
}
40+
}

gwtp-core/gwtp-dispatch-rpc-server-spring/src/main/java/com/gwtplatform/dispatch/rpc/server/spring/configuration/DefaultModule.java

+7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
import org.springframework.context.annotation.Bean;
2020

21+
import com.gwtplatform.dispatch.rpc.server.AbstractHttpSessionSecurityCookieFilter;
2122
import com.gwtplatform.dispatch.rpc.server.RequestProvider;
23+
import com.gwtplatform.dispatch.rpc.server.spring.HttpSessionSecurityCookieFilter;
2224
import com.gwtplatform.dispatch.rpc.server.spring.request.DefaultRequestProvider;
2325

2426
/**
@@ -32,6 +34,11 @@ String getSecurityCookieName() {
3234
return securityCookieName;
3335
}
3436

37+
@Bean
38+
AbstractHttpSessionSecurityCookieFilter getCookieFilter() {
39+
return new HttpSessionSecurityCookieFilter(getSecurityCookieName());
40+
}
41+
3542
@Bean
3643
RequestProvider getRequestProvider() {
3744
return new DefaultRequestProvider();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2011 ArcBees Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package com.gwtplatform.dispatch.rpc.server;
18+
19+
import java.io.IOException;
20+
21+
import javax.servlet.Filter;
22+
import javax.servlet.FilterChain;
23+
import javax.servlet.FilterConfig;
24+
import javax.servlet.ServletException;
25+
import javax.servlet.ServletRequest;
26+
import javax.servlet.ServletResponse;
27+
import javax.servlet.http.Cookie;
28+
import javax.servlet.http.HttpServletRequest;
29+
import javax.servlet.http.HttpServletResponse;
30+
import javax.servlet.http.HttpSession;
31+
32+
/**
33+
* This filter will automatically inject a security cookie inside the request the first time the page is loaded. This
34+
* security cookie is based on the {@link HttpSession} and will only work if the session is enabled. To setup this
35+
* filter, add the following line at before any other {@code serve} call in your own
36+
* {@link com.google.inject.servlet.ServletModule#configureServlets}:
37+
* <p/>
38+
* <pre>
39+
* filter(&quot;*.jsp&quot;).through(HttpSessionSecurityCookieFilter.class);
40+
* </pre>
41+
* <p/>
42+
* You also have to use a {@code .jsp} file instead of a {@code .html} as your main GWT file.
43+
*
44+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.AbstractRandomSecurityCookieFilter}.
45+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
46+
*/
47+
@Deprecated
48+
public abstract class AbstractHttpSessionSecurityCookieFilter implements Filter {
49+
50+
private final String securityCookieName;
51+
52+
protected AbstractHttpSessionSecurityCookieFilter(String securityCookieName) {
53+
this.securityCookieName = securityCookieName;
54+
}
55+
56+
public void destroy() {
57+
}
58+
59+
protected abstract HttpSession getSession();
60+
61+
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
62+
ServletException {
63+
64+
if (request instanceof HttpServletRequest) {
65+
HttpServletResponse httpResponse = (HttpServletResponse) response;
66+
Cookie securityCookie = new Cookie(securityCookieName, getSession().getId());
67+
securityCookie.setMaxAge(-1);
68+
securityCookie.setPath("/");
69+
httpResponse.addCookie(securityCookie);
70+
}
71+
chain.doFilter(request, response);
72+
}
73+
74+
public void init(FilterConfig filterConfig) throws ServletException {
75+
}
76+
}

gwtp-core/gwtp-mvp-client/src/main/java/com/gwtplatform/mvp/client/HasPopupSlot.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public interface HasPopupSlot {
5656
* @param child The popup child, a {@link PresenterWidget}.
5757
* @param center - has no affect.
5858
* @see #addToPopupSlot(PresenterWidget)
59-
* @deprecated - Since 1.4. Use {@link #addToPopupSlot(PresenterWidget)} instead. Center no longer as any affect.
59+
* @deprecated - Use {@link #addToPopupSlot(PresenterWidget)} instead. Center no longer as any affect.
6060
*/
6161
@Deprecated
6262
void addToPopupSlot(final PresenterWidget<? extends PopupView> child, boolean center);

gwtp-core/gwtp-mvp-client/src/main/java/com/gwtplatform/mvp/client/PopupView.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,16 @@ public interface PopupView extends View {
8585
*
8686
* @param left The left position of the top-left corner (in pixels).
8787
* @param top The top position of the top-left corner (in pixels).
88-
* @deprecated since 1.4. Use a {@link com.gwtplatform.mvp.client.view.PopupPositioner} instead.
88+
* @deprecated use a {@link com.gwtplatform.mvp.client.view.PopupPositioner} instead.
8989
*/
9090
@Deprecated
9191
void setPosition(int left, int top);
9292

9393
/**
9494
* This method does nothing.
95-
* @deprecated since 1.4. Use a {@link com.gwtplatform.mvp.client.view.PopupPositioner} instead.
95+
* @deprecated use a {@link com.gwtplatform.mvp.client.view.PopupPositioner} instead.
9696
*/
9797
@Deprecated
9898
void center();
99+
99100
}

0 commit comments

Comments
 (0)