RE: pre-populating DynaValidatorForm

2004-03-25 Thread Takhar, Sandeep
Isn't this assuming there are no modules?

sandeep

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 7:11 PM
To: 'Struts Users Mailing List'
Subject: RE: pre-populating DynaValidatorForm


Dean,
Here's the essential code in order to instantiate a DynaActionForm from
within an Action class.

 FormBeanConfig fbc = new FormBeanConfig();
 fbc.setName(myForm);
 DynaActionFormClass dafc =
 DynaActionFormClass.createDynaActionFormClass(fbc);
 DynaActionForm formBean = (DynaActionForm) dafc.newInstance();
 formBean.set(myProperty, someValue);
 request.setAttribute(myDynaForm,formBean);

-Richard
-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 23, 2004 7:48 AM
To: Struts Users Mailing List
Subject: Re: pre-populating DynaValidatorForm


See http://www.mail-archive.com/[EMAIL PROTECTED]/msg96035.html

hth,
Hubert

--- Dean A. Hoover [EMAIL PROTECTED] wrote:
 I am using struts 1.1, and I am directly instantiating a
 DynaValidatorForm in
 my Action class. I am hesitant to embrace struts 1.2 at this time, 
 especially if
 the difference between 1.1 and 1.2 is as large as betwee 1.0 and 1.1. Is 
 there
 some other way to accomplish it?
 
 Dean Hoover
 
 Hubert Rabago wrote:
 
 What version of Struts are you using?  How are you instantiating your 
 Dyna*Form?  Struts 1.1 didn't really have direct support for 
 instantiating DyanForms from an Action object.  Struts 1.2.0/nightly 
 build does.  Is it possible that you're using 1.1 and instantiating the
form incorrectly?
 
   
 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

-
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]

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



RE: using html:form with el logic tags

2004-03-25 Thread Takhar, Sandeep
I'm going out on a limb here, but usually I wouldn't do the xml like that with 
html:form since it is unbalanced...

You'll have to find a workaround I think...

sandeep

-Original Message-
From: Simon Pett [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 8:31 AM
To: 'Struts Users Mailing List'
Subject: using html:form with el logic tags



Hi,

Can someone tell me why I get an unbalanced error when I try to optionally
use a form tag? 

org.apache.jasper.JasperException: /pages/common/layouts/layout.jsp(56,1)
The end tag /c:when is unbalanced


tiles:useAttribute name=action/
tiles:useAttribute name=focus/

c:choose
c:when test=${focus != 'na'}
html:form action=${action} focus=${focus}
/c:when
c:otherwise
html:form action=${action}
/c:otherwise
/c:choose

...


Using struts 1.1

Thanks
Simon


-
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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Takhar, Sandeep
yes it is.  It should be done once per classloader.

When struts populates the dyna form it is string array to string array conversion and 
uses 
populate method of BeanUtils which eventually calls the converters.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:47 PM
To: Struts Users Mailing List
Subject: Re: Handling Date objects in ActionForm gracefully


I am thinking of overriding the struts default mechanism.
Override the default behavior of org.apache.commons.beanutils.ConvertUtils 
by registering
a valid converter...

I want to know if the above is possible..

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






Mark Lowe mark.lowe
@boxstuff.com
03/25/2004 02:36 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: Handling Date objects in ActionForm gracefully


Have it as a string and convert it to a date or calendar when you pass 
it back to the model.


On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

 All,

 We are facing a problem when we define java.util.Date field in 
 ActionForm.

 Is there any way to override the default behavior provided by Struts?

 I very much appreciate your help!!

 Thanks and Regards,
 Sree/-


 --- 
 -
 This is a PRIVATE message. If you are not the intended recipient, 
 please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery. NOTE: Regardless of content, this e-mail shall not operate to
 bind CSC to any order or other contract unless pursuant to explicit
 written agreement or government initiative expressly permitting the 
 use of
 e-mail for such purpose.
 --- 
 -


-
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: Handling Date objects in ActionForm gracefully

2004-03-25 Thread Takhar, Sandeep
There are converters that can be used for overriding.  For example BigDecimalConverter 
is a converter that handles any object going to a BigDecimal.

you need to register the converters.  Take a look at BeanUtils.deregister which is 
called in a static block at the beginning of BeanUtils.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 3:11 PM
To: Struts Users Mailing List
Subject: RE: Handling Date objects in ActionForm gracefully


Do you know if the behavior can be overridden?

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.






Takhar, Sandeep Sandeep.Takhar
@CIBC.ca
03/25/2004 02:53 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:RE: Handling Date objects in ActionForm gracefully


yes it is.  It should be done once per classloader.

When struts populates the dyna form it is string array to string array 
conversion and uses 
populate method of BeanUtils which eventually calls the converters.

sandeep

-Original Message-
From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 2:47 PM
To: Struts Users Mailing List
Subject: Re: Handling Date objects in ActionForm gracefully


I am thinking of overriding the struts default mechanism.
Override the default behavior of org.apache.commons.beanutils.ConvertUtils 

by registering
a valid converter...

I want to know if the above is possible..

Thanks and Regards,
Sree/-



This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 

e-mail for such purpose.






Mark Lowe mark.lowe
@boxstuff.com
03/25/2004 02:36 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List 
[EMAIL PROTECTED]
cc: 
Subject:Re: Handling Date objects in ActionForm gracefully


Have it as a string and convert it to a date or calendar when you pass 
it back to the model.


On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote:

 All,

 We are facing a problem when we define java.util.Date field in 
 ActionForm.

 Is there any way to override the default behavior provided by Struts?

 I very much appreciate your help!!

 Thanks and Regards,
 Sree/-


 --- 
 -
 This is a PRIVATE message. If you are not the intended recipient, 
 please
 delete without copying and kindly advise us by e-mail of the mistake in
 delivery. NOTE: Regardless of content, this e-mail shall not operate to
 bind CSC to any order or other contract unless pursuant to explicit
 written agreement or government initiative expressly permitting the 
 use of
 e-mail for such purpose.
 --- 
 -


-
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]




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



RE: Sycnhronizer Token- can someone explain this?Curre

2004-03-24 Thread Takhar, Sandeep
I'm not sure if I understand fully, but if you are using html:link there is a 
transaction attribute.

sandeep

-Original Message-
From: James Scrimshire [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 5:41 AM
To: [EMAIL PROTECTED]
Subject: Sycnhronizer Token- can someone explain this?Curre


Currently I have an Action that does the following

 if (isCancelled(request)) {
log.debug(Request Cancelled);
return mapping.findForward(home);
}

ActionErrors errors = new ActionErrors();
if (!isTokenValid(request)) {
log.debug(Invalid Token  );
errors.add(
ActionErrors.GLOBAL_ERROR,
new ActionError(errors.token));
}
else
{
  log.debug(token success);
}
resetToken(request);

if (!errors.isEmpty()) {
saveErrors(request, errors);
saveToken(request);
return (mapping.getInputForward());
}

// Forward to result page
return mapping.findForward(success);

My problem is the pattern doesn't work unless i save the token in a
previous action using the saveToken(rquest) method..
but what about if I want to go from this action to a page to another
action? this action only saves the token on a resubmit. and reset it if it
is the first occurence. so if i want to do the
action-page-action-page-action how do i go abuot saving the token??  how
should it get saved the first time?

does any one even understand waht i'm saying.. cos i'm not sure i do
anymore








For the latest data on the economy and society 
consult National Statistics at http://www.statistics.gov.uk

**
Please Note:  Incoming and outgoing email messages
are routinely monitored for compliance with our policy
on the use of electronic communications
**
Legal Disclaimer  :  Any views expressed by
the sender of this message are not necessarily
those of the Office for National Statistics
**

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

-
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: Sycnhronizer Token- can someone explain this?Curre

2004-03-24 Thread Takhar, Sandeep
I'm not sure how it worked in 1.1, but what you're saying makes sense.

Basically there is a computeURL function that add the transaction attribute only if it 
is set (in 1.1).  This is for the html:link that I am talking about:

// Add our transaction control token (if requested)
if (transaction) {
HttpSession session = pageContext.getSession();
String token = null;
if (session != null) {
token = (String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
}
if (token != null) {
results.put(Constants.TOKEN_KEY, token);
}
}

So that is good I guess, but I don't know what you are trying to do

someaction - saveToken - jsp

jsp has transaction = true which means that it will propagate to the next action that 
it submits to.

I may be missing something...

sandeep

-Original Message-
From: James Scrimshire [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 8:39 AM
To: [EMAIL PROTECTED]
Subject: RE: Sycnhronizer Token- can someone explain this?Curre



sandeep.

using transaction=true..  this is what i get from the action the link
submits too

as you can see the session token is null, and only gets set when i
explicitly call saveToken(request) from a prior action


2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction:

2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction: Request
Token = null
2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction: Session
Token = null
2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction:

2004-03-24 13:36:34,089 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction: Invalid
Token




For the latest data on the economy and society 
consult National Statistics at http://www.statistics.gov.uk

**
Please Note:  Incoming and outgoing email messages
are routinely monitored for compliance with our policy
on the use of electronic communications
**
Legal Disclaimer  :  Any views expressed by
the sender of this message are not necessarily
those of the Office for National Statistics
**

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

-
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: Sycnhronizer Token- can someone explain this?Curre

2004-03-24 Thread Takhar, Sandeep
there would have to be an if statement somewhere

if (view)
saveToken
...


if (submit)
...

you wouldn't need the html:link thing then that is for double clicking the link I 
believe.

Search the archives for how tokens work exactly.  I believe Ted Husted's site may
have some insight as well.  

(I can't remember, but I think html:form is in the puzzle as well)

sandeep

-Original Message-
From: James Scrimshire [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 9:07 AM
To: [EMAIL PROTECTED]
Subject: RE: Sycnhronizer Token- can someone explain this?Curre



well at the moment i'm just trying to get it to work from an html page that
submits to an action
so the html has the transaction=true and the action checks the token

i have been debugged the value of the session attribute
Globals.TRANSACTION_TOKEN_KEY  at the start of the action the page submits
to..

the isValidToken fails beacuse the session token is null. the only way It
is not null is if I save the token in a previous action

what i want to know is how does this work for a single action? what if i
only hadf one action? (admittedly i wouldn't need the pattern then)



   

  [EMAIL PROTECTED]

  BC.caTo:   [EMAIL PROTECTED] 
   
   cc: 

  24/03/04 14:01   Subject:  RE: Sycnhronizer Token- can 
someone explain this?Curre
  Please respond to

  struts-user  

   

   





I'm not sure how it worked in 1.1, but what you're saying makes sense.

Basically there is a computeURL function that add the transaction attribute
only if it is set (in 1.1).  This is for the html:link that I am talking
about:

// Add our transaction control token (if requested)
if (transaction) {
HttpSession session = pageContext.getSession();
String token = null;
if (session != null) {
token = (String)
session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);
}
if (token != null) {
results.put(Constants.TOKEN_KEY, token);
}
}

So that is good I guess, but I don't know what you are trying to do

someaction - saveToken - jsp

jsp has transaction = true which means that it will propagate to the next
action that it submits to.

I may be missing something...

sandeep

-Original Message-
From: James Scrimshire [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 8:39 AM
To: [EMAIL PROTECTED]
Subject: RE: Sycnhronizer Token- can someone explain this?Curre



sandeep.

using transaction=true..  this is what i get from the action the link
submits too

as you can see the session token is null, and only gets set when i
explicitly call saveToken(request) from a prior action


2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction:

2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction: Request
Token = null
2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction: Session
Token = null
2004-03-24 13:36:34,073 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction:

2004-03-24 13:36:34,089 [DEBUG]
gov.ons.classifications.controller.action.SynchronizerTokenAction: Invalid
Token




For the latest data on the economy and society
consult National Statistics at http://www.statistics.gov.uk

**
Please Note:  Incoming and outgoing email messages
are routinely monitored for compliance with our policy
on the use of electronic communications
**
Legal Disclaimer  :  Any views expressed by
the sender of this message are not necessarily
those of the Office for National Statistics
**


RE: Struts validator Regular Expressions

2004-03-24 Thread Takhar, Sandeep
don't quote me but the javadocs for jakarta's regular expression's RE class are ok.

Also I believe everything is based on jakarta's oro.

sandeep

-Original Message-
From: Joao Batistella [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:33 PM
To: 'Struts Users Mailing List'
Subject: Struts validator Regular Expressions


Hello!

Do you know any document where can I learn how to build regular expressions
for Struts Validator?

I need to validate an IP address and I don't know how is the syntax in the
validator config file.

Thanks,
JP

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