Re: [S2] How to apply form based security in struts 2 application

2009-02-07 Thread alee amin
thanks
..alee
http://techboard.wordpress.com



On Thu, Feb 5, 2009 at 6:25 AM, dusty  wrote:

>
> +1 Spring Security.  Everything else is for wimps.
>
>
>
> Wes Wannemacher wrote:
> >
> > On Wednesday 04 February 2009 05:56:24 alee amin wrote:
> >> I browsed through struts official site to check for any plugin available
> >> or
> >> security mechanism to authenticate the user. but i could not find one.
> >> can
> >> anyone guide me what are teh ways to implement the security constraints
> >> (user security) on application.
> >>
> >> ..alee
> >> http://techboard.wordpress.com
> >
> > There are really 3 main choices,
> >
> > 1. Container managed security... If you are using Tomcat, check the docs
> > here-
> > http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html
> > Advantage - Part of Spec
> > Disadvantage - Doesn't always port to other app servers
> >
> > 2. Roll your own s2 interceptor... Check Mark Menard's tutorial -
> >
> http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor
> > Advantage - very Struts-y
> > Disadvantage - Not necessarily full-featured
> >
> > 3. Use Spring Security.
> > http://static.springframework.org/spring-security/site/index.html
> > Advantage - Super-Flexible, ports well to any app server
> > Disadvantage - steep learning curve, but after a bit of time, it all
> falls
> > into place.
> >
> > -Wes
> >
> > --
> >
> > Wes Wannemacher
> > Author - Struts 2 In Practice
> > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> > http://www.manning.com/wannemacher
> >
> >
> > -
> > 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/-S2--How-to-apply-form-based-security-in-struts-2-application-tp21828303p21843440.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
>
>


Re: How to use "s:include" param in s:if

2009-02-07 Thread Struts Two
I was trying to avoid <% if() ...%> in my jsps by using request Object and 
since I am not using JSTL in favor of struts 2 tags, 
tag is not possible.

I have managed to get around the problem with a less favorable approach. My 
 now looks like:






and in my tabs.jsp I have someting:

...
...

What I do not like about this approach is If I add a new tab, I not only have 
to update tabs.jsp but every single jsp that includes it.

I believe  tag should be able to handle a simple case like the one I 
was trying to do.

Anyways, thank you for your replies and time.






--- On Fri, 2/6/09, Wes Wannemacher  wrote:

> From: Wes Wannemacher 
> Subject: Re: How to use "s:include" param in s:if
> To: "Struts Users Mailing List" 
> Received: Friday, February 6, 2009, 11:48 PM
> On Friday 06 February 2009 18:27:18 Struts Two wrote:
> > Wes ,
> >
> > Thank you for your reply, Unfortunately that does not
> work. The if
> > statement return false [I print ${param.tab1} on the
> page and it has the
> > value 'tab1' yet if statement is false]. I am
> using struts 2.0.14.
> >
> 
> Hmm... Strange. I don't know if it matters, but
> ${param.tab1} probably works 
> because it's a legit EL expression. Your include points
> directly to a JSP, 
> rather than an action. Try doing the whole thing in EL, you
> might be able to 
> accomplish what you're looking for with less hassle. 
> 
> -Wes
> 
> 
> -- 
> 
> Wes Wannemacher
> Author - Struts 2 In Practice 
> Includes coverage of Struts 2.1, Spring, JPA, JQuery,
> Sitemesh and more
> http://www.manning.com/wannemacher
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail:
> user-h...@struts.apache.org


  __
Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! 
Canada Messenger at http://ca.beta.messenger.yahoo.com/


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



struts2 rest plugin

2009-02-07 Thread Andy

Can this plugin re-write the urls generated by struts2 jsp tags to be more 
rest/rubyonrails-like?  ex.  ?user=123   -->   /user/123

The plugin doesn't appear to be regex-based, is that correct?  

I'm trying to decide if I am going to use the rest plugin or 
http://tuckey.org/urlrewrite.

Thanks


_
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

Re: [ANN] "Ajax on Struts 2" Training at ApacheCon Europe

2009-02-07 Thread ChadDavis
> Its good to hear... Is there any possibility of getting video of the session
> or the presentations.. this will be useful for the developers who are not
> able to come to the conference, at least for the developers in other
> countries...

They don't publish the trainings like that.  I'm not sure why.  But
I'll publish blog versions of everything either as I'm preparing the
training, or shortly after the training.  It won't be the same as
being in the room, but it will cover the same content.

My Blog:  http://zeroinsertionforce.blogspot.com/

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



RE: Can I use a Parameter in result definition?

2009-02-07 Thread Griffith, Michael *
Dave, 

Thanks for the reply, and the suggestion~

Cheers!
MG 

-Original Message-
From: Dale Newfield [mailto:d...@newfield.org] 
Sent: Friday, February 06, 2009 5:23 PM
To: Struts Users Mailing List
Subject: Re: Can I use a Parameter in result definition?

Griffith, Michael * wrote:
> Cool, but looking at the doc, it looks like the only place I can 
> declare a parm is in the result tag?

It looked like the only place you wanted to use this substitution was in
a result tag.  I didn't notice what value it was you wanted until now.

The action is on top of the value stack when that's evaluated, and there
should be some way to get to that info from there...so if you make your
BaseAction class include a getNamespace() method that does the right
thing, you can say %{namespace} in the struts.xml like you asked.

I've got to sign off, so I'm not providing the magic incantation to get
this from the action, but I bet there's some way to get it.  I don't see
it right now, but I thought there used to be an ActionMappingAware
interface, for example...

-Dale

-
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



Problem with Jboss 4.2.3.GA and convention plug-in 2.1.6

2009-02-07 Thread Jerome ROBERT
Hi to all,
I try to deploy a struts2 application, using convention plug-in in JBoss
4.2.3.GA. All I get is a weird error (see below)
and the weidest thing about it is that all i have to do to get this error is
to drop de convention plug-in into a working struts2 application.
I got the stack trace below just by deploying an unmodifided  struts blank
application (struts2-blank-2.1.6.war) in which i just dropped the
convention plug-in... any ideas of what's going on ?
Thank you in advance. (I apologize for my terrible english)

Jerome.


22:31:28,260 INFO  [XmlConfigurationProvider] Parsing configuration file
[struts-default.xml]
22:31:28,740 INFO  [XmlConfigurationProvider] Parsing configuration file
[struts-plugin.xml]
22:31:28,891 INFO  [XmlConfigurationProvider] Parsing configuration file
[struts.xml]
22:31:30,974 ERROR [STDERR] java.lang.Exception: Could not load
jbossmq-httpil/war/WEB-INF/classes/o
rg/jboss/mq/il/http/servlet/HTTPServerILServlet.class
22:31:30,984 ERROR [STDERR] at
com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(Clas
sFinder.java:745)
22:31:30,984 ERROR [STDERR] at
com.opensymphony.xwork2.util.finder.ClassFinder.(ClassFinde
r.java:148)
22:31:30,984 ERROR [STDERR] at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.fin
dActions(PackageBasedActionConfigBuilder.java:295)
22:31:30,994 ERROR [STDERR] at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.bui
ldActionConfigs(PackageBasedActionConfigBuilder.java:277)
22:31:30,994 ERROR [STDERR] at
org.apache.struts2.convention.ClasspathPackageProvider.loadPackag
es(ClasspathPackageProvider.java:52)
22:31:30,994 ERROR [STDERR] at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadCo
ntainer(DefaultConfiguration.java:200)
22:31:31,004 ERROR [STDERR] at
com.opensymphony.xwork2.config.ConfigurationManager.getConfigurat
ion(ConfigurationManager.java:55)
22:31:31,004 ERROR [STDERR] at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguratio
n(Dispatcher.java:360)
22:31:31,034 ERROR [STDERR] at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403
)
22:31:31,034 ERROR [STDERR] at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(In
itOperations.java:69)
22:31:31,034 ERROR [STDERR] at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFi
lter.init(StrutsPrepareAndExecuteFilter.java:48)


Re: Problem with Jboss 4.2.3.GA and convention plug-in 2.1.6

2009-02-07 Thread Musachy Barroso
The convention plugin found a class that it thinks is an action, and
it is trying to load it, and failing in the process. Setting the debug
level to debug should give you more information on what class it is
etc.

musachy

On Sat, Feb 7, 2009 at 4:50 PM, Jerome ROBERT  wrote:
> Hi to all,
> I try to deploy a struts2 application, using convention plug-in in JBoss
> 4.2.3.GA. All I get is a weird error (see below)
> and the weidest thing about it is that all i have to do to get this error is
> to drop de convention plug-in into a working struts2 application.
> I got the stack trace below just by deploying an unmodifided  struts blank
> application (struts2-blank-2.1.6.war) in which i just dropped the
> convention plug-in... any ideas of what's going on ?
> Thank you in advance. (I apologize for my terrible english)
>
> Jerome.
>
>
> 22:31:28,260 INFO  [XmlConfigurationProvider] Parsing configuration file
> [struts-default.xml]
> 22:31:28,740 INFO  [XmlConfigurationProvider] Parsing configuration file
> [struts-plugin.xml]
> 22:31:28,891 INFO  [XmlConfigurationProvider] Parsing configuration file
> [struts.xml]
> 22:31:30,974 ERROR [STDERR] java.lang.Exception: Could not load
> jbossmq-httpil/war/WEB-INF/classes/o
> rg/jboss/mq/il/http/servlet/HTTPServerILServlet.class
> 22:31:30,984 ERROR [STDERR] at
> com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(Clas
> sFinder.java:745)
> 22:31:30,984 ERROR [STDERR] at
> com.opensymphony.xwork2.util.finder.ClassFinder.(ClassFinde
> r.java:148)
> 22:31:30,984 ERROR [STDERR] at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.fin
> dActions(PackageBasedActionConfigBuilder.java:295)
> 22:31:30,994 ERROR [STDERR] at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.bui
> ldActionConfigs(PackageBasedActionConfigBuilder.java:277)
> 22:31:30,994 ERROR [STDERR] at
> org.apache.struts2.convention.ClasspathPackageProvider.loadPackag
> es(ClasspathPackageProvider.java:52)
> 22:31:30,994 ERROR [STDERR] at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadCo
> ntainer(DefaultConfiguration.java:200)
> 22:31:31,004 ERROR [STDERR] at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfigurat
> ion(ConfigurationManager.java:55)
> 22:31:31,004 ERROR [STDERR] at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguratio
> n(Dispatcher.java:360)
> 22:31:31,034 ERROR [STDERR] at
> org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403
> )
> 22:31:31,034 ERROR [STDERR] at
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(In
> itOperations.java:69)
> 22:31:31,034 ERROR [STDERR] at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFi
> lter.init(StrutsPrepareAndExecuteFilter.java:48)
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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



VS: Form Submit & Passing Post Data to Action with JSON Plugin

2009-02-07 Thread Christer Gjerstad



> Hi, 
> 
> I have a page with some seach criteria for the user to specify. The result
> of the search will be displayed on another page which will be rendered
> using Dojo script and Json result, using the JSON plugin. 
> 
> In the book "Practical Apache Struts2 Web 2.0 projects" written by Ian
> Roughley (Great book by the way!). There is an example, chapter 10, for
> handling JSON results from actions with a Dojo script which does not pass
> any input data to the action, which is the case I am trying to do.
> 
> So, I have one seach page with a form submitting this with post method to
> a pass-throug action in the same package(defined in struts.xml). The
> pass-through action has a result to the a jsonResult.jsp page where a Dojo
> script is calling the action doing the seach to the business layer and
> returning a JSON result. Please see below for more info. My problem is
> that the post data is not passed into the action class calling the
> business layer and returning the JSON result. 
> 
> I have search the Web for any ideas or solutions but cannot find anything.
> 
> 
> How can I get the post data from the search form to the productsJsonResult
> action? Do I have to capture the post data from the request and handle
> that in the Dojo script? Should't the param interceptor handle this? 
> 
> I would appreciate any help in this matter! :-) 
> 
> 
> Here are the packages and actions.
> 
> 
> Flow: Submit Search -> productSearchResult action invoked ->
> productSearchJsonResult.jsp called -> Dojo script calling
> productsJsonResult action and handling html rendering.
> 
> 
> 
> 
> 
>   
>  
>class="com.demand.product.ProductSearch">
>   /jsp/product/productSearch.jsp
>  
>   
>
>class="com.demand.product.BaseProductAction"> 
>   /jsp/product/productSearch.jsp
> 
>   /jsp/product/productSearchJsonResult.jsp
>   
>   
> 
>   
>   
>  extends="json-default">
>   
>   
>   
>class="com.demand.product.ProductSearchResults">  
>   
>   products
>  
>  
>   
> 
> 
> 
> 
> 
> With kind regards 
> 
> Christer Gjerstad 
> 
> 
> 


How to initialize a List property through action configuration

2009-02-07 Thread Struts Two
If I have a property such as

private List myList;



Is there a way that I can initialize the list through action configuration? I 
have tried the following:

#action name="queueContent" class="ccol.action.queue.QueueRead"   
method="getMyQueueContent"#   
#param name="myList"#  {Alarmed,Open} #/param#
#result name="success"#  myQueueContent  #/result#
 #/action#

and

#action name="queueContent" class="ccol.action.queue.QueueRead"   
method="getMyQueueContent"#   
#param name="myList"#  Alarmed #/param#
#param name="myList"#  Open #/param#
#result name="success"#myQueueContent#/result#
 #/action#

For the last case, the list is initialized with Open [which makes sense as 
Alarmed gets overwritten, but I just wanted to try].


  __
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail 
today or register for free at http://mail.yahoo.ca


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



Re: trouble deploying struts2 app to tomcat 1.5.0.05

2009-02-07 Thread Dave Newton
I'd try to run it with a more recent HP-UX JVM and I'd look for known 
issues with the HP-UX JVM.


Dave

Wick, Dan wrote:

Ok, to make the problem more simplified...I took the
struts2-blank-2.0.12.war application & deployed it to my local tomcat.
That works.

Took the same war & deployed it to my server environment tomcat - FAILS.
Note that I have commented out every other application running there, so
it's a 1 to 1 comparison between local & server.

Difference between server & local is:
Local Tomcat: 5.5.17
Local JVM: 1.5.0_13
---
Server Tomcat: 5.5.20
Server JVM: 1.5.0.05-_17_oct_2006_02_15

Does anyone know the differences between these versions well?  What
could be the culprit!?!

Stack for struts-blank on the server is:
Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException:
org.apache.struts2.dispatcher.FilterDispatcher
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(Unknown
Source)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Unknown
Source)
at
org.apache.catalina.core.ApplicationFilterConfig.(Unknown Source)
at org.apache.catalina.core.StandardContext.filterStart(Unknown
Source)
at org.apache.catalina.core.StandardContext.start(Unknown
Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardHost.start(Unknown Source)
at org.apache.catalina.core.ContainerBase.start(Unknown Source)
at org.apache.catalina.core.StandardEngine.start(Unknown Source)
at org.apache.catalina.core.StandardService.start(Unknown
Source)
at org.apache.catalina.core.StandardServer.start(Unknown Source)
at org.apache.catalina.startup.Catalina.start(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Unknown Source)
at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/blank] startup failed due to previous errors
Feb 6, 2009 1:15:50 PM org.apache.catalina.core.ApplicationCont


Looks very familiar...in fact exactly the same stack I get with my app.
Any suggestions on where to go from here!

--Dan


-
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: How to initialize a List property through action configuration

2009-02-07 Thread Dave Newton
Please send brand new messages when starting new threads, otherwise the 
new threads are deeply embedded in existing, different threads.


http://i43.tinypic.com/3326m44.png

Dave

Struts Two wrote:

If I have a property such as

private List myList;



Is there a way that I can initialize the list through action configuration? I 
have tried the following:

#action name="queueContent" class="ccol.action.queue.QueueRead"   
method="getMyQueueContent"# 
#param name="myList"#  {Alarmed,Open} #/param#
#result name="success"#  myQueueContent  #/result#
 #/action#

and

#action name="queueContent" class="ccol.action.queue.QueueRead"   
method="getMyQueueContent"# 
#param name="myList"#  Alarmed #/param#
#param name="myList"#  Open #/param#
#result name="success"#myQueueContent#/result#
 #/action#

For the last case, the list is initialized with Open [which makes sense as 
Alarmed gets overwritten, but I just wanted to try].


  __
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail 
today or register for free at http://mail.yahoo.ca


-
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: How to initialize a List property through action configuration

2009-02-07 Thread Martin Gainty

any objections to allocating on the stack
?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Sat, 7 Feb 2009 19:49:46 -0500
> From: newton.d...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: How to initialize a List property through action configuration
> 
> Please send brand new messages when starting new threads, otherwise the 
> new threads are deeply embedded in existing, different threads.
> 
> http://i43.tinypic.com/3326m44.png
> 
> Dave
> 
> Struts Two wrote:
> > If I have a property such as
> > 
> > private List myList;
> > 
> > 
> > 
> > Is there a way that I can initialize the list through action configuration? 
> > I have tried the following:
> > 
> > #action name="queueContent" class="ccol.action.queue.QueueRead"   
> > method="getMyQueueContent"#   
> > #param name="myList"#  {Alarmed,Open} #/param#
> > #result name="success"#  myQueueContent  #/result#
> >  #/action#
> > 
> > and
> > 
> > #action name="queueContent" class="ccol.action.queue.QueueRead"   
> > method="getMyQueueContent"#   
> > #param name="myList"#  Alarmed #/param#
> > #param name="myList"#  Open #/param#
> > #result name="success"#myQueueContent#/result#
> >  #/action#
> > 
> > For the last case, the list is initialized with Open [which makes sense as 
> > Alarmed gets overwritten, but I just wanted to try].
> > 
> > 
> >   __
> > Be smarter than spam. See how smart SpamGuard is at giving junk email the 
> > boot with the All-new Yahoo! Mail.  Click on Options in Mail and switch to 
> > New Mail today or register for free at http://mail.yahoo.ca
> > 
> > 
> > -
> > 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
> 

_
Windows Liveā„¢: Keep your life in sync. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_022009

Re: [S2][Convention] how to intercept all my actions

2009-02-07 Thread caopeng...@foxmail.com
Thanks very much!

I'm looking for the solution for a long time, Thanks for your help!