You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Brian Lavender <br...@brie.com> on 2012/01/15 06:57:36 UTC

Wicket spring security sample app

Does someone have a sample of the current spring security with Wicket auth-roles?
One that I can do the following.

mvn jetty:run

and see it run? 

brian
-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by Brian Lavender <br...@brie.com>.
Quick Start for getting Wicktopia running or at least see it running. I
wasn't sure how to run Wicketopia. Certainly James can post these
details, but I thought I would since he hasn't yet. Or, maybe it is
posted somewhere else. 

     	$ git clone https://github.com/jwcarman/Wicketopia.git 
     	$ cd Wicketopia 
     	$ mvn install 
     	$ cd example
	$ mvn exec:java \
         -Dexec.mainClass="org.wicketopia.example.web.util.Start" \
         -Dexec.classpathScope="test 

     Point your browser to the following.

	http://localhost:8080  


On Mon, Jan 23, 2012 at 01:10:07PM -0800, Brian Lavender wrote:
> The following worked.
> 
> $ mvn install 
> 
> How do I run the Start class?
> 
> I tried the following, but I get a class not found error. Usually, I have run
> classes inside the src/java area, but not in src/test .
> 
> $ cd example
> $ mvn exec:java -Dexec.mainClass="org.wicketopia.example.web.util.Start"
> 
> brian
> 
> On Fri, Jan 20, 2012 at 06:14:24PM -0500, James Carman wrote:
> > Run mvn install from the top-level directory.
> > 
> > Then, in the example webapp project, there is a class called Start:
> > 
> > https://github.com/jwcarman/Wicketopia/blob/master/example/src/test/java/org/wicketopia/example/web/util/Start.java
> > 
> > Run that.  Good luck!
> > 
> > On Thu, Jan 19, 2012 at 5:35 PM, Brian Lavender <br...@brie.com> wrote:
> > > James,
> > >
> > > I cloned the repository.
> > >
> > > $ git clone https://github.com/jwcarman/Wicketopia.git
> > > $ cd Wicketopia
> > > $ mvn eclipse:eclipse
> > >
> > > a few errors including the below error.
> > >
> > > [ERROR] Failed to execute goal on project wicketopia-persistence: Could not resolve dependencies for project org.wicketopia:wicketopia-persistence:jar:1.0-SNAPSHOT: Could not find artifact org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]
> > > [ERROR]
> > >
> > > Imported it into Eclipse.
> > >
> > > Which test case do I run?
> > >
> > > I tried changing into the example directory and doing a "mvn eclipse:eclipse" too, but it gave the below error.
> > >
> > > [ERROR] Failed to execute goal on project wicketopia-example: Could not resolve dependencies for project org.wicketopia:wicketopia-example:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.wicketopia:wicketopia:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-joda:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-cdi-weld:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-spring-security:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-hibernate:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia:jar:tests:1.0-SNAPSHOT: Failure to find org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]
> > >
> > >
> > > brian
> > >
> > > On Wed, Jan 18, 2012 at 06:58:08AM -0500, James Carman wrote:
> > >> Either way, you can open it in your IDE and run the jetty test server
> > >> that's included.  That's how I run it usually so that I can easily
> > >> debug and play around.
> > >>
> > >> On Wed, Jan 18, 2012 at 6:57 AM, James Carman
> > >> <ja...@carmanconsulting.com> wrote:
> > >> > I don't know if the plugin is turned on for the example application.
> > >> > But, you'd need to make sure you are in the example module before you
> > >> > try.
> > >> >
> > >> > On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender <br...@brie.com> wrote:
> > >> >> On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
> > >> >>> See https://github.com/jwcarman/Wicketopia
> > >> >>
> > >> >> Maybe I missed something, but I wasn't able to do a
> > >> >>
> > >> >> mvn jetty:run
> > >> >>
> > >> >> or did the war package run after generating a war file.
> > >> >>
> > >> >> brian
> > >> >> --
> > >> >> Brian Lavender
> > >> >> http://www.brie.com/brian/
> > >> >>
> > >> >> "There are two ways of constructing a software design. One way is to
> > >> >> make it so simple that there are obviously no deficiencies. And the other
> > >> >> way is to make it so complicated that there are no obvious deficiencies."
> > >> >>
> > >> >> Professor C. A. R. Hoare
> > >> >> The 1980 Turing award lecture
> > >> >>
> > >> >> ---------------------------------------------------------------------
> > >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> For additional commands, e-mail: users-help@wicket.apache.org
> > >> >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >
> > > --
> > > Brian Lavender
> > > http://www.brie.com/brian/
> > >
> > > "There are two ways of constructing a software design. One way is to
> > > make it so simple that there are obviously no deficiencies. And the other
> > > way is to make it so complicated that there are no obvious deficiencies."
> > >
> > > Professor C. A. R. Hoare
> > > The 1980 Turing award lecture
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> > 
> 
> -- 
> Brian Lavender
> http://www.brie.com/brian/
> 
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
> 
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by Brian Lavender <br...@brie.com>.
The following worked.

$ mvn install 

How do I run the Start class?

I tried the following, but I get a class not found error. Usually, I have run
classes inside the src/java area, but not in src/test .

$ cd example
$ mvn exec:java -Dexec.mainClass="org.wicketopia.example.web.util.Start"

brian

On Fri, Jan 20, 2012 at 06:14:24PM -0500, James Carman wrote:
> Run mvn install from the top-level directory.
> 
> Then, in the example webapp project, there is a class called Start:
> 
> https://github.com/jwcarman/Wicketopia/blob/master/example/src/test/java/org/wicketopia/example/web/util/Start.java
> 
> Run that.  Good luck!
> 
> On Thu, Jan 19, 2012 at 5:35 PM, Brian Lavender <br...@brie.com> wrote:
> > James,
> >
> > I cloned the repository.
> >
> > $ git clone https://github.com/jwcarman/Wicketopia.git
> > $ cd Wicketopia
> > $ mvn eclipse:eclipse
> >
> > a few errors including the below error.
> >
> > [ERROR] Failed to execute goal on project wicketopia-persistence: Could not resolve dependencies for project org.wicketopia:wicketopia-persistence:jar:1.0-SNAPSHOT: Could not find artifact org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]
> > [ERROR]
> >
> > Imported it into Eclipse.
> >
> > Which test case do I run?
> >
> > I tried changing into the example directory and doing a "mvn eclipse:eclipse" too, but it gave the below error.
> >
> > [ERROR] Failed to execute goal on project wicketopia-example: Could not resolve dependencies for project org.wicketopia:wicketopia-example:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.wicketopia:wicketopia:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-joda:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-cdi-weld:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-spring-security:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-hibernate:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia:jar:tests:1.0-SNAPSHOT: Failure to find org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]
> >
> >
> > brian
> >
> > On Wed, Jan 18, 2012 at 06:58:08AM -0500, James Carman wrote:
> >> Either way, you can open it in your IDE and run the jetty test server
> >> that's included.  That's how I run it usually so that I can easily
> >> debug and play around.
> >>
> >> On Wed, Jan 18, 2012 at 6:57 AM, James Carman
> >> <ja...@carmanconsulting.com> wrote:
> >> > I don't know if the plugin is turned on for the example application.
> >> > But, you'd need to make sure you are in the example module before you
> >> > try.
> >> >
> >> > On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender <br...@brie.com> wrote:
> >> >> On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
> >> >>> See https://github.com/jwcarman/Wicketopia
> >> >>
> >> >> Maybe I missed something, but I wasn't able to do a
> >> >>
> >> >> mvn jetty:run
> >> >>
> >> >> or did the war package run after generating a war file.
> >> >>
> >> >> brian
> >> >> --
> >> >> Brian Lavender
> >> >> http://www.brie.com/brian/
> >> >>
> >> >> "There are two ways of constructing a software design. One way is to
> >> >> make it so simple that there are obviously no deficiencies. And the other
> >> >> way is to make it so complicated that there are no obvious deficiencies."
> >> >>
> >> >> Professor C. A. R. Hoare
> >> >> The 1980 Turing award lecture
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> >> For additional commands, e-mail: users-help@wicket.apache.org
> >> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >
> > --
> > Brian Lavender
> > http://www.brie.com/brian/
> >
> > "There are two ways of constructing a software design. One way is to
> > make it so simple that there are obviously no deficiencies. And the other
> > way is to make it so complicated that there are no obvious deficiencies."
> >
> > Professor C. A. R. Hoare
> > The 1980 Turing award lecture
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by James Carman <ja...@carmanconsulting.com>.
Run mvn install from the top-level directory.

Then, in the example webapp project, there is a class called Start:

https://github.com/jwcarman/Wicketopia/blob/master/example/src/test/java/org/wicketopia/example/web/util/Start.java

Run that.  Good luck!

On Thu, Jan 19, 2012 at 5:35 PM, Brian Lavender <br...@brie.com> wrote:
> James,
>
> I cloned the repository.
>
> $ git clone https://github.com/jwcarman/Wicketopia.git
> $ cd Wicketopia
> $ mvn eclipse:eclipse
>
> a few errors including the below error.
>
> [ERROR] Failed to execute goal on project wicketopia-persistence: Could not resolve dependencies for project org.wicketopia:wicketopia-persistence:jar:1.0-SNAPSHOT: Could not find artifact org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]
> [ERROR]
>
> Imported it into Eclipse.
>
> Which test case do I run?
>
> I tried changing into the example directory and doing a "mvn eclipse:eclipse" too, but it gave the below error.
>
> [ERROR] Failed to execute goal on project wicketopia-example: Could not resolve dependencies for project org.wicketopia:wicketopia-example:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.wicketopia:wicketopia:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-joda:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-cdi-weld:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-spring-security:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-hibernate:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia:jar:tests:1.0-SNAPSHOT: Failure to find org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]
>
>
> brian
>
> On Wed, Jan 18, 2012 at 06:58:08AM -0500, James Carman wrote:
>> Either way, you can open it in your IDE and run the jetty test server
>> that's included.  That's how I run it usually so that I can easily
>> debug and play around.
>>
>> On Wed, Jan 18, 2012 at 6:57 AM, James Carman
>> <ja...@carmanconsulting.com> wrote:
>> > I don't know if the plugin is turned on for the example application.
>> > But, you'd need to make sure you are in the example module before you
>> > try.
>> >
>> > On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender <br...@brie.com> wrote:
>> >> On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
>> >>> See https://github.com/jwcarman/Wicketopia
>> >>
>> >> Maybe I missed something, but I wasn't able to do a
>> >>
>> >> mvn jetty:run
>> >>
>> >> or did the war package run after generating a war file.
>> >>
>> >> brian
>> >> --
>> >> Brian Lavender
>> >> http://www.brie.com/brian/
>> >>
>> >> "There are two ways of constructing a software design. One way is to
>> >> make it so simple that there are obviously no deficiencies. And the other
>> >> way is to make it so complicated that there are no obvious deficiencies."
>> >>
>> >> Professor C. A. R. Hoare
>> >> The 1980 Turing award lecture
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by Brian Lavender <br...@brie.com>.
James,

I cloned the repository. 

$ git clone https://github.com/jwcarman/Wicketopia.git
$ cd Wicketopia
$ mvn eclipse:eclipse

a few errors including the below error.

[ERROR] Failed to execute goal on project wicketopia-persistence: Could not resolve dependencies for project org.wicketopia:wicketopia-persistence:jar:1.0-SNAPSHOT: Could not find artifact org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]
[ERROR] 

Imported it into Eclipse.

Which test case do I run? 

I tried changing into the example directory and doing a "mvn eclipse:eclipse" too, but it gave the below error.

[ERROR] Failed to execute goal on project wicketopia-example: Could not resolve dependencies for project org.wicketopia:wicketopia-example:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.wicketopia:wicketopia:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-joda:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-cdi-weld:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-spring-security:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia-hibernate:jar:1.0-SNAPSHOT, org.wicketopia:wicketopia:jar:tests:1.0-SNAPSHOT: Failure to find org.wicketopia:wicketopia:jar:1.0-20110328.173826-2 in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced -> [Help 1]


brian

On Wed, Jan 18, 2012 at 06:58:08AM -0500, James Carman wrote:
> Either way, you can open it in your IDE and run the jetty test server
> that's included.  That's how I run it usually so that I can easily
> debug and play around.
> 
> On Wed, Jan 18, 2012 at 6:57 AM, James Carman
> <ja...@carmanconsulting.com> wrote:
> > I don't know if the plugin is turned on for the example application.
> > But, you'd need to make sure you are in the example module before you
> > try.
> >
> > On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender <br...@brie.com> wrote:
> >> On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
> >>> See https://github.com/jwcarman/Wicketopia
> >>
> >> Maybe I missed something, but I wasn't able to do a
> >>
> >> mvn jetty:run
> >>
> >> or did the war package run after generating a war file.
> >>
> >> brian
> >> --
> >> Brian Lavender
> >> http://www.brie.com/brian/
> >>
> >> "There are two ways of constructing a software design. One way is to
> >> make it so simple that there are obviously no deficiencies. And the other
> >> way is to make it so complicated that there are no obvious deficiencies."
> >>
> >> Professor C. A. R. Hoare
> >> The 1980 Turing award lecture
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by James Carman <ja...@carmanconsulting.com>.
Either way, you can open it in your IDE and run the jetty test server
that's included.  That's how I run it usually so that I can easily
debug and play around.

On Wed, Jan 18, 2012 at 6:57 AM, James Carman
<ja...@carmanconsulting.com> wrote:
> I don't know if the plugin is turned on for the example application.
> But, you'd need to make sure you are in the example module before you
> try.
>
> On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender <br...@brie.com> wrote:
>> On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
>>> See https://github.com/jwcarman/Wicketopia
>>
>> Maybe I missed something, but I wasn't able to do a
>>
>> mvn jetty:run
>>
>> or did the war package run after generating a war file.
>>
>> brian
>> --
>> Brian Lavender
>> http://www.brie.com/brian/
>>
>> "There are two ways of constructing a software design. One way is to
>> make it so simple that there are obviously no deficiencies. And the other
>> way is to make it so complicated that there are no obvious deficiencies."
>>
>> Professor C. A. R. Hoare
>> The 1980 Turing award lecture
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by James Carman <ja...@carmanconsulting.com>.
I don't know if the plugin is turned on for the example application.
But, you'd need to make sure you are in the example module before you
try.

On Wed, Jan 18, 2012 at 1:15 AM, Brian Lavender <br...@brie.com> wrote:
> On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
>> See https://github.com/jwcarman/Wicketopia
>
> Maybe I missed something, but I wasn't able to do a
>
> mvn jetty:run
>
> or did the war package run after generating a war file.
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by Brian Lavender <br...@brie.com>.
On Sun, Jan 15, 2012 at 12:36:48PM +0200, Martin Grigorov wrote:
> See https://github.com/jwcarman/Wicketopia

Maybe I missed something, but I wasn't able to do a 

mvn jetty:run

or did the war package run after generating a war file. 

brian
-- 
Brian Lavender
http://www.brie.com/brian/

"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the other
way is to make it so complicated that there are no obvious deficiencies."

Professor C. A. R. Hoare
The 1980 Turing award lecture

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by malebu <mi...@gmail.com>.
Here is how i did it...

*created a spring-config application-security.xml*

/"<http create-session="ifRequired" auto-config="true">
        <remember-me/>
		<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
	</http>

    <authentication-manager alias="authenticationManager" >
        <authentication-provider user-service-ref="userDetailsService"/>
    </authentication-manager>

    <global-method-security secured-annotations="enabled" />
"/

*in web.xml add the following lines:*

    /
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
       
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
/

*in spring-config.xml*

/
  <bean id="userDetailsService"
class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces"
value="security.service.UserDetailsService"/>
        <property name="target">
            <bean class="security.service.UserDetailsServiceImpl">
                <property name="userDao" ref="userDetailDao"/>
            </bean>
        </property>
    </bean>

   <bean id="userDetailsService"
class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces"
value="security.service.UserDetailsService"/>
        <property name="target">
            <bean class="security.service.impl.UserDetailsServiceImpl">
                <property name="userDao" ref="userDetailDao"/>
            </bean>
        </property>
    </bean>
/

*Add following annotation on pages you want to secure:*

/@AuthorizeInstantiation("ROLE_ADMIN")/ // for users replace ROLE_ADMIN with
USER_ROLE

Create a UserDetailsService class:

/public interface UserDetailsService extends
org.springframework.security.core.userdetails.UserDetailsService {

    public void RegisterUser(UserDetail userDetail);

    public UserDetail loadUserByEmail(String emailAddress);

    public void deleteUserVerification(UserVerification userVerification);

    public void deleteUser(UserDetail userDetail);

    public void verifyUser(UserDetail userDetail);

    public UserDetail getByUsername(String username);
}/

*Create UserDetailServiceImpl class:*

/public class UserDetailsServiceImpl implements UserDetailsService {

    private UserDetailDAO userDao;

    @Override
    public UserDetails loadUserByUsername(String s) throws
UsernameNotFoundException, DataAccessException {
        return userDao.getUserDetail(s);
    }

    @Override
    public UserDetail loadUserByEmail(String emailAddress) {
        return userDao.getUserByEmail(emailAddress);
    }

    @Override
    public void deleteUserVerification(UserVerification userVerification) {
        userDao.deleteUserVerification(userVerification);
    }

    public UserDetailDAO getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDetailDAO userDao) {
        this.userDao = userDao;
    }

    public void RegisterUser(UserDetail userDetail) {
        userDao.saveUserDetail(userDetail);
    }

    public void deleteUser(UserDetail userDetail) {
        userDao.deleteUserDetail(userDetail);
    }

    public void verifyUser(UserDetail userDetail) {
        userDetail.setEnabled(true);
        userDetail.setLocked(false);
        userDetail.setCredentialsExpired(false);
        userDetail.setExpired(false);
        userDetail.setAccountStatus(UserAccountStatus.VERIFIED);
        List<UserVerification> userVerificationList =
userDetail.getUserVerification();
        UserVerification userVerification = userVerificationList.get(0);
        userDetail.getUserVerification().remove(0);
        userDao.updateUserDetail(userDetail);
        userDao.deleteUserVerification(userVerification);

    }

    public UserDetail getUser(String username) {
        return userDao.getByUsername(username);
    }

    @Override
    public UserDetail getByUsername(String username) {
        return userDao.getByUsername(username);
    }
}/

*Create class UserVerification:*

/@Entity
@Table(name = "userverification",
        uniqueConstraints = {@UniqueConstraint(columnNames = {"userid"})}
)
public class UserVerification extends BasicEntity implements Serializable {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "userid", referencedColumnName = "id", insertable =
true, nullable = false, updatable = true)
    private UserDetail userDetail;

    private String verificationCode;

    public UserVerification() {
    }

    public UserVerification(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public UserVerification(UserDetail userDetail, String verificationCode)
{
        this.userDetail = userDetail;
        this.verificationCode = verificationCode;
    }

    public UserDetail getUserDetail() {
        return userDetail;
    }

    public void setUserDetail(UserDetail userDetail) {
        this.userDetail = userDetail;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }
}/

*Create UserDetails object:*

/@Entity
@Table(name = "userdetails",
        uniqueConstraints = {@UniqueConstraint(columnNames = {"username",
"emailaddress"})}
)
public class UserDetail extends BasicEntity implements UserDetails {

    private String userName;
    private String password;
    private String emailAddress;
    private Timestamp accountCreatedDate;
    private Timestamp lastActivityDate;
    private boolean keepLoggedIn;
......
.....
....
..
}/

*Role object:*

/@Entity
@Table(name = "Roles", uniqueConstraints = {@UniqueConstraint(columnNames =
{"role"})})
public class Role extends BasicEntity implements GrantedAuthority {

    private String role;
....
......
.....
...
..
}/


This is all you need to get started... Hope this helps...

-Milton


Martin Grigorov-4 wrote
> 
> See https://github.com/jwcarman/Wicketopia
> 
> On Sun, Jan 15, 2012 at 7:57 AM, Brian Lavender &lt;brian@&gt; wrote:
>> Does someone have a sample of the current spring security with Wicket
>> auth-roles?
>> One that I can do the following.
>>
>> mvn jetty:run
>>
>> and see it run?
>>
>> brian
>> --
>> Brian Lavender
>> http://www.brie.com/brian/
>>
>> "There are two ways of constructing a software design. One way is to
>> make it so simple that there are obviously no deficiencies. And the other
>> way is to make it so complicated that there are no obvious deficiencies."
>>
>> Professor C. A. R. Hoare
>> The 1980 Turing award lecture
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@.apache
>> For additional commands, e-mail: users-help@.apache
>>
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@.apache
> For additional commands, e-mail: users-help@.apache
> 


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-spring-security-sample-app-tp4296338p4298233.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket spring security sample app

Posted by Martin Grigorov <mg...@apache.org>.
See https://github.com/jwcarman/Wicketopia

On Sun, Jan 15, 2012 at 7:57 AM, Brian Lavender <br...@brie.com> wrote:
> Does someone have a sample of the current spring security with Wicket auth-roles?
> One that I can do the following.
>
> mvn jetty:run
>
> and see it run?
>
> brian
> --
> Brian Lavender
> http://www.brie.com/brian/
>
> "There are two ways of constructing a software design. One way is to
> make it so simple that there are obviously no deficiencies. And the other
> way is to make it so complicated that there are no obvious deficiencies."
>
> Professor C. A. R. Hoare
> The 1980 Turing award lecture
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org