This is how it looked like in the end
public class SampleVaadinApplication extends VaadinApplication { private UriFragmentUtility fragmentUtility; private VerticalLayout layout; @Override public void init() { final Window mainWindow = new Window("Vaadin Cas Sample"); fragmentUtility = new UriFragmentUtility(); mainWindow.setSizeFull(); mainWindow.addComponent(fragmentUtility); layout = new VerticalLayout(); mainWindow.addComponent(layout); setMainWindow(mainWindow); } }
public void buttonClick(Button.ClickEvent event) { final String path = getURL().getPath(); if (!hasAnyRole("ROLE_DEFAULT_ACCESS")) { getMainWindow().open(new ExternalResource(path + "do-something/")); } else { fragmentUtility.setFragment("do-something"); } }
web.xml you just need to add this to be the wrapper (and of cos the spring tags ;) ).
<servlet> <servlet-name>vaadin-loader-with-cas</servlet-name> <servlet-class>hailu.vaadin.authentication.core.VaadinApplicationServlet</servlet-class> <init-param> <param-name>application</param-name> <param-value>hailu.vaadin.authentication.sample.SampleVaadinApplication</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>vaadin-loader-with-cas</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>
I have hosted it in git you can have a look at the sample to get your self up and running.
https://github.com/jasondevj/cas-integration-with-vaadin
I compile the core and the sample and obtain when push the Do Someting button:
ReplyDeleteState HTTP 404 - /cas/login
El recurso requerido (/cas/login) no está disponible.
Sorry for my previous problem, I didn't have the CAS service running at the same port with your default configuration ;) good work
ReplyDeletegreat that you got it working..
ReplyDeleteCould you please add a License to it. (preferably Apache/BSD). Until you do that nobody can safely use your example.
ReplyDeleteLicence file added. Now you can go ahead and do anything you like ;)
ReplyDeleteThe King Casino - Herzaman in the Aztec City
ReplyDeleteThe King 바카라 사이트 Casino in Aztec City is the place where you can find and play for real, real money. worrione.com Enjoy titanium metal trim a memorable stay at herzamanindir.com/ this one-of-a-kind casino