Initializing Actions from Spring

2008-03-29 Thread georgievh


Hi,

I am trying to initialize Struts2 Actions from Spring.
I have done this successfully using struts2 xml configuration files.
However, I did not have the same success when using annotations.

Could anyone please explain how I can achieve this.

Here is my approach:
In file MainpageAction.java I have:
...
@Result( name="success", value="mainpage.page", type=TilesResult.class )
...

In applicationContext.xml I have:
…


Buenos Dias!


…

Thank you in advance for your help
-- 
View this message in context: 
http://www.nabble.com/Initializing-Actions-from-Spring-tp16377674p16377674.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: Client Side Validation with Struts

2008-03-29 Thread Asad Habib
Hello. I am using Struts 1.3.8. The issue is not one of making the
Javascript work (it is working correctly), but rather preventing a
Struts action from being called. Is this possible given that the
action of a form is a Struts action?

- Asad



On Sat, Mar 29, 2008 at 6:44 AM, Lukasz Lenart
<[EMAIL PROTECTED]> wrote:
> Hi,
>
>  Could you be more specific, which Struts version? If you use onsubmit
>  event, you should do that like this:
>
>  onsubmit="JavaScript: return validate();"
>
>  where validate() has to return true or false.
>
>
>  Regards
>  --
>  Lukasz
>
>  http://www.linkedin.com/in/lukaszlenart
>
>  -
>  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]



Possible to unit test actions through type converters?

2008-03-29 Thread Karr, David
This might be a violation of pure "unit test" guidelines, but is it
practical to test an action such that the type converters for properties
are automatically executed, just like they would normally?  It's nice
that actions are plain POJOs, but I wonder if it's practical to test the
processing of property values into the type converters.

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



Annotations for additional properties for type converters?

2008-03-29 Thread Karr, David
I don't necessarily need this, but is it possible to add annotations to
"TypeConversion" to configure properties of the type converter?  It's
nice to be able to define type converters in annotations, but you could
achieve some more reuse of type converters if they were more
configurable from the point of reference.  For instance (like in
PAS2W2P's example) if you have a converter for a specific date format,
you could make the converter more generic, and specify the date format
in the annotation.  I suppose I might also considering injecting the
format through spring from a properties file also.

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



Re: Validation

2008-03-29 Thread Nuwan Chandrasoma

Hi,

Simple theme doesn't support Validation and error reporting. you may 
have to use some other theme like xhtml theme


http://struts.apache.org/2.x/docs/xhtml-theme.html

Thanks,

Nuwan

Rodrigo Pereira wrote:

Hi,
how can I position validation message on the screen? Also, when I have
a simple theme form I am getting JS error alert message "[object
Error]", does anybody know how to fix that?

form:


   

*:





validation.xml:



   



  





  



Thanks,
Rodrigo Pereira

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



Validation

2008-03-29 Thread Rodrigo Pereira
Hi,
how can I position validation message on the screen? Also, when I have
a simple theme form I am getting JS error alert message "[object
Error]", does anybody know how to fix that?

form:


 

*:





validation.xml:



   



  





  



Thanks,
Rodrigo Pereira

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



Re: struts- validation messages

2008-03-29 Thread Nuwan Chandrasoma

http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html

Thanks,

Nuwan


Sonu S wrote:

Hi,

I am using struts in my application. to validate users entry in jsp i have
my validation method. and i am calling that method in action class. code is
below:(I am not using struts' validations )

//  in action class, calling validate method
ActionErrors errors = myForm.validate(mapping,request);


//In form bean
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
if(("".equals(name.trim({
errors.add(name, new ActionError("myForm.Name"));
}
if(("".equals(address.trim({
errors.add(address, new ActionError("myForm.address"));
}
return errors;
}



// in action class checking is errors are empty
if (!errors.isEmpty()) {
saveErrors(request, errors);
return mapping.findForward("ADD");
}


above code is working fine. Only problem is it is printing error messages in
jsp in one line.

example: Enter Name. Enter Address.


I would like to show every error message on new line in jsp. is it possible.


in jsp i am using  to print message.


thank you for your time and solutions

  



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



struts- validation messages

2008-03-29 Thread Sonu S
Hi,

I am using struts in my application. to validate users entry in jsp i have
my validation method. and i am calling that method in action class. code is
below:(I am not using struts' validations )

//  in action class, calling validate method
ActionErrors errors = myForm.validate(mapping,request);


//In form bean
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
if(("".equals(name.trim({
errors.add(name, new ActionError("myForm.Name"));
}
if(("".equals(address.trim({
errors.add(address, new ActionError("myForm.address"));
}
return errors;
}



// in action class checking is errors are empty
if (!errors.isEmpty()) {
saveErrors(request, errors);
return mapping.findForward("ADD");
}


above code is working fine. Only problem is it is printing error messages in
jsp in one line.

example: Enter Name. Enter Address.


I would like to show every error message on new line in jsp. is it possible.


in jsp i am using  to print message.


thank you for your time and solutions


Re: Client Side Validation with Struts

2008-03-29 Thread Lukasz Lenart
Hi,

Could you be more specific, which Struts version? If you use onsubmit
event, you should do that like this:

onsubmit="JavaScript: return validate();"

where validate() has to return true or false.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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