Re: Struts 2 - Repopulate controls when validation fails

2008-06-25 Thread Lukasz Lenart
Hi,

As I know, use of s:action tag should be avoided, the better option is
to use Preparable interface, you can use prepare() method
also.
http://struts.apache.org/2.x/docs/prepare-interceptor.html


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

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



Re: validation problem

2008-06-25 Thread Lukasz Lenart
> I can implement custom validation using validate(), but I've around 30
> transactional forms with this type of requirements.

Maybe it will be better if you implement your own validator for thoese
30 forms? I think it will be soft option then very compilcated
expression above ;-)


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

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



Re: Including XML files in maven war file

2008-06-25 Thread Lukasz Lenart
Hi

>   

Add namespace attribute like this namespace="/front"

> However, when I run "mvn jetty:run", Struts 2 doesn't find the action
> "front/home.action". I looked in the target directory as well as in the war
> file packaged with the command "mvn package", and I saw that front.xml was
> NOT included in WEB-INF/classes/net/ruready/web/front. How can I include it?

Put fron.txml file with whole path under src/main/resources, maven
only looks for classes from src/main/java and all other *.proeprties,
*.xml should be unser src/main/resources


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

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



Re: validation problem

2008-06-25 Thread ManiKanta G

Hi,

Even I've this problem... Here is my requirement

I've 3 fields. On successful validation of 1st field ONLY the 2nd field 
should be validated, and only with the successful validation of second, 
then only the 3rd field should be validated against some validation.


I did this by using field validator of type expression, like below...

   *
   
   
   Select 'Return to'
   
   

   
   
   
   
   Select company/dealer name
  
   


   
   
   
   
   Select drug
   
   

   *

With this, the second case working as it supposed. The second field will 
be validated ONLY when the first field is not empty (as in the second 
field expression, I m using */returnTo == null/* with short-circuit OR, 
and then the actual validation logic of second field).


But the validation logic of the third field (select box) is not working 
as is supposed to. When I print the expression value using *value="expression_of_the_third_field_."/>*, it is printing false, 
but the validation is being bypassed.


I've tried many ways. But non of 'em worked for me. Is any one got 
success with this type of validations.


I can implement custom validation using validate(), but I've around 30 
transactional forms with this type of requirements.


Am I doing any this wrong? Can anybody please guide me with this...


Thanks,
ManiKanta



Dave Newton wrote:

You either do conditional validations, implement custom validators, or as 
Lukasz suggested write your own validate() method. When validation is very 
complex the last may be the best options.

Dave

--- On Wed, 6/25/08, Istvan Kozma <[EMAIL PROTECTED]> wrote:
  

How the validation should be done for fields which are only
displayed in certain conditions? If  I do this through the
XML file the validation is done all the time even when the
field is not visible. 


Istvan


- Original Message 
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List

Sent: Wednesday, June 25, 2008 3:37:38 PM
Subject: Re: validation problem

Whoops, as the other reply said, it's the
 tag [1], not .

Dave

[1] http://struts.apache.org/2.x/docs/fielderror.html

--- On Wed, 6/25/08, Dave Newton
<[EMAIL PROTECTED]> wrote:


--- On Wed, 6/25/08, Anshu Dhamija wrote:
  

i am facing problem in performing validation


through


xml actually i want to display message at the top

of 

my form instaed of at field level 
can anyone please help me


The validation messages are placed in the form by the
  

S2


form element tags. If you want to modify the output of
those tags you can modify or create a theme [1].

Using the "simple" theme will also remove
  

the


validation messages, but you'll lose other useful
functionality--but that might not be an issue
  

depending on


your usecase.

The  tag [2] will render any
  

error


messages. A combination of either the simple theme or
  

a


modified theme plus the action error tag may do what
  

you


need.

Dave

[1]

  

http://struts.apache.org/2.x/docs/themes-and-templates.html


[2] http://struts.apache.org/2.x/docs/actionerror.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]

  





** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity to 
which it is addressed, and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If this is a 
forwarded message, the content of this E-MAIL may not have been sent with 
the authority of the Company. If you are not the intended recipient, an 
agent of the intended recipient or a  person responsible for delivering the 
information to the named recipient,  you are notified that any use, 
distribution, transmission, printing, copying or dissemination of this 
information in any way or in any manner is strictly prohibited. If you have 
received this communication in error, please delete this mail & notify us 
immediately at [EMAIL PROTECTED]


Fwd: Struts Themes Problem - help

2008-06-25 Thread Narayana S
Hi Laurie  / Dave,

  can you please help on this?

-- Forwarded message --
From: Narayana S <[EMAIL PROTECTED]>
Date: Tue, Jun 24, 2008 at 3:12 PM
Subject: Re: Struts Themes Problem - help
To: Struts Users Mailing List , [EMAIL PROTECTED]


Hi laurie,

 



This is a part of the form i am creating, when the theme is default(xhtml)
the label could get value app.indexheader from resource bundle and working
fine, the text fields also could generate a label with the values given for
app.cname, but when simple theme is given ( like  )  the label is not rendered!!

can you help me on solving this >?



On Mon, Jun 23, 2008 at 11:18 PM, Laurie Harper <[EMAIL PROTECTED]> wrote:

> Narayana S wrote:
>
>> Hi Dave,
>>
>> thanks for your reply, but when i use simple theme, my application is
>> not getting any values from resource bundle..
>>
>
> How is it failing? Note that the 'simple' theme generates a lot less
> markup, and doesn't generate everything the other themes do. Are I18N
> resources failing to get resolved, or is the theme just not generating the
> things you were expecting to see?
>
>  will this problem be solved by extending theme ?
>>
>> can you provide any best link to extend a theme if it is the solution... ?
>>
>
> See the Themes and Templates documentation:
>
> http://struts.apache.org/2.0.11.1/docs/themes-and-templates.html
>
> L.
>
>
>  On Sun, Jun 22, 2008 at 8:25 PM, Dave Newton <[EMAIL PROTECTED]>
>> wrote:
>>
>>  --- On Sun, 6/22/08, Narayana S <[EMAIL PROTECTED]> wrote:
>>>
 The problem is here struts 2 is applying it's own styles to
 my page, i want to give my own styles instead of using struts
 default styles,

>>> The easiest answer is to just supply your own CSS styles. You can also
>>> extend an existing, or create your own, theme.
>>>
>>> Dave
>>>
>>>
>>> -
>>> 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]
>
>


Including XML files in maven war file

2008-06-25 Thread Oren Livne

Dear All,

I am building my first Struts 2 application. I'm using maven 2.0.9, jdk 
1.6.0_06 and jetty 6.1.10 to deploy inline in maven.

Here is my src/main/resources/struts.xml:



http://struts.apache.org/dtds/struts-2.0.dtd";>


   
   
  
   
  



It points to front.xml, which sits in 
src/main/java/net/ruready/web/front and looks like this:




http://struts.apache.org/dtds/struts-2.0.dtd";>


   

   
   
   /jsp/front/home.jsp
   
  
   



However, when I run "mvn jetty:run", Struts 2 doesn't find the action 
"front/home.action". I looked in the target directory as well as in the 
war file packaged with the command "mvn package", and I saw that 
front.xml was NOT included in WEB-INF/classes/net/ruready/web/front. How 
can I include it? I would like to use xml files in my source folders. I 
tried to tweak the maven war plugin but to no avail.


Could you kindly help me?
Thanks,
Oren

--
===
I can stand brute force, but brute reason is quite unbearable.
-- Oscar Wilde
---
Oren Livne, Ph.D.
RUReady Software Architect
Academic Outreach and Continuing Education, 1901 E South Campus Dr.
Room 2197-D, University of Utah, Salt Lake City, UT 84112-9399
Tel  : (801) 581-6831 Cell: (801) 631-3885 Fax: (801) 585-5414
Email: [EMAIL PROTECTED]  Web:  http://ruready.net/oren
===


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



RE: Struts 2 - Repopulate controls when validation fails

2008-06-25 Thread bob fuller

Trying again to give out my pseudo JSP...

s:form name="myAction"
s:textfield name="foo0"/
s:action name="languages" executeResult="true"/
s:textfield name="foo1"/
s:submit/
/s:form

> From: [EMAIL PROTECTED]
> To: user@struts.apache.org
> Subject: Struts 2 - Repopulate controls when validation fails
> Date: Thu, 26 Jun 2008 02:14:28 +
> 
> 
> I'm following the "How do we repopulate controls when validation fails" FAQ 
> located at...
> 
> http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html
> 
> Of the two methods it suggests I am trying to use the 'action tag' method. 
> Using the simple example from the FAQ works fine, but once I move beyond the 
> simple and try to drop my "Languages" control inside the  tag of another 
> action I have problems.
> 
> Here's my pseudo JSP (note MyAction)...
> 
> 
> 
> 
> 
> 
> 
> 
> 
> MyAction implements validateable and I am validating foo0 and foo1 inside the 
> validate() method. Here's my validate() code...
> 
> public void validate() {
> if (foo0 == null || foo0.length() == 0)
>   addFieldError("foo0", "Foo0 is required");
> else
>   foo0 = foo0 + " VALIDATED";
> 
> if (foo1 == null || foo1.length() == 0)
>   addFieldError("foo1", "Foo1 is required");
> else
>   foo1 = foo1 + " VALIDATED"; 
> }
> 
> The important thing to note about my validation code is that when the 
> validation succeeds the data entered by the user is updated with the word 
> "VALIDATED". This may seem like an odd thing to do, but it's part of the 
> requirements of the project I'm working on.
> 
> Visiting http://localhost/MyAction/myAction_input.action works great. The 
> page draws, foo0 is empty, the languages control has languages to choose 
> from, foo1 is empty, the submit button appears. Submitting the form is when I 
> get into problems. Here are three submit paths and their results...
> 
> 1. foo0 is empty, foo1 is empty. click submit. RESULT - foo0 is empty. foo1 
> is empty. SUCCESS!
> 2. foo0 = 'A', foo1 is empty. click submit. RESULT - page redraws. foo0 = 'A 
> VALIDATED'. foo1 is empty. SUCCESS!
> 3. foo0 is empty, foo1 = 'A'. click submit. RESULT - page redraws. foo0 is 
> empty. foo1 = 'A'. FAIL! - foo1 should say 'A VALIDATED'
> 
> For some reason MyAction.setFoo1() is being invoked *again* after I set foo1 
> to 'A VALIDATED' in my validate() code. Why is that happening? I know it has 
> something to do with the Languages control that appears before the foo1 text 
> field, because when I remove the Languages control everything works as 
> expected.
> 
> Anyone have any ideas about what the Languages control is doing that is 
> causing my foo1 field to get reset to the original submit value? I'd really 
> like to be able to use the 'action tags' approach for repopulating controls, 
> but 'dropping wherever', as suggested in the FAQ (see link above), does not 
> seem to be as easy as it sounds.
> 
> Thanks.
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> _
> The other season of giving begins 6/24/08. Check out the i’m Talkathon.
> http://www.imtalkathon.com?source=TXT_EML_WLH_SeasonOfGiving
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_
The i’m Talkathon starts 6/24/08.  For now, give amongst yourselves.
http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst

Struts 2 - Repopulate controls when validation fails

2008-06-25 Thread bob fuller

I'm following the "How do we repopulate controls when validation fails" FAQ 
located at...

http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html

Of the two methods it suggests I am trying to use the 'action tag' method. 
Using the simple example from the FAQ works fine, but once I move beyond the 
simple and try to drop my "Languages" control inside the  tag of another action 
I have problems.

Here's my pseudo JSP (note MyAction)...









MyAction implements validateable and I am validating foo0 and foo1 inside the 
validate() method. Here's my validate() code...

public void validate() {
if (foo0 == null || foo0.length() == 0)
  addFieldError("foo0", "Foo0 is required");
else
  foo0 = foo0 + " VALIDATED";

if (foo1 == null || foo1.length() == 0)
  addFieldError("foo1", "Foo1 is required");
else
  foo1 = foo1 + " VALIDATED";   
}

The important thing to note about my validation code is that when the 
validation succeeds the data entered by the user is updated with the word 
"VALIDATED". This may seem like an odd thing to do, but it's part of the 
requirements of the project I'm working on.

Visiting http://localhost/MyAction/myAction_input.action works great. The page 
draws, foo0 is empty, the languages control has languages to choose from, foo1 
is empty, the submit button appears. Submitting the form is when I get into 
problems. Here are three submit paths and their results...

1. foo0 is empty, foo1 is empty. click submit. RESULT - foo0 is empty. foo1 is 
empty. SUCCESS!
2. foo0 = 'A', foo1 is empty. click submit. RESULT - page redraws. foo0 = 'A 
VALIDATED'. foo1 is empty. SUCCESS!
3. foo0 is empty, foo1 = 'A'. click submit. RESULT - page redraws. foo0 is 
empty. foo1 = 'A'. FAIL! - foo1 should say 'A VALIDATED'

For some reason MyAction.setFoo1() is being invoked *again* after I set foo1 to 
'A VALIDATED' in my validate() code. Why is that happening? I know it has 
something to do with the Languages control that appears before the foo1 text 
field, because when I remove the Languages control everything works as expected.

Anyone have any ideas about what the Languages control is doing that is causing 
my foo1 field to get reset to the original submit value? I'd really like to be 
able to use the 'action tags' approach for repopulating controls, but 'dropping 
wherever', as suggested in the FAQ (see link above), does not seem to be as 
easy as it sounds.

Thanks.









 

_
The other season of giving begins 6/24/08. Check out the i’m Talkathon.
http://www.imtalkathon.com?source=TXT_EML_WLH_SeasonOfGiving
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: weird problem tag.

2008-06-25 Thread Martin Gainty

agree that should work...









http://struts.apache.org/2.0.11.1/docs/crud-demo-i.html

(another alternative is to push  value into a property and then test the 
value of the property)




HTH
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Date: Wed, 25 Jun 2008 23:12:44 +0200
> From: [EMAIL PROTECTED]
> To: user@struts.apache.org; [EMAIL PROTECTED]
> Subject: Re: weird problem  tag.
> 
> >   
> 
> Maybe use  tag instead?
> http://struts.apache.org/2.1.2/docs/if.html
> 
> 
> Regards
> -- 
> Lukasz
> http://www.lenart.org.pl/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_
The other season of giving begins 6/24/08. Check out the i’m Talkathon.
http://www.imtalkathon.com?source=TXT_EML_WLH_SeasonOfGiving

Re: Multi-row tabular forms

2008-06-25 Thread Dave Newton
Is that actually rendering properly?!

I thought you had to add an index to the field name manually so it would be 
sent back as foo.bar[1], but perhaps I'm wrong.

Dave

--- On Wed, 6/25/08, Kleiderman, Matthew <[EMAIL PROTECTED]> wrote:

> From: Kleiderman, Matthew <[EMAIL PROTECTED]>
> Subject: Multi-row tabular forms
> To: user@struts.apache.org
> Date: Wednesday, June 25, 2008, 6:46 PM
> I'm trying create a form that maps to a collection of
> data objects, so
> that a user can edit any property of any object, and submit
> the changes.
> I'm using an s:iterator tag to draw each item in the
> collection as a row
> in a table, and the xhtml template.  The table is getting
> drawn
> properly, with data filled in from the collection -  but
> the Action
> receiving the data always has the Collection set to null. 
> Here's a
> stripped-down excerpt of what the .jsp looks like:
> 
>  id="configureobjects"
> action="DoConfigureObjects">
>label="Name" name="Name" />
>   
>   
> 
>var="CurrentObject">
>   
> 
>value="CurrentObject.Property1" /> 
>name="CurrentObject.Property1"
> value="CurrentObject.Property1" />
> 
> 
>name="CurrentObject.Property2" />
> 
> 
>name="CurrentObject.Property3" />
> 
>   
>   
> 
>   
> 
> 
> 
> What am I doing wrong?
> 
> Thanks in advance,
> 
> Matt Kleiderman
> 
> -
> 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]



Multi-row tabular forms

2008-06-25 Thread Kleiderman, Matthew
I'm trying create a form that maps to a collection of data objects, so
that a user can edit any property of any object, and submit the changes.
I'm using an s:iterator tag to draw each item in the collection as a row
in a table, and the xhtml template.  The table is getting drawn
properly, with data filled in from the collection -  but the Action
receiving the data always has the Collection set to null.  Here's a
stripped-down excerpt of what the .jsp looks like:


  
  
  

  
  

   
  


  


  

  
  

  



What am I doing wrong?

Thanks in advance,

Matt Kleiderman

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



Re: weird problem tag.

2008-06-25 Thread sharath karnati
I'm able to fix this problem using 'top'
 
Thanks,
Sharath.

--- On Wed, 6/25/08, sharath karnati <[EMAIL PROTECTED]> wrote:

From: sharath karnati <[EMAIL PROTECTED]>
Subject: Re: weird problem  tag.
To: "Paweł Wielgus" <[EMAIL PROTECTED]>, user@struts.apache.org
Date: Wednesday, June 25, 2008, 6:05 PM

The deploymentVersion is from 'action'. I even tried with 
and it is also having same issue.
 
Thanks,
Sharath.

--- On Wed, 6/25/08, Paweł Wielgus <[EMAIL PROTECTED]> wrote:

From: Paweł Wielgus <[EMAIL PROTECTED]>
Subject: Re: weird problem  tag.
To: "Struts Users Mailing List" ,
[EMAIL PROTECTED]
Date: Wednesday, June 25, 2008, 5:38 PM

Hi Sarath,
where from this deploymentVersion is from (action, session)?
Such construction works for me in many places, so i would like to
replicate this problem.

Best greetings,
Paweł Wielgus.


2008/6/25 sharath karnati <[EMAIL PROTECTED]>:
> Hi All,
>
> In .jsp file, I'm having following code which is using
 tag.
>
>
>  
> 
> 
> 
>
>   
> 

>   
>  
>  
>
>The  tag is showing properties values(projectNm,
subject,comments)correctly. 'deploymentVersion' property is not a
member of  'usercomment' and when it is having value 'All'
still it is displaying '#usercomment.closingDate' value. I think that
it is not validating  condition correctly inside
. If I move this condition outside of  it
is working as expected.
>
>Please let me know, how to validate the properties which are not member
of  value.
>
> Thanks,Sharath.
>
>
>
>


  

Re: weird problem tag.

2008-06-25 Thread sharath karnati
The deploymentVersion is from 'action'. I even tried with  and it is also 
having same issue.
 
Thanks,
Sharath.

--- On Wed, 6/25/08, Paweł Wielgus <[EMAIL PROTECTED]> wrote:

From: Paweł Wielgus <[EMAIL PROTECTED]>
Subject: Re: weird problem  tag.
To: "Struts Users Mailing List" , [EMAIL PROTECTED]
Date: Wednesday, June 25, 2008, 5:38 PM

Hi Sarath,
where from this deploymentVersion is from (action, session)?
Such construction works for me in many places, so i would like to
replicate this problem.

Best greetings,
Paweł Wielgus.


2008/6/25 sharath karnati <[EMAIL PROTECTED]>:
> Hi All,
>
> In .jsp file, I'm having following code which is using
 tag.
>
>
>  
> 
> 
> 
>
>   
> 

>   
>  
>  
>
>The  tag is showing properties values(projectNm,
subject,comments)correctly. 'deploymentVersion' property is not a
member of  'usercomment' and when it is having value 'All'
still it is displaying '#usercomment.closingDate' value. I think that
it is not validating  condition correctly inside
. If I move this condition outside of  it
is working as expected.
>
>Please let me know, how to validate the properties which are not member
of  value.
>
> Thanks,Sharath.
>
>
>
>


  

Re: Struts Validator Framework: problem with Custom Validator

2008-06-25 Thread cacodemon79

Now, server-side validation works!
I changed ActionErrors class with ActionMessages class into my java
validation method and into "validator-rules.xml".
The only problem is that
Resources.getActionMessage(request, va, field)
method in my custom validator class is deprecated and I don't know how to
replace it.
Can you give me any suggestions?


On the client-side, I have the same problem.
I see a javascript warning in browser: "twofields is not defined".
I have also tried to perform some changes to my files:
**
validator-rules.xml
**
 http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd";>
...
...
...




**
validation.xml
**
 http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>
...
...
...






minlength
8


mask
^[a-zA-Z0-9_.]*$


secondProperty
password2



So, my custom validation ("twofields") doesn't still work on client-side.
Can you help me?
I also tried to change the version of dtd validator...but nothing changed.
I can't understand where is the problem.




cacodemon79 wrote:
> 
> I'm using Struts 1.3.
> I'm trying to write a custom validator to check that 2 fields are
> identical.
> 
> 1) I modified my validator-rules.xml by adding my own validator (called
> "uguale"):
> **
> validator-rules.xml
> **
>
> classname="it.sfidiamoci.validator.ValidatorPersonalizzati"
>   method="validateUguale"
>   
> methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
>  
>   depends="required"
>   msg="errors.uguale">
>   
> 
> 
> 
> 
> 2) I modified my validation.xml by adding the new validator (called
> "uguale"):
> **
> validator-rules.xml
> **
> 
>   
>key="${var:minlength}"
> resource="false" />
>   
>/>
>   
>   minlength
>   8
>   
>   
>   mask
>   ^[a-zA-Z0-9_.]*$
>   
>   
>   secondProperty
>   password2
>   
>   
> 
> 3) I added the key "errors.password.uguale" in
> ApplicationResources.properties
> ***
> ApplicationResources.properties
> ***
> errors.password.uguale=Le password inserite non sono uguali
> 
> 4) I created the class "ValidatorPersonalizzati" to handle the custom
> validator "validateUguale":
> 
> ValidatorPersonalizzati.java
> 
> package it.sfidiamoci.validator;
> 
> import javax.servlet.http.HttpServletRequest;
> 
> import org.apache.commons.validator.Field;
> import org.apache.commons.validator.GenericValidator;
> import org.apache.commons.validator.ValidatorAction;
> import org.apache.commons.validator.util.ValidatorUtils;
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.validator.Resources;
> 
> 
> public class ValidatorPersonalizzati{
>   
>   public static boolean validateUguale(Object bean, ValidatorAction
> va,Field field, ActionErrors errors,HttpServletRequest request){
>   
>   String value =
> ValidatorUtils.getValueAsString(bean,field.getProperty());
> System.out.println("value="+value);
>   String sProperty2 = field.getVarValue("secondProperty");
>   String value2 = 
> ValidatorUtils.getValueAsString(bean,sProperty2);
> System.out.println("value2="+value2);
>   if (!GenericValidator.isBlankOrNull(value)){
>   try{
>   if (!value.equals(value2)){
>   
> errors.add(field.getKey(),Resources.getActionMessage(request, va,
> field));
>   return false;
>   }
>   }
>   catch (Exception e)

Re: weird problem tag.

2008-06-25 Thread Paweł Wielgus
Hi Sarath,
where from this deploymentVersion is from (action, session)?
Such construction works for me in many places, so i would like to
replicate this problem.

Best greetings,
Paweł Wielgus.


2008/6/25 sharath karnati <[EMAIL PROTECTED]>:
> Hi All,
>
> In .jsp file, I'm having following code which is using  tag.
>
>
>  
> 
> 
> 
>
>   
>  format="MM/dd/" /> 
>   
>  
>  
>
>The  tag is showing properties values(projectNm, 
> subject,comments)correctly. 'deploymentVersion' property is not a member of  
> 'usercomment' and when it is having value 'All' still it is displaying 
> '#usercomment.closingDate' value. I think that it is not validating  
> condition correctly inside . If I move this condition outside of 
>  it is working as expected.
>
>Please let me know, how to validate the properties which are not member of 
>  value.
>
> Thanks,Sharath.
>
>
>
>


Re: weird problem tag.

2008-06-25 Thread Lukasz Lenart
>   

Maybe use  tag instead?
http://struts.apache.org/2.1.2/docs/if.html


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

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



weird problem tag.

2008-06-25 Thread sharath karnati
Hi All,
 
    In .jsp file, I'm having following code which is using  tag.
 
    
 
    
    
   
    
   
   
  
     
   
 
 
 
   The  tag is showing properties values(projectNm, 
subject,comments)correctly. 'deploymentVersion' property is not a member 
of  'usercomment' and when it is having value 'All' still it is displaying 
'#usercomment.closingDate' value. I think that it is not validating  
condition correctly inside . If I move this condition outside of 
 it is working as expected.
 
   Please let me know, how to validate the properties which are not member of 
 value.
 
Thanks,Sharath.



  

Re: weird problem in

2008-06-25 Thread Lukasz Lenart
And the problem is?


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

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



Struts 2 And Hibernate Problem

2008-06-25 Thread cree

Hello,
 
I recently have been working on a struts 2 + spring 2 + hibernate system and
have come across a problem that I never have when just working on a struts 2
system.  

I have two action classes, one that prepares the jsp and populates some
selects for the user to choose from, and another that takes and processes
the information.  When the first action is invoked the result will bring it
to the tiles (type="tiles") on the struts.xml file.  The second action will
take the form information and do a search, in this instance I am using
hibernate to access the db.

I would do the search and when I get the list of persistent values I would
chain (type="chain") to the first action class with the list of persistent
objects and would then return to the tiles and the jsp showing the values
that I found on the search.  

The problem I am having here is that because of the chain (or similarly a
redirect action), the list of persistent objects will re-appear if I went
off to some other action classes and came back.  What I mean by that is if I
had a list of 10 values that I searched for and displayed them,  if I went
to some other jsp/action class and came back to that same one the same exact
10 values are being populated.  

At that point when I would return to the original jsp the value stack should
have removed them completely, which it has.  There is no trace of the list
of persistent objects on the value stack as well as not being a cache
problem.  The situation arises when the chain occurs, I have worked with
just a struts 2 system for a year now and never had this problem.   I  know
this is the case because when I get rid of the chain and invoke the tiles
from the second action class the problem goes away.

I am not too sure why these values persist throughout the session and why
they re-appear even though they are not on value stack.  I have found a very
similar problem in which this person found that the problem occured during
an action redirect at 
http://www.nabble.com/Struts-2-%2B-Hibernate-question-td17527841.html
http://www.nabble.com/Struts-2-%2B-Hibernate-question-td17527841.html 

On a side note, just remembered, when I would want to populate the list 
after its already been populated (so the user will search once then decide
to search again) the values wouldnt change even after setting it to a new
list.  If I set that list to null first then changed it, the values would
change,  not sure if that makes much sense.

If anyone has an idea on what can be causing this I would greatly appretiate
your help.
-- 
View this message in context: 
http://www.nabble.com/Struts-2-And-Hibernate-Problem-tp18121609p18121609.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]



weird problem in

2008-06-25 Thread sharath karnati
Hi All,
 
   In .jsp file, I'm having following  tag
 
    
 
 

   
   
   

 

  
 
 


 


  

Re: validation problem

2008-06-25 Thread Dave Newton
You either do conditional validations, implement custom validators, or as 
Lukasz suggested write your own validate() method. When validation is very 
complex the last may be the best options.

Dave

--- On Wed, 6/25/08, Istvan Kozma <[EMAIL PROTECTED]> wrote:
> How the validation should be done for fields which are only
> displayed in certain conditions? If  I do this through the
> XML file the validation is done all the time even when the
> field is not visible. 
> 
> Istvan
> 
> 
> - Original Message 
> From: Dave Newton <[EMAIL PROTECTED]>
> To: Struts Users Mailing List
> 
> Sent: Wednesday, June 25, 2008 3:37:38 PM
> Subject: Re: validation problem
> 
> Whoops, as the other reply said, it's the
>  tag [1], not .
> 
> Dave
> 
> [1] http://struts.apache.org/2.x/docs/fielderror.html
> 
> --- On Wed, 6/25/08, Dave Newton
> <[EMAIL PROTECTED]> wrote:
> > --- On Wed, 6/25/08, Anshu Dhamija wrote:
> > > i am facing problem in performing validation
> through
> > > xml actually i want to display message at the top
> of 
> > > my form instaed of at field level 
> > > can anyone please help me
> > 
> > The validation messages are placed in the form by the
> S2
> > form element tags. If you want to modify the output of
> > those tags you can modify or create a theme [1].
> > 
> > Using the "simple" theme will also remove
> the
> > validation messages, but you'll lose other useful
> > functionality--but that might not be an issue
> depending on
> > your usecase.
> > 
> > The  tag [2] will render any
> error
> > messages. A combination of either the simple theme or
> a
> > modified theme plus the action error tag may do what
> you
> > need.
> > 
> > Dave
> > 
> > [1]
> >
> http://struts.apache.org/2.x/docs/themes-and-templates.html
> > [2] http://struts.apache.org/2.x/docs/actionerror.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]



Re: validation problem

2008-06-25 Thread Lukasz Lenart
Hi,

> How the validation should be done for fields which are only displayed in 
> certain conditions? If  I do this through the XML file the validation is done 
> all the time even when the field is not visible.

You can implement validate() or validate() and remember
to implement Validatable interface.
http://struts.apache.org/2.1.2/docs/validation.html


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

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



Re: validation problem

2008-06-25 Thread Istvan Kozma
Hi,

How the validation should be done for fields which are only displayed in 
certain conditions? If  I do this through the XML file the validation is done 
all the time even when the field is not visible. 

Istvan


- Original Message 
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, June 25, 2008 3:37:38 PM
Subject: Re: validation problem

Whoops, as the other reply said, it's the  tag [1], not 
.

Dave

[1] http://struts.apache.org/2.x/docs/fielderror.html

--- On Wed, 6/25/08, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Wed, 6/25/08, Anshu Dhamija wrote:
> > i am facing problem in performing validation through
> > xml actually i want to display message at the top of 
> > my form instaed of at field level 
> > can anyone please help me
> 
> The validation messages are placed in the form by the S2
> form element tags. If you want to modify the output of
> those tags you can modify or create a theme [1].
> 
> Using the "simple" theme will also remove the
> validation messages, but you'll lose other useful
> functionality--but that might not be an issue depending on
> your usecase.
> 
> The  tag [2] will render any error
> messages. A combination of either the simple theme or a
> modified theme plus the action error tag may do what you
> need.
> 
> Dave
> 
> [1]
> http://struts.apache.org/2.x/docs/themes-and-templates.html
> [2] http://struts.apache.org/2.x/docs/actionerror.html


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


  

Re: [struts] Slow performance with Struts2

2008-06-25 Thread Dale Newfield

yorlick kilroy wrote:

Still... the "problem" seems to be the OGNL implementation in struts2.


I'm guessing here, but maybe your issues are related to:

http://jira.opensymphony.com/browse/OGNL-141

Which has been pushed off in Xwork to 2.5:

http://jira.opensymphony.com/browse/XW-631

And which has been pushed off in Struts2 until at least 2.1.3:

https://issues.apache.org/struts/browse/WW-2128

You're welcome to update the version of ognl you're using in your own 
app (but remember to add javassist if so).




 
 



Theoretically this translates to a straight lookup for #object, then 
getA().getB().getC().getName()...
If A, B, and C are just accessors, it should be fast.  If they do much 
work to determine what to return, you're doing that work 2*N times 
(where N is the number of times through the loop) instead of just 
once...why would you put a long lookup like that in an iterator if it 
doesn't change with each iteration?


-Dale

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



Re: Newbie: Call a servlet in another application and set attribute

2008-06-25 Thread Nils-Helge Garli Hegvik
I believe most servlet containers prevent sharing of session objects
between applications by default. But it probably can be configured to
be allowed (consult the documentation for your server to find out
how). A shared cache is also an option. But the easiest would be to
put them in the same application.

Nils-H

On Wed, Jun 25, 2008 at 7:29 PM, Mustafa Cayci <[EMAIL PROTECTED]> wrote:
> Hello Dave,
> Let me try to understan what you mean.  Are you saying that I should be doing 
> this
> public ActionForward execute(ActionMapping mapping, ActionForm form,
>  HttpServletRequest request,
>  HttpServletResponse response) throws 
> Exception {
> 
> HttpSession session = request.getSession();
> session.setAttribute("Principal",principal);
> response.sendRedirect("/testsqlservlet/testsqlservlet");
> ...
> Because this did not work.
> Thanks,
> Mustafa
>
> - Original Message 
> From: Dave Newton <[EMAIL PROTECTED]>
> To: Struts Users Mailing List 
> Sent: Wednesday, June 25, 2008 12:58:09 PM
> Subject: Re: Newbie: Call a servlet in another application and set attribute
>
> --- On Wed, 6/25/08, Mustafa Cayci <[EMAIL PROTECTED]> wrote:
>> I am fairly new to Struts.  I have two applications.  AppA
>> is a Struts application and AppB is another application.  I
>> have an Action class in AppA.  Within execute() method, I am
>> creating some objects.  I would like to call the servlet in
>> AppB and somehow I want to pass these objects to the
>> servlet in AppB. SO far I have this
>>
>>public ActionForward execute(ActionMapping mapping,
>> ActionForm form,
>>  HttpServletRequest
>> request,
>>  HttpServletResponse
>> response) throws Exception {
>> ...
>>
>> response.sendRedirect("/testsqlservlet/testsqlservlet?Object="
>> + object);
>> ...
>>
>> But this is a problem because even if I use SSL (i.e.
>> https://) this redirect will be in cleartext and anybody
>> can modify the "object".  What are my options? I
>> am hope I explained myself clearly.
>
> Put it in the session?
>
> That's not passing the object, either; that's passing the string 
> representation of the object. A bit different.
>
> Dave
>
>
> -
> 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: Newbie: Call a servlet in another application and set attribute

2008-06-25 Thread Dave Newton
--- On Wed, 6/25/08, Mustafa Cayci <[EMAIL PROTECTED]> wrote:
> Let me try to understan what you mean.  Are you saying
> that I should be doing this
>     public ActionForward execute(ActionMapping mapping,
> ActionForm form, 
> 
> HttpServletRequest request, 
> 
> HttpServletResponse response) throws Exception {
> 
>     HttpSession session = request.getSession();
>        
> session.setAttribute("Principal",principal);
>        
> response.sendRedirect("/testsqlservlet/testsqlservlet");
> ...
> Because this did not work.  

If they're actually two different applications, no, it wouldn't work. 

Unlike the other reply I had assumed they were in the same app, but apparently 
you meant what you said. Things don't work like that, on several ways, so 
you'll have to explore other options.

Dave


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



Re: Newbie: Call a servlet in another application and set attribute

2008-06-25 Thread Mustafa Cayci
Hello Dave,
Let me try to understan what you mean.  Are you saying that I should be doing 
this
    public ActionForward execute(ActionMapping mapping, ActionForm form, 
 HttpServletRequest request, 
 HttpServletResponse response) throws Exception 
{

    HttpSession session = request.getSession();
        session.setAttribute("Principal",principal);
        response.sendRedirect("/testsqlservlet/testsqlservlet");
...
Because this did not work.  
Thanks,
Mustafa

- Original Message 
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, June 25, 2008 12:58:09 PM
Subject: Re: Newbie: Call a servlet in another application and set attribute

--- On Wed, 6/25/08, Mustafa Cayci <[EMAIL PROTECTED]> wrote:
> I am fairly new to Struts.  I have two applications.  AppA
> is a Struts application and AppB is another application.  I
> have an Action class in AppA.  Within execute() method, I am
> creating some objects.  I would like to call the servlet in
> AppB and somehow I want to pass these objects to the
> servlet in AppB. SO far I have this
> 
>    public ActionForward execute(ActionMapping mapping,
> ActionForm form, 
>                                  HttpServletRequest
> request, 
>                                  HttpServletResponse
> response) throws Exception {
> ...
>        
> response.sendRedirect("/testsqlservlet/testsqlservlet?Object="
> + object);
> ...
> 
> But this is a problem because even if I use SSL (i.e.
> https://) this redirect will be in cleartext and anybody
> can modify the "object".  What are my options? I
> am hope I explained myself clearly.

Put it in the session?

That's not passing the object, either; that's passing the string representation 
of the object. A bit different.

Dave


-
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: Newbie: Call a servlet in another application and set attribute

2008-06-25 Thread Marc Ende
Hi Mustafa,

if I understand you correctly you're trying to pass an object in another
webapp. That's not a really struts-usecase. I think you're looking for 
a webservice or another kind of procedurecalls (like rmi).

I think you should look for axis, cxf or another project which are more
helpful for this kind of uses.

Marc

Am Mittwoch, den 25.06.2008, 09:27 -0700 schrieb Mustafa Cayci:
> I am fairly new to Struts.  I have two applications.  AppA is a Struts 
> application and AppB is another application.  I have an Action class in AppA. 
>  Within execute() method, I am creating some objects.  I would like to call 
> the servlet in AppB and somehow I want to pass these objects to the servlet 
> in AppB. SO far I have this
> 
> public ActionForward execute(ActionMapping mapping, ActionForm form, 
>  HttpServletRequest request, 
>  HttpServletResponse response) throws 
> Exception {
> ...
> response.sendRedirect("/testsqlservlet/testsqlservlet?Object=" + 
> object);
> ...
> 
> But this is a problem because even if I use SSL (i.e. https://) this redirect 
> will be in cleartext and anybody can modify the "object".  What are my 
> options? I am hope I explained myself clearly.



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



Re: Newbie: Call a servlet in another application and set attribute

2008-06-25 Thread Dave Newton
--- On Wed, 6/25/08, Mustafa Cayci <[EMAIL PROTECTED]> wrote:
> I am fairly new to Struts.  I have two applications.  AppA
> is a Struts application and AppB is another application.  I
> have an Action class in AppA.  Within execute() method, I am
> creating some objects.  I would like to call the servlet in
> AppB and somehow I want to pass these objects to the
> servlet in AppB. SO far I have this
> 
> public ActionForward execute(ActionMapping mapping,
> ActionForm form, 
>  HttpServletRequest
> request, 
>  HttpServletResponse
> response) throws Exception {
> ...
>
> response.sendRedirect("/testsqlservlet/testsqlservlet?Object="
> + object);
> ...
> 
> But this is a problem because even if I use SSL (i.e.
> https://) this redirect will be in cleartext and anybody
> can modify the "object".  What are my options? I
> am hope I explained myself clearly.

Put it in the session?

That's not passing the object, either; that's passing the string representation 
of the object. A bit different.

Dave


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



Newbie: Call a servlet in another application and set attribute

2008-06-25 Thread Mustafa Cayci
Hello,

I am fairly new to Struts.  I have two applications.  AppA is a Struts 
application and AppB is another application.  I have an Action class in AppA.  
Within execute() method, I am creating some objects.  I would like to call the 
servlet in AppB and somehow I want to pass these objects to the servlet in 
AppB. SO far I have this

public ActionForward execute(ActionMapping mapping, ActionForm form, 
 HttpServletRequest request, 
 HttpServletResponse response) throws Exception 
{
...
response.sendRedirect("/testsqlservlet/testsqlservlet?Object=" + 
object);
...

But this is a problem because even if I use SSL (i.e. https://) this redirect 
will be in cleartext and anybody can modify the "object".  What are my options? 
I am hope I explained myself clearly.

Thanks,

Mustafa



  

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



Re: Avoid having an action property called id

2008-06-25 Thread Mark Menard
Hi Jonny,

I have id properties on actions all over my application.

I also have several actions that do a redirect to id. I think there's
something wrong with either your environment or your action that's causing
the issue.

What exactly happens when it doesn't work?

Mark 
The guy who wrote the article.


On 6/25/08 11:29 AM, "Jonny Cavell" <[EMAIL PROTECTED]> wrote:

> 
> This  http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect article
> about post and redirect in struts 2  explains how to redirect to a
> dynamically evaluated action.
> 
> However, if I use a param which references an action property called "id",
> it doesn't work. 
> 
> 
>   ${redirectActionName}
>   /admin/holidays
>   true
>   ${id}
> 
> 
> But when I changed the property (and its getter and setter) to be called
> "aid", it works OK:
> 
>   .. as above...
>   ..
>   ${aid}
> 
> 
> 
> Also (possibly unrelated), again with a property called id on my action,
> when I use the  tag, it automatically adds the current value of
> the action's id to the URL even if I don't want it to. The docs don't
> mention that this should happen (it's annoying).
> 
> It seems as if naming an action property id should be avoided...


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



Re: namespace getting appended to servletPath

2008-06-25 Thread Jeromy Evans

Dwipin C wrote:


WEB-INF/jsp/ChangePassword.jsp
  

Include a / in front of WEB-INF. (/WEB-INF/jsp/ChangePassword.jsp)
S2 forwards to the JSP result and without the leading slash the 
container assumes it's a path relative to your package namespace


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



Avoid having an action property called id

2008-06-25 Thread Jonny Cavell

This  http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect article
about post and redirect in struts 2  explains how to redirect to a
dynamically evaluated action.

However, if I use a param which references an action property called "id",
it doesn't work. 


  ${redirectActionName}
  /admin/holidays
  true
  ${id}


But when I changed the property (and its getter and setter) to be called
"aid", it works OK:

  .. as above...
  ..
  ${aid}



Also (possibly unrelated), again with a property called id on my action,
when I use the  tag, it automatically adds the current value of
the action's id to the URL even if I don't want it to. The docs don't
mention that this should happen (it's annoying).

It seems as if naming an action property id should be avoided...
-- 
View this message in context: 
http://www.nabble.com/Avoid-having-an-action-property-called-id-tp18115239p18115239.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]



namespace getting appended to servletPath

2008-06-25 Thread Dwipin C
Hi,
I have used a namespace "abc" for a particular set of action 
classes. The action class invocation happens with the namespace in the 
requested url, as expected.  However after the processing is done, the 
namespace is appended to the result jsp.

code snippet - 



http://struts.apache.org/dtds/struts-2.0.dtd";>





WEB-INF/jsp/Login.jsp
WEB-INF/jsp/Login.jsp

WEB-INF/jsp/ChangePassword.jsp


 


After processing, the servletPath is "/u/WEB-INF/jsp/Login.jsp" . Is this 
the expected behavior? I would prefer not changing my jsp location.
Any pointers would be of great help.

Thanks,
Dwipin Chandran.
=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you




Re: Struts2 UI Tag HTML Compliance?

2008-06-25 Thread Jeromy Evans

albertooi wrote:

Anyone aware if the Struts2 UI tags are HTML compliant? Which version of HTML
Specs?  E.g 4.x?  Need to ascertain which browser is supported if struts2 ui
tags are being used.
  
generally html 4.x but I don't think they validate. Definitely not 
xhtml, no features of 5.x.


More importantly, the "xhtml theme" uses tables for layout, the 
"css_xhtml theme" uses divs, spans and css2 for layout, the "simple 
theme" outputs plain-old html 4 with no markup for layout and you can 
customize the theme for every tag. 


Hope that helps.
Jeromy Evans

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



Struts list

2008-06-25 Thread Sonu S
 HI,

I have to show list in my jsp page. I am using 

i am getting two lists from data base and it is in employee form bean: first
list is for employee no and second list is for name. i want to display
employee name in  and want to use employee no as VALUE in 
so list would have employee no as value and name will be displayed to user.

i am not sure how to do it with two lists as i have two different lists, one
list for emp no and one list for employee name. My form bean name is
employeeForm and list names are employeeNoList and employeeNameList. Please
help me... some code example would be a help for me. I am using struts 1.1

Thank you


Struts2 UI Tag HTML Compliance?

2008-06-25 Thread albertooi

Anyone aware if the Struts2 UI tags are HTML compliant? Which version of HTML
Specs?  E.g 4.x?  Need to ascertain which browser is supported if struts2 ui
tags are being used.



-- 
View this message in context: 
http://www.nabble.com/Struts2-UI-Tag-HTML-Compliance--tp18114585p18114585.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: use OGNL to automatically look in the session?

2008-06-25 Thread Brad A Cupit
Brad Cupit wrote:
> I'm not sure which order the scopes are checked

For anyone who's interested, #attr appears to check scopes in the
following order:

1. page / action *
2. request
3. value stack
4. session
5. application

* I used  to set one value at page scope and one at action scope,
and whichever was declared last was the one that #attr found first.





outputs page





outputs action

I'm not really sure what the action scope is. Perhaps it's only related
to . Either way, maybe this post will help someone searching
the mailing list!

Brad Cupit
Louisiana State University - UIS

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



Re: validation problem

2008-06-25 Thread Dave Newton
Whoops, as the other reply said, it's the  tag [1], not 
.

Dave

[1] http://struts.apache.org/2.x/docs/fielderror.html

--- On Wed, 6/25/08, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Wed, 6/25/08, Anshu Dhamija wrote:
> > i am facing problem in performing validation through
> > xml actually i want to display message at the top of 
> > my form instaed of at field level 
> > can anyone please help me
> 
> The validation messages are placed in the form by the S2
> form element tags. If you want to modify the output of
> those tags you can modify or create a theme [1].
> 
> Using the "simple" theme will also remove the
> validation messages, but you'll lose other useful
> functionality--but that might not be an issue depending on
> your usecase.
> 
> The  tag [2] will render any error
> messages. A combination of either the simple theme or a
> modified theme plus the action error tag may do what you
> need.
> 
> Dave
> 
> [1]
> http://struts.apache.org/2.x/docs/themes-and-templates.html
> [2] http://struts.apache.org/2.x/docs/actionerror.html


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



Re: validation problem

2008-06-25 Thread ManiKanta G

Anshu Dhamija wrote:

hi
   i am new to struts 2.i am facing problem in performing validation through
xml
actually i want to display message at the top of my form instaed of at field
level
can anyone please help me

  

Hi,

In struts2 there is a provision for handling the error messages by field 
and action level.


If the message u want to display is not related to any particular field, 
then u can use ** tag at the top of ur page.


If the validation message is particular to a field, u can use 
** tag at the top of the page. This will displays all 
the field validation errors.
To display validation errors specific to a field, use * 
tag with *, like below


   *
   */fieldName/*
   *

Like this u can place individual field errors in ur custom layout in ur 
way, using tables, divs or something else.


When you explore the validation framework, what u see is more types of 
validation, which includes field validatiors & non-field validators.


Field validators are specific to a field, and thus adds a field error.
Non-field validators are NOT specific to any single field and thus the 
error message will be added as action level error (action error).


U can get more info regarding validations from Struts2 documentation.

Feel free to ask if u've need any clarification.

Regards,
ManiKanta G




** DISCLAIMER **
Information contained and transmitted by this E-MAIL is proprietary to 
Sify Limited and is intended for use only by the individual or entity to 
which it is addressed, and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If this is a 
forwarded message, the content of this E-MAIL may not have been sent with 
the authority of the Company. If you are not the intended recipient, an 
agent of the intended recipient or a  person responsible for delivering the 
information to the named recipient,  you are notified that any use, 
distribution, transmission, printing, copying or dissemination of this 
information in any way or in any manner is strictly prohibited. If you have 
received this communication in error, please delete this mail & notify us 
immediately at [EMAIL PROTECTED]


Re: validation problem

2008-06-25 Thread Dave Newton
--- On Wed, 6/25/08, Anshu Dhamija <[EMAIL PROTECTED]> wrote:
> i am facing problem in performing validation through
> xml actually i want to display message at the top of 
> my form instaed of at field level 
> can anyone please help me

The validation messages are placed in the form by the S2 form element tags. If 
you want to modify the output of those tags you can modify or create a theme 
[1].

Using the "simple" theme will also remove the validation messages, but you'll 
lose other useful functionality--but that might not be an issue depending on 
your usecase.

The  tag [2] will render any error messages. A combination of 
either the simple theme or a modified theme plus the action error tag may do 
what you need.

Dave

[1] http://struts.apache.org/2.x/docs/themes-and-templates.html
[2] http://struts.apache.org/2.x/docs/actionerror.html


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



Re: internationalization problem..

2008-06-25 Thread Dave Newton
People *have* responded, both Laurie and I attempted to help. We asked 
questions, we provided links. Not sure what else we can do--what about the help 
wasn't helpful?

Dave

--- On Wed, 6/25/08, Narayana S <[EMAIL PROTECTED]> wrote:

> From: Narayana S <[EMAIL PROTECTED]>
> Subject: Re: internationalization problem..
> To: "Struts Users Mailing List" 
> Date: Wednesday, June 25, 2008, 7:15 AM
> Hi,
> 
>   please reply, i was kind of stuck because of this
> issue,.
> 
> On Wed, Jun 25, 2008 at 9:20 AM, Narayana S
> <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> >
> > i am applying simple theme for my struts 2
> page, when the theme is
> > default it could read values from resource bundle,
> after i changed theme to
> > simple, it couldn't read the values from the
> resource bundle.
> >
> >  method="post"  theme="simple">
> > 
> > ---
> > 
> >
> > This is how i am creating the form. am i missing any
> thing? please help me.
> >
> >

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



validation problem

2008-06-25 Thread Anshu Dhamija
hi
   i am new to struts 2.i am facing problem in performing validation through
xml
actually i want to display message at the top of my form instaed of at field
level
can anyone please help me


Re: internationalization problem..

2008-06-25 Thread Narayana S
Hi,

  please reply, i was kind of stuck because of this issue,.

On Wed, Jun 25, 2008 at 9:20 AM, Narayana S <[EMAIL PROTECTED]> wrote:

> Hi,
>
> i am applying simple theme for my struts 2 page, when the theme is
> default it could read values from resource bundle, after i changed theme to
> simple, it couldn't read the values from the resource bundle.
>
> 
> 
> ---
> 
>
> This is how i am creating the form. am i missing any thing? please help me.
>
>


[S2] autocompleter action extension

2008-06-25 Thread Pierre Goupil
Hello all,

I would like my S2 project to be mapped to .html actions, so I have
set this up :

- struts.action.extension=html in my struts.properties

-  in my
xwork-default.xml

-  in my
struts-default.xml.

Please note that for the two last ones, I have simply added the
property to the original file provided in the jar.

It works, in the sense that my actions respond and display my JSPs as
desired. BUT I can't figure out how to have the auto-completer tag to
work. If I use the .html extension, I get the following exception :

---
Could not find action or result
There is no Action mapped for action name ComboBox. - [unknown location]
at 
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at 
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at 
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
---

I think this is because Struts is looking for an .action action
extension : if I revert back to the default .action extension, it all
works. But as you can guess, I would like to be able to use whatever
extension I wish to.

A clue, anyone ?

Thanx in advance,

Pierre GOUPIL

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



Re: Slow performance with Struts2

2008-06-25 Thread Paweł Wielgus
Hi Joe,
sorry for the previus post, too fast fingers ;-)
Long time ago I had similiar problem in struts 1, when accesing lists
with logic:iterate it turned out that if i used  and this getMyList() method was not
really a getter but some logic that was building myList, logic:iterate
was accesing myList like getMyList().get(0), then getMyList().get(1)
and so on. Which obvoiusly kills the performance. I'm not using such
getters since then, but that may be the case in s2 also.

Best greetings,
Paweł Wielgus.

On 25/06/2008, Paweł Wielgus <[EMAIL PROTECTED]> wrote:
> Hi Joe,
>  i had similiar problem in struts
>
>
>  On 25/06/2008, yorlick kilroy <[EMAIL PROTECTED]> wrote:
>  > Thanks for the performance-tuning links Dave. I Found a couple of
>  >  useful hints there.
>  >  Still... the "problem" seems to be the OGNL implementation in struts2.
>  >  It seems to me as if one should be VERY careful when using OGNL i.e.
>  >  make use of it very sparingly. in some of my jsps I descend fairly
>  >  deeply into my complex value objects consisting of maps and lists etc.
>  >  I dont have any benchmark results but it "feels" like the time taken
>  >  to render a jsp with lots of OGNL expressions increases exponentially
>  >  proportional to the depth of the used OGNL expression, for example:
>  >
>  >  
>  >  
>  >  
>  >  
>  >
>  >  Which isn't a performance problem when writing the above code in pure
>  >  java - only when done in struts2 OGNL
>  >
>  >  Can anyone confirm this?
>  >
>  >  Perhaps OGNL is only meant to be used for accessing only immediate
>  >  properties of an object and not to descend down into complex
>  >  tree-object-graphs.?
>  >
>  >  --- Joe
>  >
>  >  On 6/24/08, Dave Newton <[EMAIL PROTECTED]> wrote:
>  >  > http://struts.apache.org/2.x/docs/performance-tuning.html
>  >  >
>  >  > Dave
>  >  >
>  >  >
>  >  > --- On Tue, 6/24/08, yorlick kilroy <[EMAIL PROTECTED]> wrote:
>  >  >
>  >  >> From: yorlick kilroy <[EMAIL PROTECTED]>
>  >  >> Subject: Slow performance with Struts2
>  >  >> To: user@struts.apache.org
>  >  >> Date: Tuesday, June 24, 2008, 10:23 AM
>  >  >> Hi,
>  >  >>
>  >  >> I was wondering if there is a way to tweak struts2
>  >  >> performance.
>  >  >> I ported an old struts1 application to struts2. I have jsps
>  >  >> that have
>  >  >> rather large and complex lists that I now iterate using
>  >  >> Struts2
>  >  >>  and OGNL instead of 
>  >  >> and EL used in
>  >  >> struts1. I noticed that the performance using Struts2 is
>  >  >> pretty much
>  >  >> lower than that of the Struts1 application, especially when
>  >  >> displaying
>  >  >> large lists and descending into complex objects using OGNL.
>  >  >> I read that using dojo can cause this, but as far as I know
>  >  >> I'm not
>  >  >> (consciously) using dogo, ajax etc. just plain struts2
>  >  >> core.
>  >  >>
>  >  >> -- Joe
>  >  >>
>  >  >> -
>  >  >> 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: Slow performance with Struts2

2008-06-25 Thread Paweł Wielgus
Hi Joe,
i had similiar problem in struts

On 25/06/2008, yorlick kilroy <[EMAIL PROTECTED]> wrote:
> Thanks for the performance-tuning links Dave. I Found a couple of
>  useful hints there.
>  Still... the "problem" seems to be the OGNL implementation in struts2.
>  It seems to me as if one should be VERY careful when using OGNL i.e.
>  make use of it very sparingly. in some of my jsps I descend fairly
>  deeply into my complex value objects consisting of maps and lists etc.
>  I dont have any benchmark results but it "feels" like the time taken
>  to render a jsp with lots of OGNL expressions increases exponentially
>  proportional to the depth of the used OGNL expression, for example:
>
>  
>  
>  
>  
>
>  Which isn't a performance problem when writing the above code in pure
>  java - only when done in struts2 OGNL
>
>  Can anyone confirm this?
>
>  Perhaps OGNL is only meant to be used for accessing only immediate
>  properties of an object and not to descend down into complex
>  tree-object-graphs.?
>
>  --- Joe
>
>  On 6/24/08, Dave Newton <[EMAIL PROTECTED]> wrote:
>  > http://struts.apache.org/2.x/docs/performance-tuning.html
>  >
>  > Dave
>  >
>  >
>  > --- On Tue, 6/24/08, yorlick kilroy <[EMAIL PROTECTED]> wrote:
>  >
>  >> From: yorlick kilroy <[EMAIL PROTECTED]>
>  >> Subject: Slow performance with Struts2
>  >> To: user@struts.apache.org
>  >> Date: Tuesday, June 24, 2008, 10:23 AM
>  >> Hi,
>  >>
>  >> I was wondering if there is a way to tweak struts2
>  >> performance.
>  >> I ported an old struts1 application to struts2. I have jsps
>  >> that have
>  >> rather large and complex lists that I now iterate using
>  >> Struts2
>  >>  and OGNL instead of 
>  >> and EL used in
>  >> struts1. I noticed that the performance using Struts2 is
>  >> pretty much
>  >> lower than that of the Struts1 application, especially when
>  >> displaying
>  >> large lists and descending into complex objects using OGNL.
>  >> I read that using dojo can cause this, but as far as I know
>  >> I'm not
>  >> (consciously) using dogo, ajax etc. just plain struts2
>  >> core.
>  >>
>  >> -- Joe
>  >>
>  >> -
>  >> 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]
>
>

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



Re: Slow performance with Struts2

2008-06-25 Thread yorlick kilroy
Thanks for the performance-tuning links Dave. I Found a couple of
useful hints there.
Still... the "problem" seems to be the OGNL implementation in struts2.
It seems to me as if one should be VERY careful when using OGNL i.e.
make use of it very sparingly. in some of my jsps I descend fairly
deeply into my complex value objects consisting of maps and lists etc.
I dont have any benchmark results but it "feels" like the time taken
to render a jsp with lots of OGNL expressions increases exponentially
proportional to the depth of the used OGNL expression, for example:


 
 


Which isn't a performance problem when writing the above code in pure
java - only when done in struts2 OGNL

Can anyone confirm this?

Perhaps OGNL is only meant to be used for accessing only immediate
properties of an object and not to descend down into complex
tree-object-graphs.?

--- Joe

On 6/24/08, Dave Newton <[EMAIL PROTECTED]> wrote:
> http://struts.apache.org/2.x/docs/performance-tuning.html
>
> Dave
>
>
> --- On Tue, 6/24/08, yorlick kilroy <[EMAIL PROTECTED]> wrote:
>
>> From: yorlick kilroy <[EMAIL PROTECTED]>
>> Subject: Slow performance with Struts2
>> To: user@struts.apache.org
>> Date: Tuesday, June 24, 2008, 10:23 AM
>> Hi,
>>
>> I was wondering if there is a way to tweak struts2
>> performance.
>> I ported an old struts1 application to struts2. I have jsps
>> that have
>> rather large and complex lists that I now iterate using
>> Struts2
>>  and OGNL instead of 
>> and EL used in
>> struts1. I noticed that the performance using Struts2 is
>> pretty much
>> lower than that of the Struts1 application, especially when
>> displaying
>> large lists and descending into complex objects using OGNL.
>> I read that using dojo can cause this, but as far as I know
>> I'm not
>> (consciously) using dogo, ajax etc. just plain struts2
>> core.
>>
>> -- Joe
>>
>> -
>> 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]