Form Notify after validation

2008-12-02 Thread Sergio Sánchez González
I want to add validations to my forms. But the problem I have is in
these forms I have notify actions, and this notifys should only be
called if the validation is ok.

for example:
sx:submit targets=orders 
notifyTopics=/closeNewOrder,/openOrders ... /

The form action:

action name=CreateOrder class=newOrderController
method=createOrder

 result type=redirectAction
param name=actionNamelistOrders/param
/result

result name=inputOrderNewForm.jsp/result
result name=errorOrderNewForm.jsp/result

/action

with closeNewOrder I hide the form and with openOrders I open a div
with a list of orders. The point is that if the validation is not ok
then the orders list shouldn't be opened.

Any idea?
Thanks!

Sergio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Submit Success and false

2008-12-02 Thread Kibo

Before return from Action class set dataObject to null.

public MyAction{
   private DataObject myDataObject;

   //something code

public String execute(){
myDataObject = null;
   return success;
}


public getMyDataObject(){
return myDataObject;
}

}




mthalis wrote:
 
 After entering data to the form, if it success, it will redirect to the
 same page. When it comes to that page the entered data are still the same.
 I want to clear those data from my form. But if it fails i want to remain
 my data as it is. How can i do it?
 this is my part of the struts-config.xml page.
 action
   attribute=userDataEnterForm
   input=admin.create.page
   name=userDataEnterForm
   path=/userDataEnter
   scope=request
   type=com.gad.struts.action.UserDataEnterAction
   forward name=success path=admin.create.page /
   forward name=failure path=admin.create.page /
 /action
 


-
Tomas Jurman
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/Submit-Success-and-false-tp20790660p20790810.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread hello_everyone
i have it like this
servlet-mapping
servlet-nameactionservlet-name
url-pattern*.do/url-pattern
/servlet-mapping

any idea?

On Tue, Dec 2, 2008 at 10:42 AM, nikunj [EMAIL PROTECTED] wrote:

 Have u put following filters in web.xml?


 filter
filter-nameaction/filter-name
filter-classorg.apache.struts.action.ActionServlet/filter-class
/filter

 filter-mapping
filter-nameaction/filter-name
url-pattern*.do/url-pattern
url-pattern*.jsp/url-pattern
/filter-mapping

 Regards
 Nikunj Mulani

 -Original Message-
 From: hello_everyone [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 02, 2008 1:25 PM
 To: user@struts.apache.org
 Subject: .do and .jsp

 Hi,



 I am working on an application, which is developed with struts 1.2.9.

 I added a .jsp page and action against that page. Now the problem is: if in
 struts-config.xml, I specify the path of page with .jsp, it works. But with
 .do extension it doesn't work. Is there any other place in struts besides
 configuration file where we have to make an entry of the forward?



 Regards,



 __ NOD32 3656 (20081202) Information __

 This message was checked by NOD32 antivirus system.
 http://www.eset.com


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Submit Success and false

2008-12-02 Thread Dave Newton
--- On Tue, 12/2/08, mthalis wrote:
 After entering data to the form, if it success, it will
 redirect to the same page. When it comes to that page
 the entered data are still the same.
 [...]

That's because you're not redirecting, you're forwarding. If you want to 
redirect you need to set the redirect attribute in the forward element to 
true.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread Lukasz Lenart
2008/12/2 hello_everyone [EMAIL PROTECTED]:
 i have it like this
 servlet-mapping
 servlet-nameactionservlet-name
 url-pattern*.do/url-pattern
 /servlet-mapping

Show alos your struts-config.xml for that action


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread hello_everyone
action name=someform path=/test
type=mypackage.TestAction
scope=session validate=false
forward name=success path=/test2.do/
forward name=failure path=/test.do/  //it works if it change it .jsp
and add one more level //from path
/action
On Tue, Dec 2, 2008 at 1:21 PM, Lukasz Lenart
[EMAIL PROTECTED]wrote:

 2008/12/2 hello_everyone [EMAIL PROTECTED]:
  i have it like this
  servlet-mapping
  servlet-nameactionservlet-name
  url-pattern*.do/url-pattern
  /servlet-mapping

 Show alos your struts-config.xml for that action


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: Struts2 Validations

2008-12-02 Thread esemba

Hi,
just add all jar files bundled with the distribution (as you can see in
showcase application).
Required minimum is commons-logging, ognl, freemarker, struts2-core and
xwork.



Anshuman Nanda wrote:
 
 Hi esemba,
 
   From other dependancies I mean any new jar file which I have to take
 apart
 from struts2-core-2.0.14.jar.  My question was because I am nearly 6
 version
 behind right now on 2.0.8,  so migrating to 2.0.14 I see as an Issue as I
 am
 not sure what else in terms of jar files I need to update apart from
 struts-core-2.0.14.jar file.
 
 Regards
 Anshuman Nanda
 
 
 
 -Original Message-
 From: esemba [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 02, 2008 1:24 PM
 To: user@struts.apache.org
 Subject: RE: Struts2 Validations
 
 
 
 Hi,
 I has the same problem using Struts 2.0.12. In 2.0.14 there has been fixed
 a
 bug with accessing static content. Validation and dojo javascript files
 were
 somehow not generated. Upgrading to 2.0.14 has fixed the problem. I don't
 understand what do you mean by other dependencies. Just add all required
 jar files.
 
 Bye.
 
 
 Anshuman Nanda wrote:

 Thanks Esemba for the update.

 Can u please let me know what are the other dependencies (in terms of jar
 files) which i need to take care of when migrating from 2.0.8 to 2.0.14.

 Regards
 Anshuman Nanda


 -Original Message-
 From: esemba [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 02, 2008 12:41 PM
 To: user@struts.apache.org
 Subject: RE: Struts2 Validations



 Hi,
 I've faced this issue too. Try to migrate to latest Struts 2.0.14.


 Anshuman Nanda wrote:

 Hi Lukasz

 I am using the Validation Files and not annotations.


 Regards
 Anshuman Nanda



 -Original Message-
 From: Lukasz Lenart [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 01, 2008 2:18 PM
 To: Struts Users Mailing List
 Subject: Re: Struts2 Validations


 Did you created validation files or added annotations?


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




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


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 
 --
 View this message in context:
 http://www.nabble.com/Struts2-Validations-tp20717889p20787601.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can these query data be got?

2008-12-02 Thread Dave Newton
--- On Tue, 12/2/08, KE LI wrote:
   public class welcome implements Action {
private List paramList;
setters
public String execute() throws Exception {
 paramList = new ArrayList();
 return SUCCESS;
}
   }
 
 Then if I input the URL:
 xxx/welcome.do?param1=helloparam2=worldparamList=element1paramList=element2paramList=...
   I found that param1 will be given the value hello, param2 
 will be given the value world but of course paramList will
 not be given element1,2,3...etc. I want to ask: [...]

The first issue I see is that you're creating a new list in the execute() 
method. The execute() method is executed after the interceptors set the action 
properties from the form data--so you're wiping out the work the interceptors 
did.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread hello_everyone
action name=someform path=/test2
  type=mypackage.Test2Action
  scope=session validate=false
  forward name=success path=/test3.do/
  forward name=failure path=/test3.do/
  /action

the problem seems to be : jsp pages are not in web-inf. but all other pages
are working with .do except the one which i added.

On Tue, Dec 2, 2008 at 2:06 PM, Lukasz Lenart
[EMAIL PROTECTED]wrote:

 2008/12/2 hello_everyone [EMAIL PROTECTED]:
  action name=someform path=/test
  type=mypackage.TestAction
  scope=session validate=false
  forward name=success path=/test2.do/
  forward name=failure path=/test.do/  //it works if it change it
 .jsp
  and add one more level //from path
  /action

 Could you show how this action is configure?

 forward name=success path=/test2.do/


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problem when using result type=redirect-action

2008-12-02 Thread ravindra
I think some thing is wrong at these lines,

result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result

Your mapping should be like,
result name=* type=redirect-actionViewTestedLetters/result

All the best,

-Original Message-
From: holod [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 02, 2008 2:50 PM
To: user@struts.apache.org
Subject: Problem when using result type=redirect-action


When I try to redirect action and set parameter value to it, I get an
exception:

[02.12.08 12:11:33:705 MSK] 0031 OgnlUtil  W
com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
OgnlException while setting property 'page' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
 ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.page
at
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV
alueStack.java:81)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)


my struts.xml:

action name=ViewTestedLetters class=admin.AdminViewTreatmentAction
method=viewTested
result name=success /admin/treatmentadm.jsp/result
/action

action name=ApproveLetters class=admin.AdminEditTreatmentAction
method=approve
result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result
/action

These two action classes have field:
private int page;

These two action classes have getter and setter for the field named page:
public void setPage(int page) {
this.page = page;
}

public int getPage() {
return page;
}

Why does I get such exception?


P.S.
I've used this tutorial:
http://struts.apache.org/2.x/docs/redirect-action-result.html


-- 
View this message in context:
http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22
-tp20788608p20788608.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can these query data be got?

2008-12-02 Thread KE LI
Hi Dave,
  Thanks for your quick reply. Suppose that I input this link
xxx/welcome.do?param1=helloparam2=worldparamList=element1paramList=element2paramList=...
into the link bar in the browser and run it. How can S2 knows to put hello
into param1 and world into param2 in the welcome action object?
  Could you please kindly explain the procedure? Or lets say, if I define
another field param4, why not giving hello to param4 instead of
param1?
  Besides, suppose that I just run this link
xxx/welcome.do?param1=helloparam2=worldparamList=element1paramList=element2paramList=...
in the browser, only the default method execute will be called, right?
  Thanks a lot!

2008/12/2 Dave Newton [EMAIL PROTECTED]

 --- On Tue, 12/2/08, KE LI wrote:
public class welcome implements Action {
 private List paramList;
 setters
 public String execute() throws Exception {
  paramList = new ArrayList();
  return SUCCESS;
 }
}
 
  Then if I input the URL:
 
 xxx/welcome.do?param1=helloparam2=worldparamList=element1paramList=element2paramList=...
I found that param1 will be given the value hello, param2
  will be given the value world but of course paramList will
  not be given element1,2,3...etc. I want to ask: [...]

 The first issue I see is that you're creating a new list in the execute()
 method. The execute() method is executed after the interceptors set the
 action properties from the form data--so you're wiping out the work the
 interceptors did.

 Dave


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Best Regards,
Licco


Re: Struts2 2.0.11 problem with url and parameters

2008-12-02 Thread Tomi21

If someone has experienced problems with struts2 applications running on oc4j
please
give a hand.
What tests can I do in order to identify de precise problem with oc4j?

Thanks!!


Tomi21 wrote:
 
 OK, good news!!
 
 I've installed a fresh apache tomcat 6.018 and everything is working now.
 The problem is that my app. must run on a 0c4j 10.1.3.1. 
 It seems that there is a problem with oc4j. 
 Does anyone know what problem can be?
 Can anyone tell me wich are the minimum .jar's needed in order for struts2
 to work.
 I'am not using spring. 
 
 I really appreciate your help!!
 
 Tomás 
 
 
 
 Nils-Helge Garli wrote:
 
 Maybe it's something wrong with your runtime environment. Try setting
 your project up on a different fresh app server (or maybe try the
 maven jetty plugin) and see if you get the same behaviour there.
 
 Nils-H
 
 On Thu, Nov 27, 2008 at 11:58 AM, Tomi21 [EMAIL PROTECTED] wrote:

 I know, but I did it just in case I found something out.
 In my previous example the println it is being execute but the value of
 test
 is NULL.In other words, the action gets executed but the parameter is
 not
 set.

 Now, as you said in your post, I've changed the link to:
 http://localhost:/TestWeb/Test.action?test=something CLICK ON
 But I'm obtaining the same result: the actions gets executed but the
 parameters is not set.
 Of course I've configured again the default interceptors.

 I've also tried taking out .action extension but with the same result.

 Thanks!!.


 newton.dave wrote:

 --- On Wed, 11/26/08, Tomi21 [EMAIL PROTECTED] wrote:
 What I've done next is changing 'struts.xml' so
 there are no interceptors configured.
 The packagedoes not extend struts-default anymore.
 The action is still being executed but the parameter is not
 being set anyway.:(

 Well that's hardly surprising, it's an interceptor that sets
 parameters.

 On your previous example the test println isn't even being executed, so
 there's something else wrong, no? What if you use the url tag's
 action
 attribute w/o the .action extension? Is the link rendering properly?

 In general we don't use the s:a... tag for non-Ajax URLs, too--what
 if
 you use a plain HTML a... tag with the generated URL?

 Dave


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context:
 http://www.nabble.com/Struts2-2.0.11-problem-with-url-and-parameters-tp20577582p20717192.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts2-2.0.11-problem-with-url-and-parameters-tp20577582p20793209.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: .do and .jsp

2008-12-02 Thread nikunj
Have u put following filters in web.xml?


filter
filter-nameaction/filter-name
filter-classorg.apache.struts.action.ActionServlet/filter-class
/filter

filter-mapping
filter-nameaction/filter-name
url-pattern*.do/url-pattern
url-pattern*.jsp/url-pattern
/filter-mapping

Regards
Nikunj Mulani

-Original Message-
From: hello_everyone [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 02, 2008 1:25 PM
To: user@struts.apache.org
Subject: .do and .jsp

Hi,



I am working on an application, which is developed with struts 1.2.9.

I added a .jsp page and action against that page. Now the problem is: if in
struts-config.xml, I specify the path of page with .jsp, it works. But with
.do extension it doesn't work. Is there any other place in struts besides
configuration file where we have to make an entry of the forward?



Regards,



__ NOD32 3656 (20081202) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem when using result type=redirect-action

2008-12-02 Thread holod



KE LI-2 wrote:
 
 I think some thing is wrong at these lines,

 result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result 
 
 

Nabble swallowed my tags, I've replaced them on [ and ]
result name=* means any result name, it doesn't matter which one.


-- 
View this message in context: 
http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22-tp20788608p20788945.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



submit form with anchor

2008-12-02 Thread Kibo

Hi konference

I use Struts 2.0. I need submit form with anchor. I know that stuts tag form
dont support atribute anchor, but how do I  do it?

describe:
I have long form. I have two submit buttons inside. 
First button has label Save and save values from form. It work correct.
Second submit button has label Add field and when I click on button it add
text field in form. After perform Action it return to the same long form. I
work correct, but it return on top of form. 
I need return to anchor ( lt;a name=myAnchorgt;lt;/agt; ) inside form.


Can you help my please with this problem?
Thanks a lot.

-
Tomas Jurman
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/submit-form-with-anchor-tp20788096p20788096.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts2 Validations

2008-12-02 Thread Anshuman Nanda
Hi esemba,

From other dependancies I mean any new jar file which I have to take 
apart
from struts2-core-2.0.14.jar.  My question was because I am nearly 6 version
behind right now on 2.0.8,  so migrating to 2.0.14 I see as an Issue as I am
not sure what else in terms of jar files I need to update apart from
struts-core-2.0.14.jar file.

Regards
Anshuman Nanda



-Original Message-
From: esemba [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2008 1:24 PM
To: user@struts.apache.org
Subject: RE: Struts2 Validations



Hi,
I has the same problem using Struts 2.0.12. In 2.0.14 there has been fixed a
bug with accessing static content. Validation and dojo javascript files were
somehow not generated. Upgrading to 2.0.14 has fixed the problem. I don't
understand what do you mean by other dependencies. Just add all required
jar files.

Bye.


Anshuman Nanda wrote:

 Thanks Esemba for the update.

 Can u please let me know what are the other dependencies (in terms of jar
 files) which i need to take care of when migrating from 2.0.8 to 2.0.14.

 Regards
 Anshuman Nanda


 -Original Message-
 From: esemba [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 02, 2008 12:41 PM
 To: user@struts.apache.org
 Subject: RE: Struts2 Validations



 Hi,
 I've faced this issue too. Try to migrate to latest Struts 2.0.14.


 Anshuman Nanda wrote:

 Hi Lukasz

 I am using the Validation Files and not annotations.


 Regards
 Anshuman Nanda



 -Original Message-
 From: Lukasz Lenart [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 01, 2008 2:18 PM
 To: Struts Users Mailing List
 Subject: Re: Struts2 Validations


 Did you created validation files or added annotations?


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




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


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 Validations

2008-12-02 Thread Lukasz Lenart
2008/12/2 Anshuman Nanda [EMAIL PROTECTED]:
 I am using the Validation Files and not annotations.

So, without client-side validation enabled, your server-side
validation is working? If you enter some dummy data to your form, you
will get an error message?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread Dave Newton
--- On Tue, 12/2/08, hello_everyone wrote:
 I am working on an application, which is developed with
 struts 1.2.9.
 
 I added a .jsp page and action against that page. Now the
 problem is: if in struts-config.xml, I specify the path of 
 page with .jsp, it works. But with .do extension it doesn't 
 work. Is there any other place in struts besides configuration 
 file where we have to make an entry of the forward?

Without knowing more details it's hard to say what might be going wrong.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DOJO in struts2

2008-12-02 Thread Lukasz Lenart
2008/12/2 Faraz Ali [EMAIL PROTECTED]:
 My struts version is struts 2.0.11.2.

 Below is my decorators.xml file:

 decorators defaultdir=/decorators
  excludes
 pattern/styles/*/pattern
 pattern/scripts/*/pattern
 pattern/images/*/pattern
 /excludes
 decorator name=layout page=layout.jsp
 pattern/*/pattern
 /decorator
 /decorators

You should add also this:

pattern/*ajax=true*/pattern
pattern/scripts/dojo/*/pattern
pattern/struts/dojo/*/pattern
pattern/resources/*/pattern


 And below is my web.xml:

 filter
 filter-namesitemesh/filter-name
 filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-class

 /filter
 filter
 filter-namestruts2/filter-name
 filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class
 /filter
 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 filter-mapping
 filter-namesitemesh/filter-name
 url-pattern/*/url-pattern
 !-- dispatcherFORWARD/dispatcher --
 /filter-mapping


And add Struts cleanup before sitemesh

filter
filter-namestruts-cleanup/filter-name

filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-class
/filter


http://struts.apache.org/2.0.11.2/docs/sitemesh-plugin.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread Lukasz Lenart
2008/12/2 hello_everyone [EMAIL PROTECTED]:
 action name=someform path=/test
 type=mypackage.TestAction
 scope=session validate=false
 forward name=success path=/test2.do/
 forward name=failure path=/test.do/  //it works if it change it .jsp
 and add one more level //from path
 /action

Could you show how this action is configure?

forward name=success path=/test2.do/


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How can these query data be got?

2008-12-02 Thread Dave Newton
--- On Tue, 12/2/08, KE LI wrote:
 Suppose that I input this link
 xxx/welcome.do?param1=helloparam2=worldparamList=element1paramList=element2paramList=...
 into the link bar in the browser and run it. How can S2 knows 
 to put hello into param1 and world into param2 in the
 welcome action object?

Because those are the names of the parameters?

The parameters interceptor puts named parameters into action properties. You 
might want to check out some of the S2 documentation.

http://struts.apache.org/2.x/docs/parameters-interceptor.html

  Besides, suppose that I just run this link
 xxx/welcome.do?param1=helloparam2=worldparamList=element1paramList=element2paramList=...
 in the browser, only the default method execute will be called, 

Correct.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem when using result type=redirect-action

2008-12-02 Thread KE LI
admin{1}

2008/12/2 ravindra [EMAIL PROTECTED]

 I think some thing is wrong at these lines,

 result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result

 Your mapping should be like,
 result name=* type=redirect-actionViewTestedLetters/result

 All the best,

 -Original Message-
 From: holod [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, December 02, 2008 2:50 PM
 To: user@struts.apache.org
 Subject: Problem when using result type=redirect-action


 When I try to redirect action and set parameter value to it, I get an
 exception:

 [02.12.08 12:11:33:705 MSK] 0031 OgnlUtil  W
 com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
 OgnlException while setting property 'page' on type
 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
 ognl.NoSuchPropertyException:
 org.apache.struts2.dispatcher.ServletActionRedirectResult.page
at
 ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at

 com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV
 alueStack.java:81)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at

 com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at
 com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at
 com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)


 my struts.xml:

 action name=ViewTestedLetters class=admin.AdminViewTreatmentAction
 method=viewTested
result name=success /admin/treatmentadm.jsp/result
 /action

 action name=ApproveLetters class=admin.AdminEditTreatmentAction
 method=approve
result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result
 /action

 These two action classes have field:
 private int page;

 These two action classes have getter and setter for the field named page:
 public void setPage(int page) {
this.page = page;
 }

 public int getPage() {
return page;
 }

 Why does I get such exception?


 P.S.
 I've used this tutorial:
 http://struts.apache.org/2.x/docs/redirect-action-result.html


 --
 View this message in context:

 http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22
 -tp20788608p20788608.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Best Regards,
Licco


Problem when using result type=redirect-action

2008-12-02 Thread holod

When I try to redirect action and set parameter value to it, I get an
exception:

[02.12.08 12:11:33:705 MSK] 0031 OgnlUtil  W
com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
OgnlException while setting property 'page' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
 ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.page
at 
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:81)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)


my struts.xml:

action name=ViewTestedLetters class=admin.AdminViewTreatmentAction
method=viewTested
result name=success /admin/treatmentadm.jsp/result
/action

action name=ApproveLetters class=admin.AdminEditTreatmentAction
method=approve
result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result
/action

These two action classes have field:
private int page;

These two action classes have getter and setter for the field named page:
public void setPage(int page) {
this.page = page;
}

public int getPage() {
return page;
}

Why does I get such exception?


P.S.
I've used this tutorial:
http://struts.apache.org/2.x/docs/redirect-action-result.html


-- 
View this message in context: 
http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22-tp20788608p20788608.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Older Velocity Tag support and custom tags / directives...

2008-12-02 Thread carlo latasa
Hello all,

I've got  an older application built using xwork (1.x) and Velocity for all
of the html presentation pages. It also made use of several custom velocity
tags/directives that used the webwork based VelocityManager as well as the
velocity.app.VelocityEngine to build Templates.

On the actual .vm pages there is heavy use of the following formats:
- '#tag( TextField ...' - type tags (as opposed to the newer
'#stextfield(...' tags).
- Custom tags like: '#tag( Component template=/templates/errorMessages.vm
params.value=actionErrors )'
- #tag( *tagname* value='login.submit' align=right ) - where the actual
text for  'login.submit' is held in a properties file.

So - I'd like to upgrade to struts2 but am having a heck of a time finding
struts2 velocity specific documentation that will help me make the migration
without having to re-write the hundreds of .vm pages the application has.
I've looked at all of the struts documenction :
http://struts.apache.org/2.x/ as well as playing with the showcase
application. This information is great for someone starting off new but not
that helpful for someone in my position.

I've spent a couple of days messing with the velocity.properties, web.xml,
struts.xml and struts.properties files but haven't had much luck.

Is this possible? If so, I could sure use some Help!

Thanks in advance.

-- 
Carlo Latasa


RE: Struts2 Validations

2008-12-02 Thread Anshuman Nanda
Greetings Lukasz,

My validation are working fine from server-side using the same 
validation files.  I haven't had any issues there till now.  The only issue 
that I am facing is non-generation of client side javascript for validation.

Regards
Anshuman Nanda



-Original Message-
From: Lukasz Lenart [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2008 1:45 PM
To: Struts Users Mailing List
Subject: Re: Struts2 Validations


2008/12/2 Anshuman Nanda [EMAIL PROTECTED]:
 I am using the Validation Files and not annotations.

So, without client-side validation enabled, your server-side
validation is working? If you enter some dummy data to your form, you
will get an error message?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Submit Success and false

2008-12-02 Thread mthalis

After entering data to the form, if it success, it will redirect to the same
page. When it comes to that page the entered data are still the same. I want
to clear those data from my form. But if it fails i want to remain my data
as it is. How can i do it?
this is my part of the struts-config.xml page.
action
  attribute=userDataEnterForm
  input=admin.create.page
  name=userDataEnterForm
  path=/userDataEnter
  scope=request
  type=com.gad.struts.action.UserDataEnterAction
  forward name=success path=admin.create.page /
  forward name=failure path=admin.create.page /
/action
-- 
View this message in context: 
http://www.nabble.com/Submit-Success-and-false-tp20790660p20790660.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Older Velocity Tag support and custom tags / directives...

2008-12-02 Thread carlo latasa
Hello all,

I've got  an older application built using xwork (1.x) and Velocity for all
of the html presentation pages. It also made use of several custom velocity
tags/directives that used the webwork based VelocityManager as well as the
velocity.app.VelocityEngine to build Templates.

On the actual .vm pages there is heavy use of the following formats:
- '#tag( TextField ...' - type tags (as opposed to the newer
'#stextfield(...' tags).
- Custom tags like: '#tag( Component template=/templates/errorMessages.vm
params.value=actionErrors )'
- #tag( *tagname* value='login.submit' align=right ) - where the actual
text for  'login.submit' is held in a properties file.

So - I'd like to upgrade to struts2 but am having a heck of a time finding
struts2 velocity specific documentation that will help me make the migration
without having to re-write the hundreds of .vm pages the application has.
I've looked at all of the struts documenction :
http://struts.apache.org/2.x/ as well as playing with the showcase
application. This information is great for someone starting off new but not
that helpful for someone in my position.

I've spent a couple of days messing with the velocity.properties, web.xml,
struts.xml and struts.properties files but haven't had much luck.

Is this possible? If so, I could sure use some Help!

Thanks in advance.

-- 
Carlo Latasa



-- 
Carlo Latasa
EdgeDriven.com
Cell: (415) 385-1567

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Dojo datetimepicker problem

2008-12-02 Thread Dimitar Vlasev
Hi all,
I'm using Struts 2.0.14.

I'm experiencing the following problem:
I tried to use datetimepicker in sample application and it worked fine
except that the java.util.Date property does not retrieve the new
value selected in the interface.
I don't have more time today to check this out and will continue
trying to fix it tomorrow.
What's more weird if i have getter for a String property with the same
name I'll get the text that's in the edit box rendered from
s:datetimepicker /

Here are some snippets from my test application:

struts.xml
---
package name=test namespace=/ extends=struts-default
 .
action name=blah_* class=test.Test method={1}
result type=tilestiles_test/result
/action


the JSP
---
%@ page contentType=text/html; charset=UTF-8 %
%@ taglib prefix=s uri=/struts-tags %
s:head theme=ajax/
div
h2 User Details changed /h2
s:form action=blah_fetchDate
s:textfield name=someText/
s:datetimepicker name=aDate dayWidth=narrow 
weekStartsOn=1 /
s:submitSubmit Date/s:submit
/s:form
/div


the Action (implements RequestAware)
--
private Date aDate = new Date()

public String fetchDate() {
OgnlValueStack valueStack = (OgnlValueStack)
this.request.get(struts.valueStack);
log.info(- this.aDate:  + this.aDate.toString());
log.info(- vs: aDate:  
+valueStack.findString(aDate));
log.info(- vs: dojo.aDate:  
+valueStack.findString(dojo.aDate));
return Action.SUCCESS;
}

public Date getADate() {
return aDate;
}
public void setADate(Date date) {
log.info( Date set to:  + date.toString());
aDate = date;
}

public void setADate(String s) {
log.info( this one is called : + s);
}

console output
--
17:37:24,644 INFO  [Test]  this one is called :12/3/08
17:37:24,644 INFO  [Test] - this.aDate: Tue Dec 02 17:37:24 EET 2008
17:37:24,644 INFO  [Test] - vs: aDate: 12/2/08
17:37:24,644 INFO  [Test] - vs: dojo.aDate: null

as you can see setADate(Date date) never get's called.

I've checked the request made from the browser (using FF with FireBug)
and the post parameters were fine aDate and dojo.aDate where both
set to the correct value 12/3/08

I appreciate greatly your help.
Regards.

-- 
===
Dimitar Vlasev

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts2 Spring Plug-in

2008-12-02 Thread Richa Pandharikar
Morning All,

I am configuring my application to use struts 2 with spring. After I
modified the config files to use spring plugin bundled, tomcat server is
throwing the following exception. Your help is much appreciated to get this
issue resolved.

I am using Eclipse 6.6, struts 2.0.14 and the spring plug-in bundled along
with it.

Dec 2, 2008 10:16:31 AM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at
org.springframework.beans.factory.BeanCreationException.toString(BeanCreatio
nException.java:154)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at
org.springframework.core.NestedExceptionUtils.buildMessage(NestedExceptionUt
ils.java:47)
at
org.springframework.core.NestedRuntimeException.getMessage(NestedRuntimeExce
ption.java:67)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:267)
at java.lang.Throwable.toString(Throwable.java:343)
at
org.springframework.beans.factory.BeanCreationException.toString(BeanCreatio
nException.java:149)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at
org.springframework.core.NestedExceptionUtils.buildMessage(NestedExceptionUt
ils.java:47)
at
org.springframework.core.NestedRuntimeException.getMessage(NestedRuntimeExce
ption.java:67)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:267)
at java.lang.Throwable.toString(Throwable.java:343)
at
org.springframework.beans.factory.BeanCreationException.toString(BeanCreatio
nException.java:149)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at
org.springframework.core.NestedExceptionUtils.buildMessage(NestedExceptionUt
ils.java:47)
at
org.springframework.core.NestedRuntimeException.getMessage(NestedRuntimeExce
ption.java:67)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:267)
at java.lang.Throwable.toString(Throwable.java:343)
at
org.springframework.beans.factory.BeanCreationException.toString(BeanCreatio
nException.java:149)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at
org.springframework.core.NestedExceptionUtils.buildMessage(NestedExceptionUt
ils.java:47)
at
org.springframework.core.NestedRuntimeException.getMessage(NestedRuntimeExce
ption.java:67)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:267)
at java.lang.Throwable.toString(Throwable.java:343)
Dec 2, 2008 10:16:31 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 2, 2008 10:16:31 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/TDKTimeCard] startup failed due to previous errors

Thanks,
Richa


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What is the Struts way to construct this menu?

2008-12-02 Thread laredotornado

Hi,

I have a single select menu on my search page.  What is the struts way to
construct this menu such that when the user is redirected to this search
page, the menu is pre-selected with what they selected from the original
search?

Thanks, - Dave

  select size=1 name=searchCriteria
option value=exactMatchExactly
Matches/option
option
value=containsContains/option
option value=startsWithStarts
With/option
option value=endsWithEnds
With/option
  /select
-- 
View this message in context: 
http://www.nabble.com/What-is-the-Struts-way-to-construct-this-menu--tp20797547p20797547.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem when using result type=redirect-action

2008-12-02 Thread Adam Hardy
It's a feature! If you look below the stacktrace, you'll see it is logged as a 
warning. Nothing is actually wrong - it is a struts internal quirk.


ravindra on 02/12/08 09:25, wrote:

I think some thing is wrong at these lines,

result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result

Your mapping should be like,
result name=* type=redirect-actionViewTestedLetters/result

All the best,

-Original Message-
From: holod [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 02, 2008 2:50 PM

To: user@struts.apache.org
Subject: Problem when using result type=redirect-action


When I try to redirect action and set parameter value to it, I get an
exception:

[02.12.08 12:11:33:705 MSK] 0031 OgnlUtil  W
com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
OgnlException while setting property 'page' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
 ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.page
at
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV
alueStack.java:81)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)


my struts.xml:

action name=ViewTestedLetters class=admin.AdminViewTreatmentAction
method=viewTested
result name=success /admin/treatmentadm.jsp/result
/action

action name=ApproveLetters class=admin.AdminEditTreatmentAction
method=approve
result name=* type=redirect-action
 ViewTestedLetters
 /admin
 1
 /result
/action

These two action classes have field:
private int page;

These two action classes have getter and setter for the field named page:
public void setPage(int page) {
this.page = page;
}

public int getPage() {
return page;
}

Why does I get such exception?


P.S.
I've used this tutorial:
http://struts.apache.org/2.x/docs/redirect-action-result.html





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Null mapping reference in MappingDispatchAction

2008-12-02 Thread Adam Gordon

Hi-

We're using a MappingDispatchAction (Struts 1.2.9) and occasionally when 
a user makes a request to the URI for this action we get a 
NullPointerException in the class because the ActionMapping is null.  
Other than saying mapping = null, does anyone have any idea how the 
mapping reference could be null coming into this action instance?


Thanks.

--adam

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Managing file attachment

2008-12-02 Thread Shazad
Adam,
Once again. Thanks a lot for your reply. Really appreciate your help and
suggestion
while i still investigate to make it work :).

Regards
Shazad

On Mon, Dec 1, 2008 at 11:42 AM, Adam Ruggles [EMAIL PROTECTED] wrote:


 Instead of storing the file in the session, why don't you just store the
 file
 name and path.  If the user doesn't resubmit the request, then check for
 the
 file when the session expires and remove the file.  I agree storing the
 file
 itself is a bad idea, but a reference to the location should be fine.  You
 should prob. move the file to a temporary location.

 It has been too long since I've used struts1 to help you with the
 specifics,
 but I'm pretty sure there is nothing built in to deal with this scenario.


 Khawaja-Shahzad Butt wrote:
 
  Hi
 
  Adam,
  Thanks for your reply, really appreciate it. I am using struts 1.3. The
  validation is via validation.xml
  and it kicks in
  even before the action class can read the file, persistence is later
 step.
 
  The problem is if the do store the file in session in action class and
  then
  invoke manual
  validation i.e. valid current form etc.
 
  *The session object will become huge. Then every time
  i will have to store that file in session and then remove from session.
 
  Which doesn't seem a good approach in terms of performance.**. what do
 you
  say?*
 
 
  As far client side validation is concerned, the validtion.xml provides
  powerful ways which
  might be tough to do i.e. showing error messages etc... Also it will be
  like
  redoing
  the work struts valdition framework has done.
  *
  Any other options???.*
 
  *
  Can you guide me to custom the file interceptor any example of that. I
  know
  the default
  destroys the file object as soon as the request has been sent?*
 
  *
  Also is it possible i can get the path of the file like
  'c:\files\foobar.txt' and in case of
  validation error messages read the file from that locaton ???*
 
  Please reply..
 
  Thanks again,
 
  Shazad
 
  On Mon, Dec 1, 2008 at 1:02 AM, Adam Ruggles [EMAIL PROTECTED]
 wrote:
 
 
  I could be wrong but I believe you'd have to implement your own file
  upload
  interceptor and make sure the file is not removed after the execution of
  the
  action if a validation error occurs.  Then you'd need to re-associate
  that
  saved file when the next request occurs.  Also what happens if they
 never
  resubmit the request.  You will have a file sitting around.
 
  I can't think of a good way to handle that scenario since your not
  storing
  any information in the session or persistence layer and each request is
  really stateless.
 
  Adding client side validation might be your best bet.  That way the file
  isn't even submitted until the form passes validation.
 
 
  Khawaja-Shahzad Butt wrote:
  
   Hi,
  
   I am having an issue with struts file upload during validation. On the
   page
   when there's
   a  validation error, the browsed/attached file drops. Does anyone
   know a work around it, to have the previously attached file in tact,
   meaning
   if i have attached a file and hit submit and got the validation error,
  the
   file should still be
   there, so that i don't have reattach it again.
  
   Storing the file in session is out of league as it's not a good
  approach.
  
   Again my problem is if i attach a file and hit submit button and get
   validation errors defined
   in validation.xml, i fix the validation error and now i have re-attach
   that
   file again since it
   gets detached.
  
   Please reply.
  
   Thanks
   Thanks
  
  
 
  --
  View this message in context:
  http://www.nabble.com/Managing-file-attachment-tp20762606p20766975.html
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Managing-file-attachment-tp20762606p20774724.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




populate pb of the selected Item

2008-12-02 Thread elyes sallem
Hello,
i have a page, in which there is two form
the second form contains 2 pair of 2 select
the first pair add an OR to shortlist when we click on sumbit button (this
submit works ), the second pair is to delete an or from a shortlist
so when i select a shortlist, the list of OR in second select will be
updated
my problem  is when i submit the second pair of select, the properties
selected are not populated
they took the value i set in the constructor of the actionForm, not those
selected by the user
*here is my jsp*

html:form action=EditShortList.do?do=addOrShortList


nom de la Short list  :

  html:text property=addedList/
  html:submit value=ajouter/br /

  br /
  /html:form
  table style=border: 1px solid rgb(80, 142, 204);
 border=0 cellpadding=0 cellspacing=0
tbody
  tr

td
 style=border: 1px solid rgb(80, 142, 204); width: 2591px; height: 22px;
background-color: rgb(80, 142, 204); text-align: left; Ajout d'OR dans une
Short
list/td

  /tr
  tr

/tr
/tbody
  /table

  br /
html:form action=EditShortList.do?do=ajouterOuSupprimerOr
Short list  :
nested:nest property=selectedAddShortlist
nested:select property=orshortlistId
onchange=form.action='EditShortList.do?do=refreshOrShortList';
form.submit();
html:optionsCollection property=shortListsAdd value=orshortlistId
label=orshortlistNom /
/nested:select
/nested:nest
OR :
nested:nest property=selectedAddOr
nested:select property=orId
html:optionsCollection property=addOrList value=orId label=orCode /
/nested:select
/nested:nest
  nested:submit value=ajouter property=faire/


  table style=border: 1px solid rgb(80, 142, 204);
 border=0 cellpadding=0 cellspacing=0
tbody

  tr
td
 style=border: 1px solid rgb(80, 142, 204); width: 2591px; height: 22px;
background-color: rgb(80, 142, 204); text-align: left; Suppression d'OR
dans une Short
list/td
  /tr
  tr

/tr
/tbody
  /table

Short list  :
nested:nest property=selectedDeleteShortlist
nested:select  property=orshortlistId
 onchange=form.action='EditShortList.do?do=refreshOrShortList';
form.submit();
html:optionsCollection property=shortListsDelete value=orshortlistId
label=orshortlistNom /
/nested:select
/nested:nest
OR :
nested:nest property=selectedDeleteOr
nested:select  property=orId 
html:optionsCollection property=delOrList value=orId label=orCode /
/nested:select
/nested:nest
  nested:submit value=supprimer property=faire  /
/html:form


*
and the action form :*

public class ShortListEditForm extends ActionForm{
String addedList;
String faire;
OrShortList selectedAddShortlist;
OrShortList selectedDeleteShortlist;
OrdreRegrpmt selectedAddOr;
OrdreRegrpmt selectedDeleteOr;



java.util.ListOrShortList shortListsAdd = new
ArrayListOrShortList();
java.util.ListOrShortList shortListsDelete = new
ArrayListOrShortList();
java.util.ListOrdreRegrpmt addOrList = new
ArrayListOrdreRegrpmt();
java.util.ListOrdreRegrpmt delOrList = new
ArrayListOrdreRegrpmt();




public ShortListEditForm() {
faire=;
selectedDeleteShortlist=new OrShortList(0,select a short
list);
selectedAddShortlist=new OrShortList(0,select a short
list);
selectedDeleteOr=new OrdreRegrpmt(0,select a Short list);
selectedAddOr=new OrdreRegrpmt(0,select a Short list);

}

public java.util.ListOrdreRegrpmt getAddOrList() {
if (selectedAddShortlist.getOrshortlistId()==0){
java.util.ListOrdreRegrpmt addOrList1 = new
ArrayListOrdreRegrpmt();
addOrList1.add(new OrdreRegrpmt(0,select a Short
list));
setSelectedAddOr(new OrdreRegrpmt(0,select a Short
list));
setAddOrList(addOrList1) ;
}
return this.addOrList;
}
public void setAddOrList(java.util.ListOrdreRegrpmt addOrList) {
this.addOrList = addOrList;
}




public java.util.ListOrdreRegrpmt getDelOrList() {
if (selectedDeleteShortlist.getOrshortlistId()==0){
java.util.ListOrdreRegrpmt delOrList1 = new
ArrayListOrdreRegrpmt();
delOrList1.add(new OrdreRegrpmt(0,select a Short
list));
setSelectedDeleteOr(new OrdreRegrpmt(0,select a
Short list));
setDelOrList(delOrList1);

}
return this.delOrList;
}
public void setDelOrList(java.util.ListOrdreRegrpmt delOrList) {

Re: Dojo datetimepicker problem

2008-12-02 Thread Timothy Orme

Hello,

	Someone might have to jump in and correct me on this but I think that it should just be coming in as a string. As I understand it, the form's action doesn't know that you're using a datepicker in the 
form, it only sees a text field with a value (a string). Struts tag libs just generate HTML and shouldn't have any influence on what data type is passed through. Therefore, you should be using the 
string setter instead. If you wanted to get this into a date object after, I would just get it as a string and use a date formatter to build your date.


-Tim Orme

Dimitar Vlasev wrote:

Hi all,
I'm using Struts 2.0.14.

I'm experiencing the following problem:
I tried to use datetimepicker in sample application and it worked fine
except that the java.util.Date property does not retrieve the new
value selected in the interface.
I don't have more time today to check this out and will continue
trying to fix it tomorrow.
What's more weird if i have getter for a String property with the same
name I'll get the text that's in the edit box rendered from
s:datetimepicker /

Here are some snippets from my test application:

struts.xml
---
package name=test namespace=/ extends=struts-default
 .
action name=blah_* class=test.Test method={1}
result type=tilestiles_test/result
/action


the JSP
---
%@ page contentType=text/html; charset=UTF-8 %
%@ taglib prefix=s uri=/struts-tags %
s:head theme=ajax/
div
h2 User Details changed /h2
s:form action=blah_fetchDate
s:textfield name=someText/
s:datetimepicker name=aDate dayWidth=narrow weekStartsOn=1 
/
s:submitSubmit Date/s:submit
/s:form
/div


the Action (implements RequestAware)
--
private Date aDate = new Date()

public String fetchDate() {
OgnlValueStack valueStack = (OgnlValueStack)
this.request.get(struts.valueStack);
log.info(- this.aDate:  + this.aDate.toString());
log.info(- vs: aDate:  
+valueStack.findString(aDate));
log.info(- vs: dojo.aDate:  
+valueStack.findString(dojo.aDate));
return Action.SUCCESS;
}

public Date getADate() {
return aDate;
}
public void setADate(Date date) {
log.info( Date set to:  + date.toString());
aDate = date;
}

public void setADate(String s) {
log.info( this one is called : + s);
}

console output
--
17:37:24,644 INFO  [Test]  this one is called :12/3/08
17:37:24,644 INFO  [Test] - this.aDate: Tue Dec 02 17:37:24 EET 2008
17:37:24,644 INFO  [Test] - vs: aDate: 12/2/08
17:37:24,644 INFO  [Test] - vs: dojo.aDate: null

as you can see setADate(Date date) never get's called.

I've checked the request made from the browser (using FF with FireBug)
and the post parameters were fine aDate and dojo.aDate where both
set to the correct value 12/3/08

I appreciate greatly your help.
Regards.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Who's going to Devoxx conference, Antwerp?

2008-12-02 Thread Rene Gielen
Probably the biggest European Java conference, Devoxx (formerly known as 
Javapolis) is happening next week in Antwerp, Belgium.


At least two Struts2 developers, namely Rainer Hermanns and me, will be 
attending. Are any Struts2 users also attending? If yes, how about 
scheduling an informal get-together besides the conference?


Regards,
- Rene

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What is the Struts way to construct this menu?

2008-12-02 Thread Andreas Mähler

Hello laredotornado,

laredotornado schrieb:

I have a single select menu on my search page.  What is the struts way to
construct this menu such that when the user is redirected to this search
page, the menu is pre-selected with what they selected from the original
search?

Thanks, - Dave

  select size=1 name=searchCriteria
option value=exactMatchExactly
Matches/option
option
value=containsContains/option
option value=startsWithStarts
With/option
option value=endsWithEnds
With/option
  /select


Normally, you would go for the ordinary s:select-Tag [1], but I am not 
using it, because it is buggy[2]. You can also do it by hand like I do:


c:set var=selectedselected=selected/c:set

select id=type name=type class=type size=1
	option value=all ${type == 'all' ? selected : ''}(keine 
Einschränkung)/option
	option value=user style=background-image: 
url(${cp}/_global/user.png) ${type == 'user' ? selected : 
''}Benutzer/option
	option value=tag style=background-image: 
url(${cp}/_global/tag.png) ${type == 'tag' ? selected : ''}Tag/option
	option value=object style=background-image: 
url(${cp}/_global/object.png) ${type == 'object' ? selected : 
''}Objekt/option

/select


~Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What is the Struts way to construct this menu?

2008-12-02 Thread Andreas Mähler

Andreas Mähler schrieb:

Normally, you would go for the ordinary s:select-Tag [1], but I am not 
using it, because it is buggy[2]. You can also do it by hand like I do:




Sorry - forgot the refs:

[1] http://struts.apache.org/2.1.2/docs/select.html
[2] https://issues.apache.org/struts/browse/WW-2758


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: .do and .jsp

2008-12-02 Thread hello_everyone
Is there any way to make this work, without moving .jsp pages to web-inf. i
am using Jdeveloper and they are under Web Content-pages

On Tue, Dec 2, 2008 at 3:02 PM, hello_everyone [EMAIL PROTECTED]wrote:

 action name=someform path=/test2
   type=mypackage.Test2Action
   scope=session validate=false
   forward name=success path=/test3.do/
   forward name=failure path=/test3.do/
   /action

 the problem seems to be : jsp pages are not in web-inf. but all other pages
 are working with .do except the one which i added.

 On Tue, Dec 2, 2008 at 2:06 PM, Lukasz Lenart 
 [EMAIL PROTECTED] wrote:

 2008/12/2 hello_everyone [EMAIL PROTECTED]:
  action name=someform path=/test
  type=mypackage.TestAction
  scope=session validate=false
  forward name=success path=/test2.do/
  forward name=failure path=/test.do/  //it works if it change it
 .jsp
  and add one more level //from path
  /action

 Could you show how this action is configure?

 forward name=success path=/test2.do/


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





Re: .do and .jsp

2008-12-02 Thread Paul Benedict
Definitely move them under WEB-INF. Otherwise, you can never enforce
people going through your action if they know the JSP address.

At any rate, you can just put the JSP file in the path of the forward

Paul

On Wed, Dec 3, 2008 at 1:14 AM, hello_everyone [EMAIL PROTECTED] wrote:
 Is there any way to make this work, without moving .jsp pages to web-inf. i
 am using Jdeveloper and they are under Web Content-pages

 On Tue, Dec 2, 2008 at 3:02 PM, hello_everyone [EMAIL PROTECTED]wrote:

 action name=someform path=/test2
   type=mypackage.Test2Action
   scope=session validate=false
   forward name=success path=/test3.do/
   forward name=failure path=/test3.do/
   /action

 the problem seems to be : jsp pages are not in web-inf. but all other pages
 are working with .do except the one which i added.

 On Tue, Dec 2, 2008 at 2:06 PM, Lukasz Lenart 
 [EMAIL PROTECTED] wrote:

 2008/12/2 hello_everyone [EMAIL PROTECTED]:
  action name=someform path=/test
  type=mypackage.TestAction
  scope=session validate=false
  forward name=success path=/test2.do/
  forward name=failure path=/test.do/  //it works if it change it
 .jsp
  and add one more level //from path
  /action

 Could you show how this action is configure?

 forward name=success path=/test2.do/


 Regards
 --
 Lukasz
 http://www.lenart.org.pl/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]