You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/07/24 09:33:05 UTC
svn commit: r424948 - in /myfaces/tobago/trunk/example/security/src/main:
java/org/apache/myfaces/tobago/example/security/Controller.java
webapp/public.jsp
Author: bommel
Date: Mon Jul 24 00:33:05 2006
New Revision: 424948
URL: http://svn.apache.org/viewvc?rev=424948&view=rev
Log:
example for secured methodbinding
Modified:
myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java
myfaces/tobago/trunk/example/security/src/main/webapp/public.jsp
Modified: myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java?rev=424948&r1=424947&r2=424948&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java (original)
+++ myfaces/tobago/trunk/example/security/src/main/java/org/apache/myfaces/tobago/example/security/Controller.java Mon Jul 24 00:33:05 2006
@@ -26,13 +26,17 @@
public String logout() {
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
- if (session != null){
+ if (session != null) {
session.invalidate();
}
return "logout";
}
- @RolesAllowed({ "admin", "guest"} )
+ @RolesAllowed({ "tobago-example-security" } )
public String doSomething() {
+ return null;
+ }
+
+ public String doSomethingElse() {
return null;
}
Modified: myfaces/tobago/trunk/example/security/src/main/webapp/public.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/security/src/main/webapp/public.jsp?rev=424948&r1=424947&r2=424948&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/security/src/main/webapp/public.jsp (original)
+++ myfaces/tobago/trunk/example/security/src/main/webapp/public.jsp Mon Jul 24 00:33:05 2006
@@ -21,7 +21,7 @@
<jsp:body>
<tc:panel>
<f:facet name="layout">
- <tc:gridLayout columns="*;100px;*" rows="fixed;*;fixed;*"/>
+ <tc:gridLayout columns="*;100px;*" rows="fixed;*;fixed;fixed;*"/>
</f:facet>
<tc:cell spanX="3">
@@ -30,9 +30,13 @@
<tc:cell spanX="3" />
- <tc:cell/>
+ <tc:button label="Testing unsecured methodbinding" action="#{controller.doSomethingElse}" />
<tc:button label="Good Login" link="/application/index.jsp"/>
+ <tc:button label="Testing secured methodbinding" action="#{controller.doSomething}" />
+ <tc:cell/>
+ <tc:messages/>
<tc:cell/>
+
<tc:cell spanX="3" />