Re: how to get config info from portlet.xml in struts2 action

2009-01-08 Thread Daoyue Ming
servlet-config is used for getting parameter, session objects, etc. however I found the solution for my case, no need to use PortletContextAware interface, just use PortletActionContext.getPortletConfig() to get the PortletConfig object, then retrieve the info from this object is ok. On Thu, Jan

Re: default mapping with annotation

2009-01-08 Thread Daniel Woo
I think I probably always use explicit mapping in annotation or XML, and not using the wild card fall-back mapping. It won't be too much burden for me to explicitly do that and that's also less error-prone. Thanks a lot for your suggestion! Wes Wannemacher wrote: > > On Thu, 2009-01-08 at 21:09

Re: Conditional Annotation based Validation

2009-01-08 Thread Dirk Forchel
Thank you for your posting. I already know how to use the @FieldExpressionValidator and annotations at property level (on setter methods) or how to use the validators with annotations at method level (@Validations for an execute() method). But I did not get it work with the @ExpressionValidator an

Re: default mapping with annotation

2009-01-08 Thread Wes Wannemacher
On Thu, 2009-01-08 at 21:09 -0800, Daniel Woo wrote: > I am using Conventions since annotation is moved into Conventions in 2.1.2. > The problem is that I like explicit declaration of Action/URL/namespace etc > in annotations rather than implicit declaration provided by Convertion, only > for a fe

Re: default mapping with annotation

2009-01-08 Thread Daniel Woo
Wes Wannemacher wrote: > > I'm surprised this works, order is significant, so the wildcard would > match and look for _HelloWorld.jsp... But, since you indicate that it > does, I'm guessing in your struts.xml, you have the right order. > Yep, I have the right order in my struts.xml, this is a

Re: default mapping with annotation

2009-01-08 Thread Wes Wannemacher
On Thu, 2009-01-08 at 20:23 -0800, Daniel Woo wrote: > Hi guys, > > I have a default mapping, eg, > > Code: > > /_{1}.jsp > > > /HelloWorld.jsp > > I'm surprised this works, order is significant, so the wildcard would match and look for _HelloWorld.jsp... But, si

default mapping with annotation

2009-01-08 Thread Daniel Woo
Hi guys, I have a default mapping, eg, Code: /_{1}.jsp /HelloWorld.jsp In this case, if an action can not be matched it will be forwarded to /_{action name}.jsp, eg, /X.action will be forwarded to _X.jsp It works great, however if I remove XML configurations o

Struts2 ajaxified autocompleter is shrinking when use back tab

2009-01-08 Thread Sashik
Hi I was using struts.2.0.11 version. Implemented autocompleter feature using ajax. here is the example of the tag. Auto completer works fine. But when I use back button to retype is auto matically shrinks and suddenly shows only one row with a down/up arrows buttons in the right corner. T

Re: s:a tag

2009-01-08 Thread Jaarthy
But how can I implement Ajax in that? Nils-Helge Garli wrote: > > You can combine and to create your links. > > http://struts.apache.org/2.1.2/docs/url.html > > Nils-H > > On Thu, Jan 8, 2009 at 6:46 PM, Jaarthy wrote: >> >> Hi, >> >> when i am using its creating >> the >> URL like htt

Re: s:a tag

2009-01-08 Thread Nils-Helge Garli Hegvik
You can combine and to create your links. http://struts.apache.org/2.1.2/docs/url.html Nils-H On Thu, Jan 8, 2009 at 6:46 PM, Jaarthy wrote: > > Hi, > > when i am using its creating the > URL like http://localhost:8080/mywebapp/#. > > When I remove the ajax theme,I get > http://localhost:808

Re: Searching Value Stack - OGNL

2009-01-08 Thread Musachy Barroso
Struts iterates on the stack until it finds a result, unless a named object is used in the expression (no iteration, just a direct lookup). So yeah, if you use #request.xyz and xyz is in the request scope, it will be faster. musachy On Thu, Jan 8, 2009 at 1:21 PM, Andy wrote: > > Would specifyin

Searching Value Stack - OGNL

2009-01-08 Thread Andy
Would specifying a scope (ex. #request) speed up OGNL searches of the Value Stack? Otherwise I would image the Value Stack would have to search all scopes if scope was not specified? If I have 1,000 items in the Value Stack and the Value Stack is searched 50 times (50 tags in my JSP), then th

Re: Conditional Annotation based Validation

2009-01-08 Thread Greg Lindholm
You can use @FieldExpressionValidator and @ExpressionValidator annotations which allow you to write complex conditions. Here is an example a plucked from my code: @FieldExpressionValidator(expression = "!create || !password.trim().isEmpty()", message = "required", key = ERROR_PASSWORD_REQUIR

s:a tag

2009-01-08 Thread Jaarthy
Hi, when i am using its creating the URL like http://localhost:8080/mywebapp/#. When I remove the ajax theme,I get http://localhost:8080/mywebapp/someaction.action.I want to use ajax theme,but I want my url to be like http://localhost:8080/mywebapp/someaction.action Pls. help Thanks, Aar

RE: Error Throwing With Struts 2 Tags

2009-01-08 Thread Andy
This would be a nice-to-have.. Patch would be to add a LOG.info() or throw an exception in org.apache.struts2.components.Property.start().. > Date: Tue, 6 Jan 2009 16:23:40 -0500> From: newton.d...@yahoo.com> To: > user@struts.apache.org> Subject: Re: Error Throwing With Struts 2 Tags> > >

Re: [losing my mind] s:if tag

2009-01-08 Thread Robert Dietrick
Thanks! Thought my whole world got turned upside-down for a few minutes there. On Thu, Jan 8, 2009 at 9:07 AM, Musachy Barroso wrote: > We all go thru that one at least once ;): > > http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-params-properly.html > > musachy > > On Thu, Jan

Re: [losing my mind] s:if tag

2009-01-08 Thread Musachy Barroso
We all go thru that one at least once ;): http://struts.apache.org/2.x/docs/why-doesnt-the-if-tag-evaluate-params-properly.html musachy On Thu, Jan 8, 2009 at 12:02 PM, Robert Dietrick wrote: > I have a very simple JSP page in which I want to test for the value of > a parameter passed via the q

[losing my mind] s:if tag

2009-01-08 Thread Robert Dietrick
I have a very simple JSP page in which I want to test for the value of a parameter passed via the query string (x.jsp?section=users). Any time I try to test for a specific parameter value, however, it *always* returns true (regardless of the actual value). For example, my JSP: <%@ taglib prefix=

Re: Getting an URL for an Action

2009-01-08 Thread Greg Lindholm
I have a similar use case which I think would be very common: It's the "forgot password" case. When a user has forgotten there password and wants it reset we send them an email with a URL link to the reset action that includes the security parameters. We have to construct (i.e. hack together) th

Re: Struts 2.0.12 dojo is not defined

2009-01-08 Thread Balbo
Thanks, I upgraded to Struts 2.0.14 and now it's ok. Musachy Barroso wrote: > > Are the dojo javascript files getting loaded? Use firebug to take a look. > > musachy > > On Thu, Jan 8, 2009 at 8:43 AM, Balbo wrote: >> >> I'm trying to use a datetimepicker in my struts 2.0.16 application bu

Re: REST Again

2009-01-08 Thread Frans Thamura
On Thu, Jan 8, 2009 at 11:23 PM, Musachy Barroso wrote: > ok, here we go. Looking at the rest showcase application, when you hit this > url: > > /orders/10 > > the REST plugin (to simplify) says "I have to invoke the 'show' method > in the 'orders' action, and set its 'id' parameter to 10". How d

Re: REST Again

2009-01-08 Thread Musachy Barroso
ok, here we go. Looking at the rest showcase application, when you hit this url: /orders/10 the REST plugin (to simplify) says "I have to invoke the 'show' method in the 'orders' action, and set its 'id' parameter to 10". How does the REST plugin know what to invoke? based on some simple conventi

REST Again

2009-01-08 Thread Frans Thamura
hi there chat with musa and he said that REST create the "action" for us but i still dont get, first Struts without REST, 1 action 1 result in REST, 1 result multiple action and mapped as REST URL can help all -- -- Frans Thamura Meruvian One Stop Java and Enterprise OSS Provider Technopren

Re: [S2] best practice for reading POST body in an action

2009-01-08 Thread John Cartwright
No, in this case the mime type is not application/x-www-form-urlencoded and not sent w/ KVP from a form. The body of the POST is all content. --john Roger Varley wrote: On Wednesday 07 January 2009 17:58:48 John Cartwright wrote: Hello All, Is there a best practice for using the body of

Re: Struts 2.0.12 dojo is not defined

2009-01-08 Thread Andras Balogh
Hi, I think this is the same problem with dojo 0.4: http://dojotoolkit.org/forum/dojo-0-4-x-legacy/dojo-0-4-x-support/firefox-3-and-struts-2-theme-ajax-render-issues#comment-17067 BR, Andras Balbo wrote: I'm trying to use a datetimepicker in my struts 2.0.16 application but "dojo is not define

Re: OrdersController behavior

2009-01-08 Thread Dave Newton
Frans Thamura wrote: how can only with 1 result can create all REST thing, create,delete, list Have you read the REST and Convention plugin documenation? They go into some detail on how the results are determined. Dave - T

Re: OrdersController behavior

2009-01-08 Thread Musachy Barroso
Did you take a look at the REST plugin docs? http://struts.apache.org/2.x/docs/rest-plugin.html . The REST plugin will automatically map certain URL to action methods (and parameters) musachy On Thu, Jan 8, 2009 at 10:14 AM, Frans Thamura wrote: > what do you mean of param??? > > still dont get,

Re: OrdersController behavior

2009-01-08 Thread Frans Thamura
what do you mean of param??? still dont get, can explain more deeply i want to know how can only with 1 result can create all REST thing, create,delete, list F On Thu, Jan 8, 2009 at 9:30 PM, Musachy Barroso wrote: > Those params are the params to the result, in this case > "redirectAction"

RE: [S2] Using an existing velocity template within struts2?

2009-01-08 Thread Shannon, Andrew
If you're using Spring then you could wire up the following (we have it wired into the applicationContext-service.xml file): class org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

Re: Struts 2.0.12 dojo is not defined

2009-01-08 Thread Musachy Barroso
Are the dojo javascript files getting loaded? Use firebug to take a look. musachy On Thu, Jan 8, 2009 at 8:43 AM, Balbo wrote: > > I'm trying to use a datetimepicker in my struts 2.0.16 application but > "dojo is not defined" (Firebug debugger) > > Did I miss something? > > my .jsp page is somet

Re: OrdersController behavior

2009-01-08 Thread Musachy Barroso
Those params are the params to the result, in this case "redirectAction", which needs a "actionName" param. musachy On Thu, Jan 8, 2009 at 7:37 AM, Frans Thamura wrote: > hi all > > i am looking at the REST example and got several thing that i need all > of your time to help me out > > i got thi

json action redirection in struts2

2009-01-08 Thread ravindra
Hi guys, I have two action configured in struts.xml like below.My interceptor stack noValidationLoginStack will check for session is timed out or not. If the session is timeout returns "login" so the page goes to login.jsp.It is working fine in first package but from json Packages and act

Re: Spring scope prototype and Struts Action

2009-01-08 Thread Musachy Barroso
http://www.nabble.com/Spring-scope-prototype-and-Struts-Action-to21341870.html On Thu, Jan 8, 2009 at 4:30 AM, e_sli...@yahoo.it wrote: > Hi folks! > > > > Following the Struts 2 + Spring 2 + JPA + AJAX Tutorial > (http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html) > > > > I'm

[S2] Using an existing velocity template within struts2?

2009-01-08 Thread James Carr
Hi All, I have a small problem. I have an object that generates a velocity template that I want to use within a struts2 application that is using velocity... the method that produces the html is called from within the template. Anyhow, I cannot seem to make this work unless I call Velocity.init()

Struts 2.0.12 dojo is not defined

2009-01-08 Thread Balbo
I'm trying to use a datetimepicker in my struts 2.0.16 application but "dojo is not defined" (Firebug debugger) Did I miss something? my .jsp page is something like.. <%...@taglib prefix="s" uri="/struts-tags" %> . . . . -- View this message in context: http://www.nabble.com/Struts

OrdersController behavior

2009-01-08 Thread Frans Thamura
hi all i am looking at the REST example and got several thing that i need all of your time to help me out i got this @Results({ @Result(name="success", type="redirectAction", params = {"actionName" , "orders"}) }) public class OrdersController implements ModelDriven, Validateable{ i still

REST @ S2

2009-01-08 Thread Frans Thamura
hi there just a little question i am using S2.0.8 and wanna to migrate to 2.1 and make all the apps is REST ready any strategy for REST implementation in 2.1.5??? is it painfull -- -- Frans Thamura Meruvian One Stop Java and Enterprise OSS Provider Technopreneurship, Training, Internship

struts 2.1.2 dojo doesn't work

2009-01-08 Thread TomazM
I struts2 distribution there is struts2-showcase-2.1.2.war but ajax examples doesn't work, because in browser error console I get: 1) Error: missing } after function body Source File: http://jalovec.arnes.si:8080/struts2-showcase-2.1.2/struts/dojo/dojo.js.uncompressed.js Line: 6026, Column: 38

Spring scope prototype and Struts Action

2009-01-08 Thread e_sli...@yahoo.it
Hi folks! Following the Struts 2 + Spring 2 + JPA + AJAX Tutorial (http://struts.apache.org/2.0.14/docs/struts-2-spring-2-jpa-ajax.html) I'm declaring my Spring bean HelloWorldAction with scope prototype and then the action in struts.xml using the bean reference. As far as the scope is p