RE: Integrate Apache Shiro with Struts2

2017-07-06 Thread Kofford, C. Todd
PR created.

TK
tkoff...@ku.edu

-Original Message-
From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
Sent: Thursday, July 6, 2017 7:38 AM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Integrate Apache Shiro with Struts2

2017-07-06 14:33 GMT+02:00 Kofford, C. Todd <tkoff...@ku.edu>:
> Sure, is there any preference on the name of the new project under 
> "struts-examples", ... "struts-shiro-basic"?

shiro-basic will be enough, thank you :)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Integrate Apache Shiro with Struts2

2017-07-06 Thread Kofford, C. Todd
Sure, is there any preference on the name of the new project under 
"struts-examples", ... "struts-shiro-basic"?

TK
tkoff...@ku.edu

-Original Message-
From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
Sent: Wednesday, July 5, 2017 6:22 AM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Integrate Apache Shiro with Struts2

Could you open a PR against https://github.com/apache/struts-examples
and contribute your example there?

2017-06-30 20:54 GMT+02:00 Ken McWilliams <ken.mcwilli...@gmail.com>:
> Thank you, look forward to it, I'm working on the same thing!
> I'm using this SO Q as my starting point and the accepted answers 
> link the an similar example using StromPath:
> https://stackoverflow.com/questions/27063599/writing-custom-shiro-real
> m
>
> After that is don't I'll be looking to integrate AspectJ and I've 
> experimented with Dagger2 so those would be the last pieces before I 
> can do the "real work".
>
> On Fri, Jun 30, 2017 at 5:46 AM, Kofford, C. Todd <tkoff...@ku.edu> wrote:
>
>> Ken, I'm glad to help!
>>
>> I tried to use the latest version of shiro (1.4.0) too, but ran into 
>> a some issues. I've posted a message to the shiro user group, and 
>> those guys are really good about getting back and resolving issues, 
>> so I think it's only a matter of time before that gets resolved.
>>
>> I've started another small project, still on shiro 1.3.2, that 
>> demonstrates how to define a custom shiro "realm", where you can do 
>> authentication and authorization. It's really pretty easy to 
>> implement, so it shouldn't take too long to crank out and post up to GitHub.
>>
>> Todd Kofford
>> tkoff...@ku.edu
>>
>> -Original Message-
>> From: Ken McWilliams [mailto:ken.mcwilli...@gmail.com]
>> Sent: Thursday, June 29, 2017 1:25 PM
>> To: Struts Users Mailing List <user@struts.apache.org>
>> Subject: Re: Integrate Apache Shiro with Struts2
>>
>> Todd, thank you this was a huge help!
>>
>> I've followed what you did and added it into a demo project that 
>> isn't much more complicated than what you provided, just so I know 
>> how it all works.
>>
>> One of the things I found the hard way is if you move to Shiro 1.4 
>> (the
>> latest) it won't start...
>>
>> I would like to turn your project into an struts2/shiro integration 
>> guide (although the provided project is quite straight forward). I'm 
>> using JPA services to get my user credentials so a bit of a guide 
>> there wouldn't hurt, so next step is to figure out how to make that work 
>> with shiro.
>>
>> Regards,
>> Ken
>>
>> On Mon, Jun 26, 2017 at 9:40 AM, Kofford, C. Todd <tkoff...@ku.edu> wrote:
>>
>> > OK, I've just uploaded a very simple struts2 - shiro example to github:
>> > https://github.com/tkofford/struts2shiro. NOTE - this is a very 
>> > simple example that uses a default shiro.ini file for 
>> > authentication/authorization and struts interceptor for "injecting" 
>> > the
>> shiro subject into the stack.
>> >
>> > I'll start building a more complicated example that uses spring to 
>> > inject the shiro parts, and reply back when that's done.
>> >
>> > Todd Kofford
>> > University of Kansas
>> > tkoff...@ku.edu
>> >
>> > -Original Message-
>> > From: Ken McWilliams [mailto:ken.mcwilli...@gmail.com]
>> > Sent: Thursday, June 22, 2017 11:10 AM
>> > To: Struts Users Mailing List <user@struts.apache.org>
>> > Subject: Re: Integrate Apache Shiro with Struts2
>> >
>> > That would be awesome. From having looked around on the web there 
>> > is very little Struts2/Shiro content. Some examples would be a great help.
>> >
>> > On Thu, Jun 22, 2017 at 9:51 AM, Kofford, C. Todd <tkoff...@ku.edu>
>> wrote:
>> >
>> > > We've been using strut2 and shiro for a long time (actually since 
>> > > the old jsecurity days). I'd be happy to contribute some trivial 
>> > > and more complex examples if needed.
>> > >
>> > > Todd Kofford
>> > > University of Kansas
>> > > tkoff...@ku.edu
>> > >
>> > >
>> > > -Original Message-
>> > > From: Lukasz Lenart [mailto:lukaszlen...@apache.org]
>> > > Sent: Sunday, June 18, 2017 3:23 AM
>> > > To: Struts Users Mailing List <user@struts.apache.org>
>> > > Subject:

RE: Integrate Apache Shiro with Struts2

2017-06-30 Thread Kofford, C. Todd
Ken, I'm glad to help!

I tried to use the latest version of shiro (1.4.0) too, but ran into a some 
issues. I've posted a message to the shiro user group, and those guys are 
really good about getting back and resolving issues, so I think it's only a 
matter of time before that gets resolved.

I've started another small project, still on shiro 1.3.2, that demonstrates how 
to define a custom shiro "realm", where you can do authentication and 
authorization. It's really pretty easy to implement, so it shouldn't take too 
long to crank out and post up to GitHub.

Todd Kofford
tkoff...@ku.edu

-Original Message-
From: Ken McWilliams [mailto:ken.mcwilli...@gmail.com] 
Sent: Thursday, June 29, 2017 1:25 PM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Integrate Apache Shiro with Struts2

Todd, thank you this was a huge help!

I've followed what you did and added it into a demo project that isn't much 
more complicated than what you provided, just so I know how it all works.

One of the things I found the hard way is if you move to Shiro 1.4 (the
latest) it won't start...

I would like to turn your project into an struts2/shiro integration guide 
(although the provided project is quite straight forward). I'm using JPA 
services to get my user credentials so a bit of a guide there wouldn't hurt, so 
next step is to figure out how to make that work with shiro.

Regards,
Ken

On Mon, Jun 26, 2017 at 9:40 AM, Kofford, C. Todd <tkoff...@ku.edu> wrote:

> OK, I've just uploaded a very simple struts2 - shiro example to github:
> https://github.com/tkofford/struts2shiro. NOTE - this is a very simple 
> example that uses a default shiro.ini file for 
> authentication/authorization and struts interceptor for "injecting" the shiro 
> subject into the stack.
>
> I'll start building a more complicated example that uses spring to 
> inject the shiro parts, and reply back when that's done.
>
> Todd Kofford
> University of Kansas
> tkoff...@ku.edu
>
> -Original Message-
> From: Ken McWilliams [mailto:ken.mcwilli...@gmail.com]
> Sent: Thursday, June 22, 2017 11:10 AM
> To: Struts Users Mailing List <user@struts.apache.org>
> Subject: Re: Integrate Apache Shiro with Struts2
>
> That would be awesome. From having looked around on the web there is 
> very little Struts2/Shiro content. Some examples would be a great help.
>
> On Thu, Jun 22, 2017 at 9:51 AM, Kofford, C. Todd <tkoff...@ku.edu> wrote:
>
> > We've been using strut2 and shiro for a long time (actually since 
> > the old jsecurity days). I'd be happy to contribute some trivial and 
> > more complex examples if needed.
> >
> > Todd Kofford
> > University of Kansas
> > tkoff...@ku.edu
> >
> >
> > -Original Message-
> > From: Lukasz Lenart [mailto:lukaszlen...@apache.org]
> > Sent: Sunday, June 18, 2017 3:23 AM
> > To: Struts Users Mailing List <user@struts.apache.org>
> > Subject: Re: Integrate Apache Shiro with Struts2
> >
> > 2017-06-17 19:08 GMT+02:00 Ken McWilliams <ken.mcwilli...@gmail.com>:
> > > If not I hope to follow up with a solution.
> >
> > +1 and we can add it to our docs :)
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > 
> > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>



--
Sent from my C64 using a 300 baud modem


RE: Integrate Apache Shiro with Struts2

2017-06-26 Thread Kofford, C. Todd
OK, I've just uploaded a very simple struts2 - shiro example to github: 
https://github.com/tkofford/struts2shiro. NOTE - this is a very simple example 
that uses a default shiro.ini file for authentication/authorization and struts 
interceptor for "injecting" the shiro subject into the stack.

I'll start building a more complicated example that uses spring to inject the 
shiro parts, and reply back when that's done.

Todd Kofford
University of Kansas
tkoff...@ku.edu

-Original Message-
From: Ken McWilliams [mailto:ken.mcwilli...@gmail.com] 
Sent: Thursday, June 22, 2017 11:10 AM
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Integrate Apache Shiro with Struts2

That would be awesome. From having looked around on the web there is very 
little Struts2/Shiro content. Some examples would be a great help.

On Thu, Jun 22, 2017 at 9:51 AM, Kofford, C. Todd <tkoff...@ku.edu> wrote:

> We've been using strut2 and shiro for a long time (actually since the 
> old jsecurity days). I'd be happy to contribute some trivial and more 
> complex examples if needed.
>
> Todd Kofford
> University of Kansas
> tkoff...@ku.edu
>
>
> -Original Message-
> From: Lukasz Lenart [mailto:lukaszlen...@apache.org]
> Sent: Sunday, June 18, 2017 3:23 AM
> To: Struts Users Mailing List <user@struts.apache.org>
> Subject: Re: Integrate Apache Shiro with Struts2
>
> 2017-06-17 19:08 GMT+02:00 Ken McWilliams <ken.mcwilli...@gmail.com>:
> > If not I hope to follow up with a solution.
>
> +1 and we can add it to our docs :)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


RE: Integrate Apache Shiro with Struts2

2017-06-22 Thread Kofford, C. Todd
We've been using strut2 and shiro for a long time (actually since the old 
jsecurity days). I'd be happy to contribute some trivial and more complex 
examples if needed.

Todd Kofford
University of Kansas
tkoff...@ku.edu


-Original Message-
From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
Sent: Sunday, June 18, 2017 3:23 AM
To: Struts Users Mailing List 
Subject: Re: Integrate Apache Shiro with Struts2

2017-06-17 19:08 GMT+02:00 Ken McWilliams :
> If not I hope to follow up with a solution.

+1 and we can add it to our docs :)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: by pass the validation

2013-07-09 Thread Kofford, C. Todd
I think that if you name your validation file as follows it will only trigger 
for the given method.

SomeAction-method-validation.xml

For the saveFile method you would have:

SomeAction-saveFile-validation.xml

Todd Kofford
tkoff...@ku.edu

From: Alireza Fattahi [afatt...@yahoo.com]
Sent: Tuesday, July 09, 2013 8:16 AM
To: Struts Users Mailing List
Subject: by pass the validation

Hi,
When I put SomeAction-validation.xml nead an action class, the validation is 
always checked before execute method.
If I have more than one method in the action, will the validation execute for 
them too ?! Is there any way that I can configure which methods should by pass 
the validation



~Regards,
~~Alireza Fattahi





-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Cancel-Redirect Action not working on Portlet

2010-03-23 Thread Kofford, C Todd
I fixed this issue by changing my Cancel (submit) button to use the
action attribute for a cancel action, see change below. Sharing just
in case someone else runs into this issue.

Previously
---
s:submit value=Cancel name=redirectAction:cancelAlbum/

Fixed
--
s:submit value=Cancel action=cancelAlbum/


Todd Kofford 
tkoff...@ku.edu 
University of Kansas - IT 


-Original Message-
From: Kofford, C Todd [mailto:tkoff...@ku.edu] 
Sent: Monday, March 15, 2010 10:20 AM
To: user@struts.apache.org
Subject: Cancel-Redirect Action not working on Portlet

I am using Struts 2.1.8.1 with the portlet plug-in, and my webapp, a
simple album database, is deployed on a tomcat 6 container.

When running this webapp stand-alone the cancel button action correctly
fires and calls the cancelAlbum action, but when running the same
webapp as a portlet in uPortal 3.1.2, the cancel button fires the action
defined for the form, saveAlbum, not the redirected one that I defined
in the submit tag for the cancel button.

I have the following form defined in a JSP, for adding/editing an album:

s:form action=saveAlbum method=post
  s:textfield name=album.artist label=%{getText('label.artist')}
size=40/
  s:textfield name=album.title label=%{getText('label.title')}
size=40/
  s:textfield name=album.releaseYear
label=%{getText('label.releaseYear')} size=20/
  s:select name=album.genre.genreId list=genres listKey=genreId
listValue=name/
  s:hidden name=album.albumId/
  s:submit value=%{getText('button.label.submit')}/ 
  s:submit value=%{getText('button.label.cancel')}
name=redirectAction:cancelAlbum/
/s:form

I have the following actions defined in my struts.xml file, and my
action class, AlbumAction, implements the methods (list(), save(),
delete(), input(), cancel()):

package name=portlet-default extends=struts-portlet-default
namespace=/portlet   
action name=index
class=edu.ku.it.si.struts2portlet.action.AlbumAction method=list
result name=success/jsp/albums.jsp/result
/action

action name=*Album
class=edu.ku.it.si.struts2portlet.action.AlbumAction method={1}
result name=success/jsp/albums.jsp/result
result name=input/jsp/albumForm.jsp/result
result name=cancel/jsp/albums.jsp/result
result name=error/jsp/error.jsp/result
/action
/package

Anyone have any ideas why 
  s:submit value=%{getText('button.label.cancel')}
name=redirectAction:cancelAlbum/ 
is not working for a portlet?
 
Thanks in advance,

Todd Kofford 
tkoff...@ku.edu 
University of Kansas - IT 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Cancel-Redirect Action not working on Portlet

2010-03-15 Thread Kofford, C Todd
I am using Struts 2.1.8.1 with the portlet plug-in, and my webapp, a
simple album database, is deployed on a tomcat 6 container.

When running this webapp stand-alone the cancel button action correctly
fires and calls the cancelAlbum action, but when running the same
webapp as a portlet in uPortal 3.1.2, the cancel button fires the action
defined for the form, saveAlbum, not the redirected one that I defined
in the submit tag for the cancel button.

I have the following form defined in a JSP, for adding/editing an album:

s:form action=saveAlbum method=post
  s:textfield name=album.artist label=%{getText('label.artist')}
size=40/
  s:textfield name=album.title label=%{getText('label.title')}
size=40/
  s:textfield name=album.releaseYear
label=%{getText('label.releaseYear')} size=20/
  s:select name=album.genre.genreId list=genres listKey=genreId
listValue=name/
  s:hidden name=album.albumId/
  s:submit value=%{getText('button.label.submit')}/ 
  s:submit value=%{getText('button.label.cancel')}
name=redirectAction:cancelAlbum/
/s:form

I have the following actions defined in my struts.xml file, and my
action class, AlbumAction, implements the methods (list(), save(),
delete(), input(), cancel()):

package name=portlet-default extends=struts-portlet-default
namespace=/portlet   
action name=index
class=edu.ku.it.si.struts2portlet.action.AlbumAction method=list
result name=success/jsp/albums.jsp/result
/action

action name=*Album
class=edu.ku.it.si.struts2portlet.action.AlbumAction method={1}
result name=success/jsp/albums.jsp/result
result name=input/jsp/albumForm.jsp/result
result name=cancel/jsp/albums.jsp/result
result name=error/jsp/error.jsp/result
/action
/package

Anyone have any ideas why 
  s:submit value=%{getText('button.label.cancel')}
name=redirectAction:cancelAlbum/ 
is not working for a portlet?
 
Thanks in advance,

Todd Kofford 
tkoff...@ku.edu 
University of Kansas - IT 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts2 with Authentication Security

2009-08-21 Thread Kofford, C Todd
I know that Spring Security (ACEGI) gets a lot of publicity, but there are 
other alternatives out there too.
Last year I implemented a struts2 based system using Apache Shiro (formerly 
jsecurity), and found it very easy to learn an implement. On their website, 
http://cwiki.apache.org/SHIRO/  they have lots of documentation and examples.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT

the continuum transfunctioner is a very mysterious and powerful device and 
it's mystery is only exceeded by it's power

 

-Original Message-
From: Paweł Wielgus [mailto:poulw...@gmail.com] 
Sent: Friday, August 21, 2009 7:10 AM
To: Struts Users Mailing List
Subject: Re: Struts2 with Authentication  Security

Hi all,
a few years ago means also that this solution still works.
But from my point of view, inteceptor might be better if You are in a situation
where You are not the only programmer
or You are laizy and have bad memory - just like me.
If so read this:
http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html

Or use Spring Security (ACEGI).

Best greetings,
Paweł Wielgus.



2009/8/21 Lee Clemens j...@leeclemens.net:
 A few years ago, huh? You make it seem like such an archaic approach :)

 My question, I guess using a servlet/interceptor to do the same as this
 abstract class would conform more with the 'accepted' methodology? (I did
 play around with a servlet, but couldn't get it to redirect correct - I
 admit I haven't looked into Interceptors too deeply.)

 -Original Message-
 From: Wes Wannemacher [mailto:w...@wantii.com]
 Sent: Thursday, August 20, 2009 8:11 PM
 To: Struts Users Mailing List
 Subject: Re: Struts2 with Authentication  Security

 I used this same approach for an app I worked on a few years ago.
 There is nothing wrong, in fact its simplicity is a bit of an
 advantage. If you can fit your needs into this type of setup then you
 will probably be happy that it is so easy to follow.

 On 8/20/09, Lee Clemens j...@leeclemens.net wrote:
 This may not be perfect, and I welcome any criticism to this approach:

 abstract class extends ActionSupport which overrides execute() to
 authenticate requests and then return a call to abstract method, say,
 doAction(), or error if they are not authenticated/timed out.

 Each action which needs to be protected simply extends the above abstract
 class and implements doAction(), just as you would normally override
 execute().  Make execute() final in the abstract class...

 Add another abstract method to get a group authentication level
 (implemented
 by each action's class) and you have a fairly robust and straightforward
 authentication scheme, IMHO

 With proper negative testing, you can be certain any developer didn't
 forget
 to extend/implement the 'security' action for any given action that should
 be restricted
[snip]



 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts2 with Authentication Security

2009-08-21 Thread Kofford, C Todd
Martin, did you let the shiro guys know about the problems you had building the 
jars? I haven't built the core package since it was still jsecurity.

I know that they've been doing lots of work on their svn repo, since they 
renamed the project. 

Les Hazlewood and the other shiro guys are extremely helpful and would probably 
like to know if their build is broken. Their userlist email is 
shiro-...@incubator.apache.org

Aside from the problems associated with moving to an apache incubator project 
and the rename, the package is really easy to use, flexible, and powerful.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT
 

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Friday, August 21, 2009 10:07 AM
To: Struts Users Mailing List
Subject: RE: Struts2 with Authentication  Security


i had a devil of a time coaxing mvn package to build proper jars until i 
renamed the failing tests e.g:

ren 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java
 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/DefaultSessionManagerTest.java.old

ren 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java
 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java.old

ls -al $SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt

08/21/2009  09:23 AM 5,580 DefaultSessionManagerTest.java.old
08/21/2009  09:23 AM 2,411 DelegatingSessionTest.java.old
   2 File(s)  7,991 bytes

ren 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/.svn/text-base/DefaultSessionManagerTest.java.svn-base
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/.svn/text-base/DefaultSessionManagerTest.java.svn-base.old


ren 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java.svn-base
 

$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java.svn-base.old


ls -al 
$SHIRO_HOME/trunk/core/src/test/java/org/apache/shiro/session/mgt/.svn/text-base
08/21/2009  09:23 AM 5,580 DefaultSessionManagerTest.java.svn-base.o
ld
08/21/2009  09:23 AM 2,411 DelegatingSessionTest.java.svn-base.old

$SHIRO_HOME/trunk/coremvn package

i now have requisite plugin jars located at
 Directory of $SHIRO/trunk/core/target

08/21/2009  10:21 AM 1,602,462 shiro-core-1.0-incubating-SNAPSHOT-javado
c.jar
08/21/2009  10:17 AM   407,412 shiro-core-1.0-incubating-SNAPSHOT-source
s.jar
08/21/2009  10:17 AM   265,537 shiro-core-1.0-incubating-SNAPSHOT.jar

Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Subject: RE: Struts2 with Authentication  Security
 Date: Fri, 21 Aug 2009 08:14:25 -0500
 From: tkoff...@ku.edu
 To: user@struts.apache.org
 
 I know that Spring Security (ACEGI) gets a lot of publicity, but there are 
 other alternatives out there too.
 Last year I implemented a struts2 based system using Apache Shiro (formerly 
 jsecurity), and found it very easy to learn an implement. On their website, 
 http://cwiki.apache.org/SHIRO/  they have lots of documentation and examples.
 
 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT
 
 the continuum transfunctioner is a very mysterious and powerful device and 
 it's mystery is only exceeded by it's power
 
  
 
 -Original Message-
 From: Paweł Wielgus [mailto:poulw...@gmail.com] 
 Sent: Friday, August 21, 2009 7:10 AM
 To: Struts Users Mailing List
 Subject: Re: Struts2 with Authentication  Security
 
 Hi all,
 a few years ago means also that this solution still works.
 But from my point of view, inteceptor might be better if You are in a 
 situation
 where You are not the only programmer
 or You are laizy and have bad memory - just like me.
 If so read this:
 

RE: Struts2 portlet bug found

2009-07-22 Thread Kofford, C Todd
Since this deals with struts and uportal I have copied the uportal user
group in this response too.

I had a similar problem. See email thread below:
http://www.mail-archive.com/user@struts.apache.org/msg87615.html 

I was simply using the session (map) object from a SessionAware action
class and not explicitly using PortletSession. This is because we run
our struts 2 webapp both as a portlet and a standalone webapp, and
wanted to handle the session in a consistent way. I applied the uportal
fix (mentioned in the email thread) to my uportal 2.5.x installation and
MY problem was solved. 

We are just now moving to uportal 3.1.1 and are still on struts 2.0.14
due to an issue running struts 2.1.6 webapps as standalone and portlet
simultaneously. But so far, I have not seen the problem you describe
when testing my struts 2 portlets in uportal 3.1.1. 

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT

-Original Message-
From: Tracy12 [mailto:j_lal...@yahoo.com] 
Sent: Tuesday, July 21, 2009 8:49 PM
To: user@struts.apache.org
Subject: Struts2 portlet bug found


Hi,

We got a  struts 2.0.6 portlet application with uPortal  2.5.3 ( inside
Pluto 1.0.x) with no issues and running fine.

Now we deployed the same struts 2.0.6 application in uPortal 3.1.1
(inside
pluto 1.1.7) and found following issue.

in our action classes we had the following,  where session is of type
PortletSession.

session.setAttribute(studentId,111,PortletSession.APPLICATION_SC
OPE)

We trieved the above studentId in the jsp as follows. 
s:property value=#session.studentId/

The above worked with no issues in uPortal 2.5.3 but with uPortal 3.1.1
this
is not working,
Then I tried the following
s:property value=#application.studentId/ but didnt work,


I  interacted with the uPortal forum and this is what it
tells...http://www.nabble.com/Re%3A-is-this-a-bug-in-struts2-portlets-td
24581733.html 

I thought based on that s:property value=#application.studentId/
should
work,

What else could I try, This looks to me a bug. Can't understand why it
is
not in the value stack.

If not pls let me know how to retrieve the above
PortletSession.APPLICATION_SCOPE variable in the jsp.

If this has been fixed let me know which struts 2 version is that.


I did try the following also with no luck

s:property value=%{#application['studentId']}/

waiting for a quick reply


Thanks





-- 
View this message in context:
http://www.nabble.com/Struts2-portlet-bug-found-tp24598748p24598748.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: redirect action in s:submit

2009-06-22 Thread Kofford, C Todd
Couldn't you do something like the following?

  s:url id=myAction action=MyAction 
s:param name=param1 value=value1 /
s:param name=param2 value=value2 /
s:param name=param3 value=value3 /
  /s:url

   ... redirect:%{myAction}

I haven't personally tried this, but I've used plenty of action URLs
with multiple parameters defined this way.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: Greg Lindholm [mailto:greg.lindh...@gmail.com] 
Sent: Monday, June 22, 2009 10:04 AM
To: Struts Users Mailing List
Subject: Re: redirect action in s:submit

From looking at the source it doesn't look like it should be adding the
.action extension so I would suggest you run it in the debugger and
break in
DefaultActionMapper and see where the .action is coming from.

On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma
bhaara...@gmail.comwrote:

 my Struts version is 2.0.6
 @Greg...I tried what you suggested..it works but not quite.

 redirect:MyAction.action?param1=value1param2=value2

 turns into the following url
 MyAction.action?PageSize=50pageIndex=3.action

 problem is that it adds '.action' to the end...

 On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty mgai...@hotmail.com
 wrote:


   Yes it works and it's part of the DefaultActionMapper.  I don't
think
 you
   will be able to add parameters using the redirect-action:
prefix. I
   haven't try it but you should be able to use the redirect:
prefix and
   construct the url with parameters like this
   redirect:MyAction.action?param1=value1param2=value2.
 

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts2 and Security

2009-06-19 Thread Kofford, C Todd
I developed an webapp about a year ago, using struts 2 and a security
package called (at the time) jsecurity. Since then, jsecurity has become
an apache project and has been renamed Apache Ki/Shiro. I guess that
there was a naming conflict with the Ki name, so it is now called
Apache Shiro (as of very recently). 
http://www.jsecurity.org/ (old independent website)
http://incubator.apache.org/ki/ (apache website - probably soon to be
renamed shiro)

Naming issues aside, this was an excellent security package providing
authentication and authorization that was pretty easy to learn,
flexible, and very powerful. The support that I received from the
project's founders was second to none (Thanks Les  Jeremy!). One of my
colleagues here at KU, Bruce Phillips, has also posted some tutorials
(linked to from the apache website) to get you started.

You should really check into it.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: aum strut [mailto:aum.str...@gmail.com] 
Sent: Friday, June 19, 2009 2:20 AM
To: Struts Users Mailing List
Subject: Struts2 and Security

Hi All,

We are on the way to develop a new application using struts2. Currently
we
are analysing the area of authentication and authorization, we do have
some
options of using the following frame work for these

1) Acegi
2)JAAS

my point is that we any one in the list is using any of the security
frame
work.please let me know about there experiences, so that it will help us
in
choosing the right security model.

regarding the pltfrom we have decided to use is as follows

1) Struts2
2) JSP/Velocity
3) Hibernate
4) YUI

these are the core building block rest technologies and frame work can
be
choosen as required

looking forward for your valuable suggestions.

thannks in advance
aum

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Error when deploying portlets beside a normal Struts2 web app?

2009-06-17 Thread Kofford, C Todd
I am experiencing the exact same problem ever since I moved to struts 2.1.6. 

This was not a problem in struts 2.0.14, and in fact, we've stayed with struts 
2.0.14 for this very reason.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT
 

-Original Message-
From: IainM [mailto:iain.mil...@live.co.uk] 
Sent: Friday, June 12, 2009 4:04 AM
To: user@struts.apache.org
Subject: Re: Error when deploying portlets beside a normal Struts2 web app?


We have struts.xml set up so that the portlet package extends
struts-portlet-default and the normal actions extend struts-default. The
problem manifests even if all we do is add the portlet-plugin jar into the
WEB-INF/lib directory and do no other setup of portlets. So there seems to
be something in the portlet plugin which is affecting normal action
functionality.

Iain.


Nils-Helge Garli wrote:
 
 If you're using portlets, your package must extend
 struts-portlet-default instead of struts-default. It should be
 possible to run servlet actions and portlet actions in the same
 application.
 
 Nils-H
 
 
 On Thu, Jun 11, 2009 at 3:52 PM, IainMiain.mil...@live.co.uk wrote:

 Hi,

 I have an existing Struts2 (2.1.6) web app which I would like to add a
 couple of portlets to. I have added the portlet plugin and a portel.xml
 file
 and developed a couple of plugins which I have successfully run in JBOSS
 Portal. My problem is that the addition of the portlet plugin
 (struts2-portlet-plugin-2.1.6) seems to break my existing web pages. For
 example, when I have an action which forwards onto a very plain jsp file
 that shows a form (using s:form) I get a NullPointerException as below:

 org.apache.jasper.JasperException: java.lang.NullPointerException

 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)

 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
      
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       etc...

 root cause

 java.lang.NullPointerException
      
  org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
        org.apache.struts2.components.UIBean.end(UIBean.java:510)

 org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)

 org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)

 org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
        org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
      
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

 org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)

 org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
        etc.

 If I remove the portlet plugin (and the portlet.xml file which points to
 one
 of the classes from the plugin) all of my original webpages work without
 any
 issues so it's definetly the plugin that's causing a conflict.

 Can I not deploy a struts2 application that includes both normal web
 pages
 and portlets? Or is there a way around this problem.

 Any help would be greatly appreciated.

 Iain.
 --
 View this message in context:
 http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23995311.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: [s2] multiple submit buttons using action and method

2009-04-30 Thread Kofford, C Todd
You may want to re-consider the design of having multiple submit buttons
on the same page. This can be tricky for users that like to use the
enter key instead of the mouse click, and make it hard for the user to
figure out which submit button was executed. I won't even get into
browser issues.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: Kishan G. Chellap Paandy
[mailto:kishanchellapaand...@spanservices.com] 
Sent: Thursday, April 30, 2009 6:38 AM
To: Struts Users Mailing List
Subject: RE: [s2] multiple submit buttons using action and method

Hi Stephiems,

Are you using same action class for pay() and save()?
If you are using different actions, then have you tried to associate
each submit with a form/s:form?
Do you have mentioned any action in your current form/s:form?

Since you are not getting an error, it may because of the above problem
or a problem similar to that. 

Thank you.
Regards,
Kishan.G
 
Senior Software Engineer.
www.spansystems.com




-Original Message-
From: Stephiems [mailto:stepha...@trexart.com.au] 
Sent: Thursday, April 30, 2009 2:06 PM
To: user@struts.apache.org
Subject: [s2] multiple submit buttons using action and method


I'm having a problem with the action and method values on the s:submit
tag.

I have a form where I have two submits, Save and Pay Now. Save submits
to
the actions save() method and Pay Now submits to the actions pay()
method.
In the pay() method I have some of my own validation, if it passes, I
forward it on to another action to make a payment, if it doesn't pass, I
return it to the screen they were just on and display an error message.

When they are directed back to the original page and shown the error
message, if they now press the Save submit, they are redirected to the
pay()
method as if they had pressed the Pay Now button, instead of going to
the
save() method.

I've also had problems with this tag where I've had to name the action
and
the method, not just the method, or else they don't work correctly
either.

I think I've possibly found a bug, but I wanted to check to make sure I
haven't done anything wrong before reporting it.

Cheers,
Stephanie
-- 
View this message in context:
http://www.nabble.com/-s2--multiple-submit-buttons-using-action-and-meth
od-tp23311584p23311584.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts 2 Portlet - Intermittent Session Problems

2009-04-22 Thread Kofford, C Todd
Good news! I resolved this issue. 

Even though it was NOT a struts problem, I still wanted to post back to this 
forum the issue and resolution.

It was being caused by a uportal (2.5.x, 2.6.x)  pluto 1.0.1 bug. 

I found the following uportal patch UP-1816 Objects attached to a 
PortletSession randomly disappear. http://www.ja-sig.org/issues/browse/UP-1816 

Since applying that patch, the issue has disappeared.

Thanks for all the suggestions!

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] 
Sent: Thursday, April 16, 2009 6:02 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet - Intermittent Session Problems

Great. Please post back with your findings.

Nils-H

On Thu, Apr 16, 2009 at 4:29 AM, Kofford, C Todd tkoff...@ku.edu wrote:
 Well, my log didn't seem to expose the problem when compared to a log from my 
 local machine where the problem did not show itself, because except for the 
 session = {} there was no difference.

 However, I did run across this uportal-specific bug when researching the 
 problem more.
 http://www.ja-sig.org/issues/browse/UP-1816

 It sounds like it is the exact same problem that I've been seeing. I'll test 
 the patch tomorrow and post the results (crossing fingers).

 I know that this is a struts forum, but I wanted to make sure that I didn't 
 leave this issue hanging, just in case others using struts  uportal come 
 across this issue.

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT

 -Original Message-
 From: Kofford, C Todd [mailto:tkoff...@ku.edu]
 Sent: Wed 4/15/2009 4:04 PM
 To: Struts Users Mailing List
 Subject: RE: Struts 2 Portlet - Intermittent Session Problems

 OK, I've now got a log with a sequence of events that causes the problem (see 
 below). However, I'm still not sure that I can determine where the request(s) 
 went wrong except for where session = {}.

 Any help would be appreciated. This one is driving me crazy.

 --Todd

 DEBUG [http-8090-Processor20] [localhost].[/Parking].[] Apr/15 14:58:17 - 
 servletPath=/Permits, pathInfo=null, queryString=null, name=null
 DEBUG [http-8090-Processor20] [localhost].[/Parking].[] Apr/15 14:58:17 -  
 Path Based Include
 DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 
 - Entering processAction
 DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 
 - serviceAction
 DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 
 - Creating action proxy for name = permitHomeIdBox, namespace = /permits
 DEBUG [http-8090-Processor20] xwork2.DefaultActionProxy.[] Apr/15 14:58:17 - 
 Creating an DefaultActionProxy for namespace /permits and action name 
 permitHomeIdBox
 DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 
 - intercept '/permits/permitHomeIdBox' {
 DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 
 - before Locale=en_US
 DEBUG [http-8090-Processor20] interceptor.PrefixMethodInvocationUtil.[] 
 Apr/15 14:58:17 - cannot find method [prepareIdBox] in action 
 [edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19]
 DEBUG [http-8090-Processor20] interceptor.PrefixMethodInvocationUtil.[] 
 Apr/15 14:58:17 - cannot find method [prepareDoIdBox] in action 
 [edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19]
 DEBUG [http-8090-Processor20] impl.InstantiatingNullHandler.[] Apr/15 
 14:58:17 - Entering nullPropertyValue 
 [target=[edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19, 
 com.opensymphony.xwork2.defaulttextprovi...@178991], property=id]
 DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - session = 
 {isPortletApp=true, parkingID=100080, 
 struts.portlet.valuestackfromeventphase=com.opensymphony.xwork2.ognl.ognlvaluest...@ba168e,
  faculty=edu.ku.it.sdd.si.parking.model.facultyrec...@1aac3f8}
 DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
 (A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
 key: student
 DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
 (A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
 key: faculty
 DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
 (A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
 key: permitOrder
 DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
 (A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
 key: isPortletApp
 DEBUG [http-8090-Processor20] impl.InstantiatingNullHandler.[] Apr/15 
 14:58:17 - Entering nullPropertyValue 
 [target=[edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19, 
 com.opensymphony.xwork2.defaulttextprovi...@178991], property=struts]
 DEBUG [http-8090-Processor20] interceptor.FileUploadInterceptor.[] Apr/15 
 14:58:17 - Bypassing /permits

RE: Struts 2 Portlet - Intermittent Session Problems

2009-04-15 Thread Kofford, C Todd
I'm using session scope (implements SessionAware).

No, I haven't deployed to a different portlet container.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] 
Sent: Wednesday, April 15, 2009 4:05 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet - Intermittent Session Problems

As long as you're using the portlet session, and not the
APPLICATION_SCOPE session, the sessions shouldn't interfere. Which
container are you running in? Have you tried deploying to a different
portlet container?

Nils-H

On Tue, Apr 14, 2009 at 8:01 PM, Kofford, C Todd tkoff...@ku.edu wrote:
 Hi Nils,

 Well this issue cannot be reproduced on a consistent basis. I can do the same 
 operation 4 times and 3 of the 4 times it works properly, but one time it 
 doesn't and the session disappears. It's very random.

 One thing that might be noteworthy is that I have 2 portlets defined for the 
 same web application. To clarify, I have one parking web application that 
 handles both citations and permit purchases. Citations and Permits are 
 defined as two individual portlets in the our portal, and both point to the 
 same parking webapp.

 I don't know if this is an issue or not. As random as this error is, I'm 
 wondering if the some jars are getting loaded up twice by tomcat and randomly 
 switching between two copies (of the same jar) as the requests are processed.

 Also to note is that this problem does not happen when the application(s) are 
 run outside the portal (i.e. as standalone webapps).

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT


 -Original Message-
 From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com]
 Sent: Friday, April 10, 2009 5:20 PM
 To: Struts Users Mailing List
 Subject: Re: Struts 2 Portlet - Intermittent Session Problems

 Hi!

 The PortletStateInterceptor does nothing special with the Session. It
 certainly does not invalidate it or remove stuff that's already there.
 The debug statement that you see is an indication that the portlet has
 been executed in the event phase, and the result has been properly
 configured with a redirectAction result. As a matter of fact, that log
 statement indicates that the interceptor is bypassing it's normal
 executing and does essentially nothing.

 Is this something you can reproduce consistently? In that case, do you
 have a sample that you could attach to a JIRA issue? Without more
 information, it's impossible to say what the problem could be (besides
 a regular session timeout or something...)

 Nils-H

 On Fri, Apr 10, 2009 at 10:13 PM, Kofford, C Todd tkoff...@ku.edu wrote:
 I have a struts 2 (version 2.1.6) portlet that I keep seeing
 intermittent problems with the session being wiped out. Each time this
 happens I see the following messages in the log:

 DEBUG [Thread-57] interceptor.PortletStateInterceptor.[] Apr/10 14:26:57
 - Won't restore stack from event phase since it's a proper PRG request
 ...
 DEBUG [Thread-57] PermitBaseAction.[] Apr/10 14:26:57 - session = {}

 I'm not sure what is going on here. In the event phase just prior to
 this render phase, my session is populated but then the ...proper RPG
 request  happens and my session is gone. I'm assuming that the portlet
 plugin gets into an invalid/mixed up state. But what would cause this?

 Any help would be appreciated.

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Struts 2 Portlet - Intermittent Session Problems

2009-04-15 Thread Kofford, C Todd
I've been trying to reproduce the problem, but can't do it consistently. I've 
never seen it when running on localhost only on our test server. I've also been 
cleaning up a lot of code, and I'm still not ruling out a logic (code) error.

No I'm not calling session.clear(), when I remove objects from session, I 
specifically remove the object that I put there in the first place, 
session.remove(key); Curious though, if I did call session.clear(), would a new 
session be created on the next request, or would the invalidated session 
persist?

I've put more thorough logging into the application in all areas that concern 
session and have also added a session listener (HttpSessionListener) to log 
when sessions are created and destroyed.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] 
Sent: Wednesday, April 15, 2009 8:46 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet - Intermittent Session Problems

It would be helpful if you tried it in a different container and
report your findings, and/or create a JIRA issue with a small sameple
application that can be used to reproduce the error.

Are you by any chance calling clear() on the session map? That would
invalidate the session.

Nils-H

On Wed, Apr 15, 2009 at 3:40 PM, Kofford, C Todd tkoff...@ku.edu wrote:
 I'm using session scope (implements SessionAware).

 No, I haven't deployed to a different portlet container.

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT


 -Original Message-
 From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com]
 Sent: Wednesday, April 15, 2009 4:05 AM
 To: Struts Users Mailing List
 Subject: Re: Struts 2 Portlet - Intermittent Session Problems

 As long as you're using the portlet session, and not the
 APPLICATION_SCOPE session, the sessions shouldn't interfere. Which
 container are you running in? Have you tried deploying to a different
 portlet container?

 Nils-H

 On Tue, Apr 14, 2009 at 8:01 PM, Kofford, C Todd tkoff...@ku.edu wrote:
 Hi Nils,

 Well this issue cannot be reproduced on a consistent basis. I can do the 
 same operation 4 times and 3 of the 4 times it works properly, but one time 
 it doesn't and the session disappears. It's very random.

 One thing that might be noteworthy is that I have 2 portlets defined for the 
 same web application. To clarify, I have one parking web application that 
 handles both citations and permit purchases. Citations and Permits are 
 defined as two individual portlets in the our portal, and both point to the 
 same parking webapp.

 I don't know if this is an issue or not. As random as this error is, I'm 
 wondering if the some jars are getting loaded up twice by tomcat and 
 randomly switching between two copies (of the same jar) as the requests are 
 processed.

 Also to note is that this problem does not happen when the application(s) 
 are run outside the portal (i.e. as standalone webapps).

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT


 -Original Message-
 From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com]
 Sent: Friday, April 10, 2009 5:20 PM
 To: Struts Users Mailing List
 Subject: Re: Struts 2 Portlet - Intermittent Session Problems

 Hi!

 The PortletStateInterceptor does nothing special with the Session. It
 certainly does not invalidate it or remove stuff that's already there.
 The debug statement that you see is an indication that the portlet has
 been executed in the event phase, and the result has been properly
 configured with a redirectAction result. As a matter of fact, that log
 statement indicates that the interceptor is bypassing it's normal
 executing and does essentially nothing.

 Is this something you can reproduce consistently? In that case, do you
 have a sample that you could attach to a JIRA issue? Without more
 information, it's impossible to say what the problem could be (besides
 a regular session timeout or something...)

 Nils-H

 On Fri, Apr 10, 2009 at 10:13 PM, Kofford, C Todd tkoff...@ku.edu wrote:
 I have a struts 2 (version 2.1.6) portlet that I keep seeing
 intermittent problems with the session being wiped out. Each time this
 happens I see the following messages in the log:

 DEBUG [Thread-57] interceptor.PortletStateInterceptor.[] Apr/10 14:26:57
 - Won't restore stack from event phase since it's a proper PRG request
 ...
 DEBUG [Thread-57] PermitBaseAction.[] Apr/10 14:26:57 - session = {}

 I'm not sure what is going on here. In the event phase just prior to
 this render phase, my session is populated but then the ...proper RPG
 request  happens and my session is gone. I'm assuming that the portlet
 plugin gets into an invalid/mixed up state. But what would cause this?

 Any help would be appreciated.

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT


 -
 To unsubscribe, e-mail: user-unsubscr

RE: Struts 2 Portlet - Intermittent Session Problems

2009-04-15 Thread Kofford, C Todd
.conversion.impl.xworkbasicconver...@2083d]
DEBUG [http-8090-Processor20] validation.AnnotationValidationInterceptor.[] 
Apr/15 14:58:17 - Validating /permits/permitHomeIdBox with method idBox.
DEBUG [http-8090-Processor20] interceptor.DefaultWorkflowInterceptor.[] Apr/15 
14:58:17 - Invoking validate() on action 
edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19
DEBUG [http-8090-Processor20] xwork2.DefaultActionInvocation.[] Apr/15 14:58:17 
- Executing action method = idBox
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): resetSession() called
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): removeFromSession() called, removing key: 
faculty
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): saveToSession() called, saving key: faculty
DEBUG [http-8090-Processor20] result.PortletResult.[] Apr/15 14:58:17 - 
Executing result in Event phase
DEBUG [http-8090-Processor20] result.PortletResult.[] Apr/15 14:58:17 - Setting 
event render parameter: /permits/selectPermitInput.action
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - 
after Locale=en_US
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - 
intercept } 
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - 
Leaving processAction
DEBUG [Thread-62] [localhost].[/Parking].[] Apr/15 14:58:18 - 
servletPath=/Permits, pathInfo=null, queryString=null, name=null
DEBUG [Thread-62] [localhost].[/Parking].[] Apr/15 14:58:18 -  Path Based 
Include
DEBUG [Thread-62] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:18 - Entering 
render
DEBUG [Thread-62] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:18 - serviceAction
DEBUG [Thread-62] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:18 - Creating 
action proxy for name = selectPermitInput, namespace = /permits
DEBUG [Thread-62] xwork2.DefaultActionProxy.[] Apr/15 14:58:18 - Creating an 
DefaultActionProxy for namespace /permits and action name selectPermitInput
DEBUG [Thread-62] interceptor.PortletStateInterceptor.[] Apr/15 14:58:18 - 
Won't restore stack from event phase since it's a proper PRG request
DEBUG [Thread-62] interceptor.I18nInterceptor.[] Apr/15 14:58:18 - intercept 
'/permits/selectPermitInput' { 
DEBUG [Thread-62] interceptor.I18nInterceptor.[] Apr/15 14:58:18 - before 
Locale=en_US
DEBUG [Thread-62] interceptor.PrefixMethodInvocationUtil.[] Apr/15 14:58:18 - 
cannot find method [prepareInput] in action 
[edu.ku.it.sdd.si.parking.permits.action.selectperm...@a4ffc6]
DEBUG [Thread-62] interceptor.PrefixMethodInvocationUtil.[] Apr/15 14:58:18 - 
cannot find method [prepareDoInput] in action 
[edu.ku.it.sdd.si.parking.permits.action.selectperm...@a4ffc6]
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - session = {}
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: student
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: faculty
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: permitOrder
DEBUG [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: isPortletApp
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - PARKING PERMITS
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Parking id: 0
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - Date/time: 2009-04-15 
14:58:18
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - 
ERROR [Thread-62] PermitBaseAction.[] Apr/15 14:58:18 - 
java.lang.NullPointerException
at 
edu.ku.it.sdd.si.parking.permits.service.PermitSelectionServiceImpl.getAllowedPermitsEmployee(PermitSelectionServiceImpl.java:73)
at 
edu.ku.it.sdd.si.parking.permits.action.SelectPermits.prepare(SelectPermits.java:86)
at 
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:134)
...



-Original Message-
From: Kofford, C Todd [mailto:tkoff...@ku.edu] 
Sent: Wednesday, April 15, 2009 8:57 AM
To: Struts Users Mailing List
Subject: RE: Struts 2 Portlet - Intermittent Session Problems

I've been trying to reproduce the problem, but can't do it consistently. I've 
never seen it when running on localhost only on our test server. I've also been 
cleaning up a lot of code, and I'm still not ruling out a logic (code) error.

No I'm not calling session.clear(), when I remove objects from session, I 
specifically remove the object that I put there in the first place, 
session.remove(key); Curious though, if I did call session.clear(), would a new 
session be created on the next request

RE: Struts 2 Portlet - Intermittent Session Problems

2009-04-15 Thread Kofford, C Todd
Well, my log didn't seem to expose the problem when compared to a log from my 
local machine where the problem did not show itself, because except for the 
session = {} there was no difference.

However, I did run across this uportal-specific bug when researching the 
problem more.
http://www.ja-sig.org/issues/browse/UP-1816

It sounds like it is the exact same problem that I've been seeing. I'll test 
the patch tomorrow and post the results (crossing fingers).

I know that this is a struts forum, but I wanted to make sure that I didn't 
leave this issue hanging, just in case others using struts  uportal come 
across this issue.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT

-Original Message-
From: Kofford, C Todd [mailto:tkoff...@ku.edu]
Sent: Wed 4/15/2009 4:04 PM
To: Struts Users Mailing List
Subject: RE: Struts 2 Portlet - Intermittent Session Problems
 
OK, I've now got a log with a sequence of events that causes the problem (see 
below). However, I'm still not sure that I can determine where the request(s) 
went wrong except for where session = {}.

Any help would be appreciated. This one is driving me crazy.

--Todd

DEBUG [http-8090-Processor20] [localhost].[/Parking].[] Apr/15 14:58:17 - 
servletPath=/Permits, pathInfo=null, queryString=null, name=null
DEBUG [http-8090-Processor20] [localhost].[/Parking].[] Apr/15 14:58:17 -  Path 
Based Include
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - 
Entering processAction
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - 
serviceAction
DEBUG [http-8090-Processor20] dispatcher.Jsr168Dispatcher.[] Apr/15 14:58:17 - 
Creating action proxy for name = permitHomeIdBox, namespace = /permits
DEBUG [http-8090-Processor20] xwork2.DefaultActionProxy.[] Apr/15 14:58:17 - 
Creating an DefaultActionProxy for namespace /permits and action name 
permitHomeIdBox
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - 
intercept '/permits/permitHomeIdBox' { 
DEBUG [http-8090-Processor20] interceptor.I18nInterceptor.[] Apr/15 14:58:17 - 
before Locale=en_US
DEBUG [http-8090-Processor20] interceptor.PrefixMethodInvocationUtil.[] Apr/15 
14:58:17 - cannot find method [prepareIdBox] in action 
[edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19]
DEBUG [http-8090-Processor20] interceptor.PrefixMethodInvocationUtil.[] Apr/15 
14:58:17 - cannot find method [prepareDoIdBox] in action 
[edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19]
DEBUG [http-8090-Processor20] impl.InstantiatingNullHandler.[] Apr/15 14:58:17 
- Entering nullPropertyValue 
[target=[edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19, 
com.opensymphony.xwork2.defaulttextprovi...@178991], property=id]
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - session = 
{isPortletApp=true, parkingID=100080, 
struts.portlet.valuestackfromeventphase=com.opensymphony.xwork2.ognl.ognlvaluest...@ba168e,
 faculty=edu.ku.it.sdd.si.parking.model.facultyrec...@1aac3f8}
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: student
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: faculty
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: permitOrder
DEBUG [http-8090-Processor20] PermitBaseAction.[] Apr/15 14:58:17 - Session 
(A48726E2C673AA84704CB021D1017827): retrieveFromSession() called, retriving 
key: isPortletApp
DEBUG [http-8090-Processor20] impl.InstantiatingNullHandler.[] Apr/15 14:58:17 
- Entering nullPropertyValue 
[target=[edu.ku.it.sdd.si.parking.permits.action.permitsh...@7f2a19, 
com.opensymphony.xwork2.defaulttextprovi...@178991], property=struts]
DEBUG [http-8090-Processor20] interceptor.FileUploadInterceptor.[] Apr/15 
14:58:17 - Bypassing /permits/permitHomeIdBox
DEBUG [http-8090-Processor20] interceptor.StaticParametersInterceptor.[] Apr/15 
14:58:17 - Setting static parameters {}
DEBUG [http-8090-Processor20] interceptor.ParametersInterceptor.[] Apr/15 
14:58:17 - Setting params NONE
DEBUG [http-8090-Processor20] interceptor.ParametersInterceptor.[] Apr/15 
14:58:17 - Setting params employeeid = [ 1359156 ] struts.portlet.action = [ 
/permits/permits/permitHomeIdBox ] struts.portlet.mode = [ view ] studentid = 
[  ] 
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - 
Property: employeeid
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - Class: 
edu.ku.it.sdd.si.parking.permits.action.PermitsHome
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - 
field-level type converter for property [employeeid] = none found
DEBUG [http-8090-Processor20] impl.XWorkConverter.[] Apr/15 14:58:17 - 
global

RE: Struts 2 Portlet - Intermittent Session Problems

2009-04-14 Thread Kofford, C Todd
Hi Nils,

Well this issue cannot be reproduced on a consistent basis. I can do the same 
operation 4 times and 3 of the 4 times it works properly, but one time it 
doesn't and the session disappears. It's very random.

One thing that might be noteworthy is that I have 2 portlets defined for the 
same web application. To clarify, I have one parking web application that 
handles both citations and permit purchases. Citations and Permits are defined 
as two individual portlets in the our portal, and both point to the same 
parking webapp. 

I don't know if this is an issue or not. As random as this error is, I'm 
wondering if the some jars are getting loaded up twice by tomcat and randomly 
switching between two copies (of the same jar) as the requests are processed.

Also to note is that this problem does not happen when the application(s) are 
run outside the portal (i.e. as standalone webapps).

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-Original Message-
From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] 
Sent: Friday, April 10, 2009 5:20 PM
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet - Intermittent Session Problems

Hi!

The PortletStateInterceptor does nothing special with the Session. It
certainly does not invalidate it or remove stuff that's already there.
The debug statement that you see is an indication that the portlet has
been executed in the event phase, and the result has been properly
configured with a redirectAction result. As a matter of fact, that log
statement indicates that the interceptor is bypassing it's normal
executing and does essentially nothing.

Is this something you can reproduce consistently? In that case, do you
have a sample that you could attach to a JIRA issue? Without more
information, it's impossible to say what the problem could be (besides
a regular session timeout or something...)

Nils-H

On Fri, Apr 10, 2009 at 10:13 PM, Kofford, C Todd tkoff...@ku.edu wrote:
 I have a struts 2 (version 2.1.6) portlet that I keep seeing
 intermittent problems with the session being wiped out. Each time this
 happens I see the following messages in the log:

 DEBUG [Thread-57] interceptor.PortletStateInterceptor.[] Apr/10 14:26:57
 - Won't restore stack from event phase since it's a proper PRG request
 ...
 DEBUG [Thread-57] PermitBaseAction.[] Apr/10 14:26:57 - session = {}

 I'm not sure what is going on here. In the event phase just prior to
 this render phase, my session is populated but then the ...proper RPG
 request  happens and my session is gone. I'm assuming that the portlet
 plugin gets into an invalid/mixed up state. But what would cause this?

 Any help would be appreciated.

 Todd Kofford
 tkoff...@ku.edu
 University of Kansas - IT


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts 2 Portlet - Intermittent Session Problems

2009-04-10 Thread Kofford, C Todd
I have a struts 2 (version 2.1.6) portlet that I keep seeing
intermittent problems with the session being wiped out. Each time this
happens I see the following messages in the log:

DEBUG [Thread-57] interceptor.PortletStateInterceptor.[] Apr/10 14:26:57
- Won't restore stack from event phase since it's a proper PRG request
...
DEBUG [Thread-57] PermitBaseAction.[] Apr/10 14:26:57 - session = {}

I'm not sure what is going on here. In the event phase just prior to
this render phase, my session is populated but then the ...proper RPG
request  happens and my session is gone. I'm assuming that the portlet
plugin gets into an invalid/mixed up state. But what would cause this?

Any help would be appreciated.

Todd Kofford
tkoff...@ku.edu
University of Kansas - IT


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org