diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-30 11:30:39 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-30 12:47:35 +0300 |
commit | fd3826abf42f69db546eff18d269e462843feb49 (patch) | |
tree | 2852b77e657e90061842bc2d99dad09b36cd4150 /server/src/com/vaadin/ui/LoginForm.java | |
parent | e71794ee177e309a4cba15ebd6b65d5950721dd7 (diff) | |
download | vaadin-framework-fd3826abf42f69db546eff18d269e462843feb49.tar.gz vaadin-framework-fd3826abf42f69db546eff18d269e462843feb49.zip |
Replace ApplicationResource with ConnectorResource (#9419)
Diffstat (limited to 'server/src/com/vaadin/ui/LoginForm.java')
-rw-r--r-- | server/src/com/vaadin/ui/LoginForm.java | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index 7715f08a6e..0d89fd19a3 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -25,7 +25,7 @@ import java.util.Iterator; import java.util.Map; import com.vaadin.Application; -import com.vaadin.server.ApplicationResource; +import com.vaadin.server.ConnectorResource; import com.vaadin.server.DownloadStream; import com.vaadin.server.RequestHandler; import com.vaadin.server.WrappedRequest; @@ -58,23 +58,7 @@ public class LoginForm extends CustomComponent { private Embedded iframe = new Embedded(); - private ApplicationResource loginPage = new ApplicationResource() { - - @Override - public Application getApplication() { - return LoginForm.this.getApplication(); - } - - @Override - public int getBufferSize() { - return getLoginHTML().length; - } - - @Override - public long getCacheTime() { - return -1; - } - + private ConnectorResource loginPage = new ConnectorResource() { @Override public String getFilename() { return "login"; @@ -82,8 +66,13 @@ public class LoginForm extends CustomComponent { @Override public DownloadStream getStream() { - return new DownloadStream(new ByteArrayInputStream(getLoginHTML()), - getMIMEType(), getFilename()); + byte[] loginHTML = getLoginHTML(); + DownloadStream downloadStream = new DownloadStream( + new ByteArrayInputStream(loginHTML), getMIMEType(), + getFilename()); + downloadStream.setBufferSize(loginHTML.length); + downloadStream.setCacheTime(-1); + return downloadStream; } @Override @@ -197,14 +186,12 @@ public class LoginForm extends CustomComponent { @Override public void attach() { super.attach(); - getApplication().addResource(loginPage); getApplication().addRequestHandler(requestHandler); iframe.setSource(loginPage); } @Override public void detach() { - getApplication().removeResource(loginPage); getApplication().removeRequestHandler(requestHandler); super.detach(); |