Browse files

spring security tablibs added, header displays content based on user …

…authentication
  • Loading branch information...
1 parent 0d06ee4 commit b136a0b1fdd4b4a5d0da76952bfbaf9130b38ef1 MrowkaM committed May 3, 2012
Showing with 348 additions and 317 deletions.
  1. +18 −0 nb-configuration.xml
  2. +318 −313 pom.xml
  3. +1 −0 src/main/webapp/WEB-INF/applicationContext-security.xml
  4. +11 −4 src/main/webapp/layouts/header.jsp
View
18 nb-configuration.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-shared-configuration>
+ <!--
+This file contains additional configuration written by modules in the NetBeans IDE.
+The configuration is intended to be shared among all the users of project and
+therefore it is assumed to be part of version control checkout.
+Without this configuration present, some functionality in the IDE may be limited or fail altogether.
+-->
+ <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
+ <!--
+Properties that influence various parts of the IDE, especially code formatting and the like.
+You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
+That way multiple projects can share the same settings (useful for formatting rules for example).
+Any value defined here will override the pom.xml file value but is only applicable to the current project.
+-->
+ <org-netbeans-modules-html-editor-lib.default-html-public-id>HTML5</org-netbeans-modules-html-editor-lib.default-html-public-id>
+ </properties>
+</project-shared-configuration>
View
631 pom.xml
@@ -1,168 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
<!-- The Basics -->
- <groupId>pl.thebet</groupId>
- <artifactId>thebet</artifactId>
- <version>thebet</version>
- <packaging>war</packaging>
- <name>bitethebet</name>
+ <groupId>pl.thebet</groupId>
+ <artifactId>thebet</artifactId>
+ <version>thebet</version>
+ <packaging>war</packaging>
+ <name>bitethebet</name>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <downloadSources>true</downloadSources>
- <gae.version>1.6.3</gae.version>
- <gae.runtime>1.6.3</gae.runtime>
- <maven.gae.plugin.version>0.9.2</maven.gae.plugin.version>
- <gae.application.version>test</gae.application.version>
- <datanucleus.version>1.1.5</datanucleus.version>
- <rebel.home>${env.REBEL_HOME}</rebel.home>
- <slf4j.version>1.6.4</slf4j.version>
- <springframework.version>3.1.0.RELEASE</springframework.version>
- <tiles.version>2.2.2</tiles.version>
- </properties>
- <dependencies>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <downloadSources>true</downloadSources>
+ <gae.version>1.6.3</gae.version>
+ <gae.runtime>1.6.3</gae.runtime>
+ <maven.gae.plugin.version>0.9.2</maven.gae.plugin.version>
+ <gae.application.version>test</gae.application.version>
+ <datanucleus.version>1.1.5</datanucleus.version>
+ <rebel.home>${env.REBEL_HOME}</rebel.home>
+ <slf4j.version>1.6.4</slf4j.version>
+ <springframework.version>3.1.0.RELEASE</springframework.version>
+ <tiles.version>2.2.2</tiles.version>
+ </properties>
+ <dependencies>
<!-- Google App Engine -->
- <dependency>
- <groupId>net.kindleit</groupId>
- <artifactId>gae-runtime</artifactId>
- <version>${gae.runtime}</version>
- <type>pom</type>
- </dependency>
+ <dependency>
+ <groupId>net.kindleit</groupId>
+ <artifactId>gae-runtime</artifactId>
+ <version>${gae.runtime}</version>
+ <type>pom</type>
+ </dependency>
<!--END Google App Engine -->
<!-- GAE-TESTING libraries for local testing as described here: http://code.google.com/appengine/docs/java/howto/unittesting.html -->
- <dependency>
- <groupId>com.google.appengine</groupId>
- <artifactId>appengine-api-labs</artifactId>
- <version>${gae.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.appengine</groupId>
- <artifactId>appengine-api-stubs</artifactId>
- <version>${gae.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.appengine</groupId>
- <artifactId>appengine-testing</artifactId>
- <version>${gae.version}</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>com.google.appengine</groupId>
+ <artifactId>appengine-api-labs</artifactId>
+ <version>${gae.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.appengine</groupId>
+ <artifactId>appengine-api-stubs</artifactId>
+ <version>${gae.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.appengine</groupId>
+ <artifactId>appengine-testing</artifactId>
+ <version>${gae.version}</version>
+ <scope>test</scope>
+ </dependency>
<!--END GAE-TESTING -->
<!-- DATABASE API -->
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-core</artifactId>
- <version>${datanucleus.version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>javax.jdo</groupId>
- <artifactId>jdo2-api</artifactId>
- <version>2.3-eb</version>
- <exclusions>
- <exclusion>
- <groupId>javax.transaction</groupId>
- <artifactId>transaction-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-core</artifactId>
+ <version>${datanucleus.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.jdo</groupId>
+ <artifactId>jdo2-api</artifactId>
+ <version>2.3-eb</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>transaction-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!--END DATABASE API -->
<!-- SPRING -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.6.12</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aspects</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- <version>${springframework.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-web</artifactId>
- <version>${springframework.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.12</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aspects</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-config</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-web</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-taglibs</artifactId>
+ <version>${springframework.version}</version>
+ </dependency>
<!-- for @Configuration-->
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>2.2.2</version>
- </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <version>2.2.2</version>
+ </dependency>
<!-- END SPRING -->
<!-- WEB TOOLS -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${tiles.version}</version>
<scope>compile</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${tiles.version}</version>
@@ -171,203 +176,203 @@
<!--END WEB TOOLS -->
<!-- Logging -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
<!--END Logging -->
<!-- Testing -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
<!--END Testing -->
- </dependencies>
+ </dependencies>
- <build>
- <finalName>${project.artifactId}-${project.version}</finalName>
- <plugins>
+ <build>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <plugins>
<!-- GAE PLUGINS -->
- <plugin>
+ <plugin>
<!-- This plug-in "enhances" your domain model objects (i.e. makes them
persistent for datanucleus) -->
- <groupId>org.datanucleus</groupId>
- <artifactId>maven-datanucleus-plugin</artifactId>
- <version>1.1.4</version>
- <configuration>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>maven-datanucleus-plugin</artifactId>
+ <version>1.1.4</version>
+ <configuration>
<!-- Make sure this path contains your persistent classes! -->
- <mappingIncludes>**/model/*.class</mappingIncludes>
- <verbose>true</verbose>
- <enhancerName>ASM</enhancerName>
- <api>JDO</api>
- </configuration>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>enhance</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-core</artifactId>
- <version>${datanucleus.version}</version>
- <exclusions>
- <exclusion>
- <groupId>javax.transaction</groupId>
- <artifactId>transaction-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-rdbms</artifactId>
- <version>${datanucleus.version}</version>
- </dependency>
- <dependency>
- <groupId>org.datanucleus</groupId>
- <artifactId>datanucleus-enhancer</artifactId>
- <version>1.1.4</version>
- </dependency>
- <dependency>
- <groupId>javax.jdo</groupId>
- <artifactId>jdo2-api</artifactId>
- <version>2.3-ec</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
+ <mappingIncludes>**/model/*.class</mappingIncludes>
+ <verbose>true</verbose>
+ <enhancerName>ASM</enhancerName>
+ <api>JDO</api>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>enhance</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-core</artifactId>
+ <version>${datanucleus.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>transaction-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-rdbms</artifactId>
+ <version>${datanucleus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.datanucleus</groupId>
+ <artifactId>datanucleus-enhancer</artifactId>
+ <version>1.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.jdo</groupId>
+ <artifactId>jdo2-api</artifactId>
+ <version>2.3-ec</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
<!-- The actual maven-gae-plugin. Type "mvn gae:run" to run project,
"mvn gae:deploy" to upload to GAE. -->
- <groupId>net.kindleit</groupId>
- <artifactId>maven-gae-plugin</artifactId>
- <version>${maven.gae.plugin.version}</version>
- <configuration>
- <jvmFlags>
- <jvmFlag>-Xdebug</jvmFlag>
- <jvmFlag>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8077</jvmFlag>
- <jvmFlag>-Dmail.log_mail_level=WARNING</jvmFlag>
- <jvmFlag>-Dmail.log_mail_body=true</jvmFlag>
- </jvmFlags>
- <severity>0</severity>
- <serverId>${google.app.id}</serverId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>unpack</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>net.kindleit</groupId>
- <artifactId>gae-runtime</artifactId>
- <version>${gae.runtime}</version>
- <type>pom</type>
- </dependency>
- </dependencies>
- </plugin>
+ <groupId>net.kindleit</groupId>
+ <artifactId>maven-gae-plugin</artifactId>
+ <version>${maven.gae.plugin.version}</version>
+ <configuration>
+ <jvmFlags>
+ <jvmFlag>-Xdebug</jvmFlag>
+ <jvmFlag>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8077</jvmFlag>
+ <jvmFlag>-Dmail.log_mail_level=WARNING</jvmFlag>
+ <jvmFlag>-Dmail.log_mail_body=true</jvmFlag>
+ </jvmFlags>
+ <severity>0</severity>
+ <serverId>${google.app.id}</serverId>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>net.kindleit</groupId>
+ <artifactId>gae-runtime</artifactId>
+ <version>${gae.runtime}</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </plugin>
<!--END GAE PLUGINS -->
<!-- MAVEN COMPILE PLUGINS -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.1.1</version>
- <configuration>
- <webResources>
- <resource>
- <targetPath>WEB-INF</targetPath>
- <directory>src/main/webapp/WEB-INF</directory>
- <filtering>true</filtering>
- <includes>
- <include>*.xml</include>
- </includes>
- </resource>
- </webResources>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <targetPath>WEB-INF</targetPath>
+ <directory>src/main/webapp/WEB-INF</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>*.xml</include>
+ </includes>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
<!--END MAVEN COMPILE PLUGINS -->
- </plugins>
- </build>
+ </plugins>
+ </build>
- <profiles>
- <profile>
- <id>jrebel</id>
- <build>
- <plugins>
- <plugin>
- <groupId>net.kindleit</groupId>
- <artifactId>maven-gae-plugin</artifactId>
- <version>${maven.gae.plugin.version}</version>
- <configuration>
- <jvmFlags>
- <jvmFlag>-Xdebug</jvmFlag>
- <jvmFlag>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8077</jvmFlag>
- <jvmFlag>-Dmail.log_mail_level=WARNING</jvmFlag>
- <jvmFlag>-Dmail.log_mail_body=true</jvmFlag>
- <jvmFlag>-javaagent:${rebel.home}\jrebel.jar</jvmFlag>
- <jvmFlag>-noverify</jvmFlag>
- </jvmFlags>
- <severity>0</severity>
- <serverId>${google.app.id}</serverId>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>unpack</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>net.kindleit</groupId>
- <artifactId>gae-runtime</artifactId>
- <version>${gae.runtime}</version>
- <type>pom</type>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.zeroturnaround</groupId>
- <artifactId>jrebel-maven-plugin</artifactId>
- <version>1.1.0</version>
- <executions>
- <execution>
- <id>generate-rebel-xml</id>
- <phase>process-resources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <profiles>
+ <profile>
+ <id>jrebel</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>net.kindleit</groupId>
+ <artifactId>maven-gae-plugin</artifactId>
+ <version>${maven.gae.plugin.version}</version>
+ <configuration>
+ <jvmFlags>
+ <jvmFlag>-Xdebug</jvmFlag>
+ <jvmFlag>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8077</jvmFlag>
+ <jvmFlag>-Dmail.log_mail_level=WARNING</jvmFlag>
+ <jvmFlag>-Dmail.log_mail_body=true</jvmFlag>
+ <jvmFlag>-javaagent:${rebel.home}\jrebel.jar</jvmFlag>
+ <jvmFlag>-noverify</jvmFlag>
+ </jvmFlags>
+ <severity>0</severity>
+ <serverId>${google.app.id}</serverId>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>net.kindleit</groupId>
+ <artifactId>gae-runtime</artifactId>
+ <version>${gae.runtime}</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <version>1.1.0</version>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- </profiles>
+ </profiles>
</project>
View
1 src/main/webapp/WEB-INF/applicationContext-security.xml
@@ -21,5 +21,6 @@
<authentication-manager>
<authentication-provider user-service-ref='userAccountDetailsService' />
</authentication-manager>
+ <beans:bean class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler"/>
</beans:beans>
View
15 src/main/webapp/layouts/header.jsp
@@ -1,3 +1,5 @@
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
@@ -13,10 +15,15 @@
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
- <p class="navbar-text pull-right">Logged in as <a href="#">username</a></p>
- <p class="navbar-text pull-right"><a class="btn btn-success" href="/login.html" style="margin-left: 30px;">Login </a></p>
- <p class="navbar-text pull-right"><a class="btn" href="/register.html">Sign Up</a></p>
- <p class="navbar-text pull-right"><a href="j_spring_security_logout" > Logout</a></p>
+
+ <sec:authorize access="isAuthenticated()">
+ <p class="navbar-text pull-right"><a class="btn" href="j_spring_security_logout" style="margin-left: 30px;"> Logout</a></p>
+ <p class="navbar-text pull-right">Logged in as <a href="#"><sec:authentication property="principal.username" /></a></p>
+ </sec:authorize>
+ <sec:authorize access="isAnonymous()">
+ <p class="navbar-text pull-right"><a class="btn btn-success" href="/login.html" style="margin-left: 30px;">Login </a></p>
+ <p class="navbar-text pull-right"><a class="btn" href="/register.html">Sign Up</a></p>
+ </sec:authorize>
</div><!--/.nav-collapse -->
</div>
</div>

0 comments on commit b136a0b

Please sign in to comment.