Multi pages - Wizard with Struts 2 ?

2009-02-09 Thread Fernandes Celinio SGCF
Hi, I have a small workflow where the user needs to register. In the 1st screen the user chooses a login and a password. In the 2nd screen the user enters his first name, last name, age, etc In the 3rd and final screen the user enters her/his address. The submit final in the 3rd screen should be

Struts 2.1.6 - custom interceptor

2009-02-09 Thread Prasad Mangina
Dear All, i have programmed a simple (custom) interceptor. placed logic in post action invocation. public String doIntercept(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); String ret = invocation.invoke(); if (action instanceof

Re: Struts 2.1.6 - custom interceptor

2009-02-09 Thread Lukasz Lenart
2009/2/9 Prasad Mangina pra...@constructiondeal.com: Dear All, i have programmed a simple (custom) interceptor. placed logic in post action invocation. public String doIntercept(ActionInvocation invocation) throws Exception { Object action = invocation.getAction(); String ret

Proper PRG with PortletResult + Exception Mapping Results

2009-02-09 Thread Torsten Krah
Hi, prg does work fine using the normal workflow. I want to use this pattern with my exception mappings too and defined: exception-mapping result=error exception=java.lang.Exception/exception- mapping result name=error type=redirect param

Re: Proper PRG with PortletResult + Exception Mapping Results

2009-02-09 Thread Torsten Krah
Am Montag, 9. Februar 2009 14:05:41 schrieb Torsten Krah:  result name=error type=redirect Hm this should read redirectAction. And nvm, it works using redirectAction - argl, typo ... -- Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge. Siehe

Re: How to determine the Type of a Bean Property from String based OGNL Expression

2009-02-09 Thread Torsten Krah
Am Freitag, 16. Januar 2009 18:13:49 schrieb dusty: If you have the action can you use Reflection to step through the properties and find the types that way? I am using now BeanIntrospection + Parsing the failed Expression. How can i get there without parsing the String and tokenizing the ognl

Struts 2 file upload

2009-02-09 Thread Lund
Hi I'm using Strurs 2.1.2 and the s:file name=upload label=File / tag in the jsp page. My problem is that while the fileUpload appears to work most of the time I do get java.io.FileNotFoundException: on the .tmp file that Struts uses as part of the process (prob 1 in 10 times). Once this

howto implement a @before annotation ?

2009-02-09 Thread xianwinwin
Hi all, here's a scenario:I have some methods that before executed, they should run an interceptor --to verify if the user is authorized to do something. I read that struts2 has a @before @after interceptors that could help here. here's my though @before public String activateProcess() {

Re: howto implement a @before annotation ?

2009-02-09 Thread Piero Sartini
On Monday 09 February 2009 16:43:09 xianwinwin wrote: Hi all, here's a scenario:I have some methods that before executed, they should run an interceptor --to verify if the user is authorized to do something. Write your own interceptor and check for your annotation. Something like this should

RE: Struts2 + tiles + i18n, getText issue

2009-02-09 Thread David Kerwick
Hi, Just discovered this also happens with s:textfield key=surname label=%{getText('surname')}/s:textfield I don't know how to get around that as I can't put s:text in its place. Am I just doing something wrong? If so what should I be doing? Any help would be great Thanks Dave

ParametersInterceptor - isAccepted / acceptedParamNames won't work with a comma seperated list of param names

2009-02-09 Thread Torsten Krah
I wonder if someone faced this behavior before, wheter this is known or wanted. XWork ParametersInterceptor Code: protected boolean isAccepted(String paramName) { if (!this.acceptedParams.isEmpty()) { for (Pattern pattern : acceptedParams) { Matcher

actionError id parameter

2009-02-09 Thread Ddlc
I see that there is an id parameter for the actionError tag. The name suggest that it should add an id attribute to the ul tag that the result generates, but this is not the case. Is there a way to add an id attribute to the HTML element the actionError tag generates? Thank you very much. --

Re: howto implement a @before annotation ?

2009-02-09 Thread xianwinwin
YES! thank you so much this really helps! Piero Sartini-3 wrote: On Monday 09 February 2009 16:43:09 xianwinwin wrote: Hi all, here's a scenario:I have some methods that before executed, they should run an interceptor --to verify if the user is authorized to do something. Write

Re: ParametersInterceptor - isAccepted / acceptedParamNames won't work with a comma seperated list of param names

2009-02-09 Thread Musachy Barroso
Yes, that was broken and was fixed in 2.1 to: protected boolean isAccepted(String paramName) { if (!this.acceptParams.isEmpty()) { for (Pattern pattern : acceptParams) { Matcher matcher = pattern.matcher(paramName); if (matcher.matches()) {

RE: trouble deploying struts2 app to tomcat 1.5.0.05 *FIXED*

2009-02-09 Thread Wick, Dan
Ok, I have no clue why this matters...but I changed my context setup everything deployed just fine. OLD ONE: Context path=/pwww docBase=/foo/pwww/pwww.war debug=10

Re: trouble deploying struts2 app to tomcat 1.5.0.05 *FIXED*

2009-02-09 Thread Musachy Barroso
The exorcism suggestion wasn't that far fetched after all :) musachy On Mon, Feb 9, 2009 at 11:45 AM, Wick, Dan dan.w...@donaldson.com wrote: Ok, I have no clue why this matters...but I changed my context setup everything deployed just fine. OLD ONE: Context

Re: Multi pages - Wizard with Struts 2 ?

2009-02-09 Thread Miguel
I've used the scope interceptor and works great, you may create an action for each screen or a method for each screen and use a redirect or an action chain to change between screens (after validation). Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Mon, Feb 9, 2009

Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
Hi all, We've been trying to get validation (using annotations) working within a Struts Portlet for a couple of days - without success, when the input is a redirectAction. When the input result is a JSP, it works fine. We're using the messageStoreInterceptor. We're using JBoss Portal

action alias / redirect

2009-02-09 Thread Leonidas Papadakis
Greetings to all, in my struts2 actions file i have the following entry for an action : action name=SelectStepA class=action.SelectStepA ... (interceptors, results) ... /action i would like to have another action with shortname ie ssa that will redirect to the above action (sending all the

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Nils-Helge Garli Hegvik
Have you tried installing the portlet sample app? I believe there are a couple of validation scenarios there. As far as I know, it should work. You shouldn't even need the MessageStoreInterceptor, since the portlet default stack should handle preserving messages across redirects. Nils-H On Mon,

SV: action alias / redirect

2009-02-09 Thread Christer Gjerstad
Hello Leonidas, Common practice for doing this would be as follows: package name=yourPackageName namespace=/ extends=struts-default action name=ssa class=your.namespace.ssaAction result type=redirectAction

RE: Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
Nils-H, Thanks for the reply. I've looked at them - none of them actually use the annotations as such. It's definitely not working with or without MessageStoreInterceptor when you utilise a redirect - it's absolutely fine if you simply replace the redirect with a simple JSP result. Dean.

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Nils-Helge Garli Hegvik
Yeah, you're right... It's not using annotations. Have you tried with xml validation? It's not a solution, but at least it will narrow down the problem. Nils-H On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen dean.pul...@msp-uk.com wrote: Nils-H, Thanks for the reply. I've looked at them - none

Re: SV: action alias / redirect

2009-02-09 Thread Leonidas Papadakis
That's perfect. Thank you very much Christer, much obliged. Regards, Leonidas Christer Gjerstad wrote: Hello Leonidas, Common practice for doing this would be as follows: package name=yourPackageName namespace=/ extends=struts-default action name=ssa

RE: Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
Rechecking and it seems none of them use a redirect as the input either, which is the main test case I'm after really. -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: 09 February 2009 18:07 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet

Re: Struts 2.1.6 - custom interceptor

2009-02-09 Thread Greg Lindholm
Take a look at PreResultListener http://struts.apache.org/2.x/docs/preresultlistener.html Lukasz Lenart wrote: 2009/2/9 Prasad Mangina pra...@constructiondeal.com: Dear All, i have programmed a simple (custom) interceptor. placed logic in post action invocation. public String

Re: Datetimepicker and struts 2.1.6

2009-02-09 Thread Musachy Barroso
It could be related to this: http://jira.opensymphony.com/browse/XW-670 is the client on a different locale than the server? musachy On Mon, Feb 9, 2009 at 1:09 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hi, I migrated from struts 2.0.11 to 2.1.6 and the datetimepicker does not

RE: Datetimepicker and struts 2.1.6

2009-02-09 Thread Phan, Hienthuc T
No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 10:25 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 It could be related to this: http://jira.opensymphony.com/browse/XW-670 is

Re: Datetimepicker and struts 2.1.6

2009-02-09 Thread Musachy Barroso
xwork understands the 2009-01-30T00:00:00-08:00 format, what error are you getting? musachy On Mon, Feb 9, 2009 at 1:35 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: No, it's the same locale. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday,

RE: Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
I can confirm that using validation xml instead of annotations does exactly the same thing. i.e. a forward to a JSP will display the messages, a redirectAction type result will 'lose' the messages during the dispatch. Dean. -Original Message- From: Nils-Helge Garli Hegvik

RE: Datetimepicker and struts 2.1.6

2009-02-09 Thread Phan, Hienthuc T
It did not throw exception or anything like that. I specifically set the display format to MM/dd/. Visually it displays correctly on UI as 01/02/2009 The problem is: When the form is submitted, I got data back as 2009-01-02T00:00:00-08:00 instead of 01/02/2009. -Hien

Re: Datetimepicker and struts 2.1.6

2009-02-09 Thread Musachy Barroso
ok, I see what you mean now. This is the way that it was supposed to work since the beginning, so the date is always submitted in a standard format, disregarding the display format, or the locales of the client and server. If you field is of type Date, xwork will know how to parse the value.

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Musachy Barroso
Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in portlets Nils? musachy On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen dean.pul...@msp-uk.com wrote: I can confirm that using validation xml instead of annotations does exactly

How to generate a URL with s:url encoded in UTF-8

2009-02-09 Thread Ignacio de Córdoba
Hi there, I am trying to generate a URL with s:url and s:param so that parameters are encoded in URL. Special characters are not processed ok. (The struts action works fine as I have posted that same URL data with a form encoded in UTF-8 and they are decoded fine in my java code) I've tried doing

RE: Datetimepicker and struts 2.1.6

2009-02-09 Thread Phan, Hienthuc T
Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of overriding the struts 2.1.6 core jar with the datetimepicker classes, css, template, etc. from 2.0.11 (the working version). What do you think? -Original

Re: Datetimepicker and struts 2.1.6

2009-02-09 Thread Musachy Barroso
it does not work anymore. means that the date field is not set? musachy On Mon, Feb 9, 2009 at 2:21 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: Hmmm... It used to work in Struts 2.0.11. After I migrated the code to use Struts 2.1.6, it does not work anymore. I'm thinking of

RE: Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
I've tried, and reverted back for now, to using the MessageStoreInterceptor with no success, the messages are still lost. We've successfully used the MessageStoreInterceptor on non-portlet applications. Annoyingly, anything you input on the form is also lost, which will cause much chagrin for

Problem with JSON Result and Form Submit

2009-02-09 Thread Christer Gjerstad
Hello everyone, Anyone know how to pass post message information from an action containing a form to an action returning JSON result via an JSP page with a DOJO script calling the JSON result action? Please see example below. I am loosing the post message on the way. One solution could be to

Re: How to generate a URL with s:url encoded in UTF-8

2009-02-09 Thread Manos Batsis
Ignacio de Córdoba wrote: Hi there, I am trying to generate a URL with s:url and s:param so that parameters are encoded in URL. Special characters are not processed ok. (The struts action works fine as I have posted that same URL data with a form encoded in UTF-8 and they are decoded fine in my

RE: Datetimepicker and struts 2.1.6

2009-02-09 Thread Phan, Hienthuc T
does not work anymore = on submit, the date field got set to 2009-01-02T00:00:00-08:00 instead of 01/02/2009. I would like the date field to be set to 01/02/2009 [which was what the date field got set when using 2.0.11.] -Original Message- From: Musachy Barroso

Re: Datetimepicker and struts 2.1.6

2009-02-09 Thread Musachy Barroso
I assume that's is because the date field is of type String then. musachy On Mon, Feb 9, 2009 at 2:32 PM, Phan, Hienthuc T hienthuc_p...@merck.com wrote: does not work anymore = on submit, the date field got set to 2009-01-02T00:00:00-08:00 instead of 01/02/2009. I would like the date field

RE: Datetimepicker and struts 2.1.6

2009-02-09 Thread Phan, Hienthuc T
Yes. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Monday, February 09, 2009 11:36 AM To: Struts Users Mailing List Subject: Re: Datetimepicker and struts 2.1.6 I assume that's is because the date field is of type String then. musachy On Mon, Feb 9, 2009

Re: Problem with JSON Result and Form Submit

2009-02-09 Thread Musachy Barroso
So you have a page that has a form, and that submits to an action that returns JSON? What is the message that you are talking about? Posting a section of the JSP would also help. musachy On Mon, Feb 9, 2009 at 2:31 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Hello everyone,

SV: Problem with JSON Result and Form Submit

2009-02-09 Thread Christer Gjerstad
Almost. I have a page that has a form, and that submits (Post method) to a an action that has JSP page as result containing a DOJO script calling an action that returns a JSON result. It is a search form where the user provides information and the result shall be presented on another page. But

Re: Problem with JSON Result and Form Submit

2009-02-09 Thread Musachy Barroso
Ok, so the Dojo script needs to pass some data to the action, and that data is the one that comes from the first request right? musachy On Mon, Feb 9, 2009 at 2:54 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Almost. I have a page that has a form, and that submits (Post method) to

RE: Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
It's a bit odd, but I seem to have got it working finally. I've set the messageStoreInterceptor before the portletDefaultStack. This threw an error about ItemView that having an input result - a bit odd considering it's the ItemEdit that needs the input result. I added this, and it magically

SV: Problem with JSON Result and Form Submit

2009-02-09 Thread Christer Gjerstad
Yes, correct. :-) So my question is; is that the way to do it? With the Dojo script that is, passing the data into the action? Will not the params interceptor handle this? What I've done so far is to make another action class implementing the ParameterAware interface so that I will get the

Re: Problem with JSON Result and Form Submit

2009-02-09 Thread Musachy Barroso
There are a lots of different ways of doing that. What I would do is: 1. add a field for the first action wit getters and setters for the params 2. in the jsp do something like: script var param1 = s:property value=''param1' escapeJavaScript='true'/; var param2 = s:property value=''param2'

SV: Problem with JSON Result and Form Submit

2009-02-09 Thread Christer Gjerstad
Great! This sounds better than what I have done so far! I will try that ASAP. Thank you very much! Kind regards Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 21:25 Til: Struts Users Mailing List Emne: Re: Problem with

Re: Problem with JSON Result and Form Submit

2009-02-09 Thread Musachy Barroso
I forgot to say, escapeJavaScript is available on 2.1 only. If you are using 2.0, there is a similar method (actually the original one) in commons lang StringEscapeUtils. musachy On Mon, Feb 9, 2009 at 3:33 PM, Christer Gjerstad christer.gjers...@gmail.com wrote: Great! This sounds better

2.0.14 - 2.1.6 filter config issue

2009-02-09 Thread ryangr
I'm trying to migrate from 2.0.14 to 2.1.6 and am getting the following error in my console preventing my app from starting: Feb 9, 2009 2:23:02 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.NullPointerException at

Re: 2.0.14 - 2.1.6 filter config issue

2009-02-09 Thread Musachy Barroso
It is a known problem in xwork: https://issues.apache.org/struts/browse/WW-2956 setting devMode to false would prevent it. musachy On Mon, Feb 9, 2009 at 3:41 PM, ryangr grigg...@gmail.com wrote: I'm trying to migrate from 2.0.14 to 2.1.6 and am getting the following error in my console

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Nils-Helge Garli Hegvik
This should be handled by the default portlet interceptor stack. If it doesn't, it's a bug... Nils-H On Mon, Feb 9, 2009 at 8:19 PM, Musachy Barroso musa...@gmail.com wrote: Messages will be lost if a redirectAction is used, unless the MessageStoreInterceptor is used, or is that different in

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Nils-Helge Garli Hegvik
That should not be necessary. Could you please register a JIRA issue, and if possible, a simple app that can reproduce the issue? Thanks. Nils-H On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen dean.pul...@msp-uk.com wrote: It's a bit odd, but I seem to have got it working finally. I've set the

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Musachy Barroso
You can reopen the one I closed, and add any extra info you found. musachy On Mon, Feb 9, 2009 at 3:49 PM, Nils-Helge Garli Hegvik nil...@gmail.com wrote: That should not be necessary. Could you please register a JIRA issue, and if possible, a simple app that can reproduce the issue? Thanks.

SV: Problem with JSON Result and Form Submit

2009-02-09 Thread Christer Gjerstad
No worries. I have been using 2.1 since the beta was released. But thanks anyway, and thanks again for the help! :-) -Christer! -Opprinnelig melding- Fra: Musachy Barroso [mailto:musa...@gmail.com] Sendt: 9. februar 2009 21:38 Til: Struts Users Mailing List Emne: Re: Problem

Re: 2.0.14 - 2.1.6 filter config issue

2009-02-09 Thread ryangr
I set devMode to false and the same issue still occurs, even after clearing the Tomcat work directory and caches. Can anything else be done about it or am I just going to have to downgrade back to 2.0.14 until the Xwork issue is fixed? Thanks, Ryan Musachy Barroso wrote: It is a known

Re: 2.0.14 - 2.1.6 filter config issue

2009-02-09 Thread Musachy Barroso
The issue was fixed in xwork trunk, you can build it yourself, or use a snapshot. musachy On Mon, Feb 9, 2009 at 3:53 PM, ryangr grigg...@gmail.com wrote: I set devMode to false and the same issue still occurs, even after clearing the Tomcat work directory and caches. Can anything else be

Cookie Intercepter configuration

2009-02-09 Thread Norris Shelton
Struts 2.1.6 on Glassfish 9.1_02 I am trying to configure the cookie intercepter, but it looks like I am missing something. I have the following in my struts.xml: default-interceptor-ref name=paramsPrepareParamsStack/ action name=/soldier/view

Re: actionError id parameter

2009-02-09 Thread Musachy Barroso
That would be a bug: https://issues.apache.org/struts/browse/WW-2988 I will fix it soon in trunk. You can always overwrite the template and add that attribute. musachy On Mon, Feb 9, 2009 at 11:32 AM, Ddlc revenan...@hotmail.com wrote: I see that there is an id parameter for the actionError

RE: Struts 2 Portlet Validation Problems

2009-02-09 Thread Dean Pullen
No problem, will do - in the morning! Thanks. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: 09 February 2009 20:51 To: Struts Users Mailing List Subject: Re: Struts 2 Portlet Validation Problems You can reopen the one I closed, and add any extra info you

Re: Cookie Intercepter configuration

2009-02-09 Thread Musachy Barroso
There should be a more meaningful exception down there in the log, can you post the whole stack trace? musachy On Mon, Feb 9, 2009 at 4:38 PM, Norris Shelton norrisshel...@yahoo.com wrote: Struts 2.1.6 on Glassfish 9.1_02 I am trying to configure the cookie intercepter, but it looks like I am

Re: actionError id parameter

2009-02-09 Thread Ddlc
Thank you very much Musachy :) -- View this message in context: http://www.nabble.com/actionError-id-parameter-tp21916434p21923699.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail:

Nested iterator struts 2.1.6 -- automatically rebuild the collection

2009-02-09 Thread Phan, Hienthuc T
Hi, Using s:iterator .. tag, how do you instruct struts to rebuild the collection automatically? I have a List of List of Sample objects I use s:iterator tag to loop through and display data for user to make changes The displaying part is OK; however, when the form is submitted, the List of

Re: Struts 2 file upload

2009-02-09 Thread Dave Newton
Lund wrote: I'm using Strurs 2.1.2 and the s:file name=upload label=File / tag in the jsp page. My problem is that while the fileUpload appears to work most of the time I do get java.io.FileNotFoundException: on the .tmp file that Struts uses as part of the process (prob 1 in 10 times). Once

Re: Cookie Intercepter configuration

2009-02-09 Thread Dave Newton
Norris Shelton wrote: Struts 2.1.6 on Glassfish 9.1_02 I am trying to configure the cookie intercepter, but it looks like I am missing something. I have the following in my struts.xml: default-interceptor-ref name=paramsPrepareParamsStack/ action name=/soldier/view

Hiding s:select control

2009-02-09 Thread Rajeshwari Godbole
Hello all, I'm using Struts2 on Tomcat and am trying to hide a s:select tag depending on the selected option of another s:select tag. I'm able to disable the tag using javascript but am not able to hide it. Setting style.display=none; does not work, neither does adding a div tag because Struts

Re: Struts 2 Portlet Validation Problems

2009-02-09 Thread Torsten Krah
Am Montag, 9. Februar 2009 21:48:33 schrieb Nils-Helge Garli Hegvik: This should be handled by the default portlet interceptor stack. If it doesn't, it's a bug... Its a bug i guess, i need to use a Message Store Interceptor too, because using PRG in portlets i lost my messages and errors

Struts2.1.6 Tiles 2.1.1

2009-02-09 Thread Jaarthy
hi, I am trying to integrate Struts2.1.6 with tiles2.1.1. When I click on the login link,I am getting Unable to find the definitionwarning Message in my logs.Any help on this issue will be appreciated. Thanks, Aarthy -- View this message in context:

Re: Hiding s:select control

2009-02-09 Thread Paweł Wielgus
Hi Rajeshwari, it has nothing to do with struts2, use javascript for it, also setting html id property for your selects might help. Best greetings, Paweł Wielgus. 2009/2/10 Rajeshwari Godbole rgodb...@gmail.com: Hello all, I'm using Struts2 on Tomcat and am trying to hide a s:select tag