Re: transforming Struts apps to services

2010-04-03 Thread Nitesh Jain
Frans,

You can consider using AXIS with struts for Webservices.

Nitesh

On 4 April 2010 06:50, Frans Thamura fr...@meruvian.org wrote:

 On Sun, Apr 4, 2010 at 7:40 AM, Dave Newton newton.d...@yahoo.com wrote:

  Frans Thamura wrote:
 
  any idea to make a struts2 application using @Webservices or any, to
 make
  the result is SOA compliance?
 
 
  SOA compliance meaning what? The rendered result can be in any format
 and
  conform to any standard you wish. Is your question regarding using the
  actual JAX-RS @Webservice annotation on an S2 action?
 


 hi dave

 right, that is the idea

 F



Display Doc or PDF file in JSP

2009-07-27 Thread Nitesh Jain
Hi All,

 

I have requirement to display a Doc or PDF file into a div
tag of the JSP. It means that JSP will display a DOC/PDF file in half of the
page and remaining space will be used to display some other information. Can
anyone guide me to achieve this with or without using the struts? 

 

Regards,

 

Nitesh

 

 



RE: Display Doc or PDF file in JSP

2009-07-27 Thread Nitesh Jain
Thanks Pawel,

It works for PDF file. Cant we find out any solution for DOC.

Regards,

Nitesh

-Original Message-
From: Paweł Wielgus [mailto:poulw...@gmail.com] 
Sent: 27 July 2009 18:01
To: Struts Users Mailing List
Subject: Re: Display Doc or PDF file in JSP

Hi Nitesh,
as far as i know it's impossible with DOC, but pretty easy with PDF,
just create iframe with source that will point to that pdf file.
Most browsers on computers where acrobat reader is installed will
display it as an inline document,
i don't know if it will work with div only.

Best greetings,
Paweł Wielgus.


2009/7/27 Nitesh Jain er.niteshj...@gmail.com:
 Hi All,



I have requirement to display a Doc or PDF file into a div
 tag of the JSP. It means that JSP will display a DOC/PDF file in half of the
 page and remaining space will be used to display some other information. Can
 anyone guide me to achieve this with or without using the struts?



 Regards,



 Nitesh







-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Freemarker and Select Tag

2009-07-17 Thread Nitesh Jain
Hi Robin,

Select tag expects an list object in the list attribute but in your
case you are providing an Map that's why it is not behaving correctly.
I suggest create an object called UserType with two fields id and name. And
put these objects into a list (lets say usertypes). Now use following tag to
display a select box.

s:select   name=userTypes headerKey=-1 theme=ajax

headerValue=-- Please Select -- list=#application.usertypes listKey=id
listValue=name label=Select User Type/

Hope it will help you.

Regards,

Nitesh Jain

-Original Message-
From: Robin Mannering [mailto:ro...@mtndesigns.co.uk] 
Sent: 16 July 2009 20:36
To: Struts Users Mailing List
Subject: Freemarker and Select Tag

Hello,

Platform : Struts 2, EJB 3.0, Glassfish 2.1

I'm having trouble using the Freemarker equivalent of the JSP Struts 2 
Select Tag.

I need to convert:

s:select list=application.userTypes /

into the Freemarker equivalent.

userTypes is an application defined attribute.  I have checked the 
existence of the attribute within the page and it is shown as expected.

My List/Map is defined as

MapInteger, String userTypes = new HashMapInteger, String();
userTypes.put(1, AGENCY_USER);
userTypes.put(2, SHOP_USER);
userTypes.put(3, TOUR_OPERATOR_USER);

I have tried the following, none of which work (or work correclty).

@s.select list=application.userTypes/   -- elements are placed into 
the select box, but are valued as 1=AGENCY_USER, 2=SHOP_USER

The following produce empty select boxes (or errors)

@s.select list=application.userTypes/

@s.select list=${application.userTypes}/

Does anybody have any ideas ?

Thanks



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Login with Struts2

2009-07-17 Thread Nitesh Jain
Hi,

I have also implemented login mechanism but I have used Servlet
filter to check the user login status.
I have applied filer on the restricted URI of my application by just a small
configuration in web.xml. 

Regards,

Nitesh Jain

-Original Message-
From: Robin Mannering [mailto:ro...@mtndesigns.co.uk] 
Sent: 17 July 2009 01:18
To: Struts Users Mailing List
Subject: Re: Login with Struts2

Hi,

I recently implemented a login mechanism but did it slightly differently 
after recommendations from this mailing list to use an interceptor.

Each action/page that requires a validated login is directed via a 
Interceptor.

The sole purpose of the interceptor is to verify the existence of an 
object in the session.  Here is the guts of the method:

public String intercept(ActionInvocation invocation) throws Exception {
   
ActionContext ac = invocation.getInvocationContext();
Map session = ac.getSession();
   
// retrieve the login status from the session by key name.
User user = (User) session.get(Constants.USER_SESSION_SCOPE);
   
// if the user object is non null, the user is logged in.
if (user != null) {;
return invocation.invoke();
}
  
return notLoggedIn;
}

It is then necessary to create a new interceptor stack:

interceptor-stack name=my.validationWorkflowStack
   
interceptor-ref name=defaultStack/
interceptor-ref name=amr.validation/
   
/interceptor-stack

I also defined a global-result as follows to take care of directing the 
client when not logged in.

global-results
result name=notLoggedIn type=redirectAction
param name=actionNameshowLogin/param
/result
/global-results 

Finally, here is an example of a protected action using the new 
interceptor stack:

action name=showControlPanel
   
!-- Include our validation stack to ensure user is logged 
in --
interceptor-ref name=my.validationWorkflowStack/
   
result type=freemarker/controlPanel.ftl/result
/action

You then simply need a regular action to take of the login which will 
place a valid object/flag in the session.

Hope this helps


mathias-ewald wrote:
 Hi,

 I am trying to implement a login mechanism. I will now explain what I did
 and what error I get but in case there is a more sophisticated way to do
 that - please tell me!

 I created a BaseAction which is the parent of all my Actions. The
BaseAction
 is supposed to be responsible for displaying a login page if there is no
 User object in session scope. Then the login form should put the username
 and password into the BaseAction. The BaseAction then tries to find a
match
 in the database and places the User object into session scope:

 -
 public abstract class BaseAction {

   private String username;
   
   private String password;
   
   protected Log log;
   
   private Boolean loginStatus;
   
   
   public String execute() {
   if(log == null) {
   log = LogFactory.getLog(getClass());
   }
   
   if(isProtected()) {
   MapString, Object session =
ActionContext.getContext().getSession();
   Object o = session.get(user);
   if(o instanceof User) {
   loginStatus = true;
   } else {
   return login;
   }
   }
   
   
   return executeAction();
   }

   
   public abstract String executeAction();

   public abstract Boolean isProtected();
   

   public Boolean getLoginStatus() {
   return loginStatus;
   }

   public void setLoginStatus(Boolean loginStatus) {
   this.loginStatus = loginStatus;
   }

   public String getUsername() {
   return username;
   }

   public void setUsername(String username) {
   this.username = username;
   }

   public String getPassword() {
   return password;
   }

   public void setPassword(String password) {
   this.password = password;
   }
 }
 -

 An Action that wants to be password protected must implement
#isProtected()
 to return true. This is my JSP file that is shown if #isProtected() ==
 true and there's no User in session scope:

 -
 ...
 s:form
   s:textfield label=Username
name=userData.username/s:textfield
   s:password label=Password name=userData.password/s:password
   s:submit/s:submit
 /s:form
 ...
 -

 This is the error I get

 -
 20:35:42,179  WARN

RE: [OT] Re: Fired???? was...Re: Struts Books Recommendations [OT]

2005-07-08 Thread Nitesh Naveen
I agree with Craig here...
He is quiet right about the mailing problem...
I had been using my company id and have been told by them to unsubscribe
from the due to the volume of messages coming in.
Despite the volume if the mails had something to defend I could've done it.
But the never ending flow of OTs like these which are of no use to anyone is
not quiet the way anyone would like!

Friday of the week is over... At least from this point on let us cut this
off.


Regards,
 
Nitesh
_

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com
_


-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 09, 2005 4:04 AM
To: Struts Users Mailing List
Subject: Re: [OT] Re: Fired was...Re: Struts Books Recommendations [OT]


On 7/8/05, James Mitchell [EMAIL PROTECTED] wrote:
 Andrew, you must be new here.  See, on Fridays (usually), we like to 
 cut up and have a little fun.  I think I've donated enough blood on 
 this list to deserve a break every now and then.

And perhaps its time to reign in the freedom to cut up a little on Fridays.
With freedom comes responsibility, and there's been way too many abuses of
that freedom lately (including this thread).

 If you don't like wasting time with [OT] posts, filter them.  Every 
 decent mail client will allow you to do that.

Note that filtering is not a complete answer.  Consider a scenario where you
are subscribed to a list like this from your company email address, where
you have (explicitly or implicitly) agreed to whatever terms of use your
company's IT department imposes on you.  In more than a few companies,
incoming email messages are scanned for inappropriate content -- and you
could be violating the policies even if you have a personal filter set up so
that *you* don't have to read the messages.  But I didn't read it isn't
going to be a very useful defense -- any more than if your mom caught you
reading Playboy when growing up, and you tried but I didn't look at the
pictures, I was only reading the articles!

I'd like to point you at a blog written recently by an industry colleague,
who has been observing what's going on here:
http://www.groundside.com/blog/content/DuncanMills/J2EE%20Development/2005/0
7/08/Respect.html

Even though Duncan works for a company that competes with my employer, and
builds a tool that is competitive with the one I work on, I still consider
him a friend, like many things about his product, and collaborate with him
where possible to improve the overall state of the industry.  I
wholeheartedly subscribe to his comments about respect, and would like to
see a return to the way that the Struts user list worked (nearly all of the
time) until fairly recently -- where respect was the norm.  Today it is not
... and even in jest many of the comments are innappropriate and embarrasing
(to the rest of the community, for having to be associated with it).

If you're only here for the Friday [OT] humor, then I suggest you find a
different place to cut loose.  The purpose of this list is to answer user
questions about Struts and all its related technologies -- and you'll sure
like how you look on a Google search ten years from now for your name if
you've posted like a mature adult instead of an immature 8-year-old.

Craig McClanahan

-
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: Struts and Generics

2005-07-06 Thread Nitesh Naveen
Generics is a Java 5.0 feature...
Don't think the features with 5.0 are introduced to Struts framework yet!


Thanks  Regards,
 
Nitesh
_

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com
_


-Original Message-
From: Kent Boogaart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 06, 2005 1:11 PM
To: user@struts.apache.org
Subject: Struts and Generics


Hi there,

I'm wondering whether it's possible to use generics with struts. Something
like:

form-bean name=test type=org.apache.struts.validator.DynaValidatorForm
form-property name=users
type=java.util.ArrayListtestpackage.User/
/form-bean

I tried doing this (with my class names of course) and I get this exception
on startup:
javax.servlet.ServletException: Can't get definitions factory from
context.

Thanks,
Kent


-
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: Question re html:select on the client

2005-07-06 Thread Nitesh Naveen
You could use JavaScript to submit the form on clicking the link.
Have a hidden field to track which link is clicked.

For e.g.. Use this function in the link...

function clickLink(linkId)
{
document.formName.hiddenElementName.value=linkId;
document.formName.submit();
}

PS: you need to make sure there are no fields in your form with the name -
submit

HTH,
 
Nitesh
_

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com

_


-Original Message-
From: Kent Boogaart [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 07, 2005 10:20 AM
To: user@struts.apache.org
Subject: Question re html:select on the client


Hello,

I have an html:select populated from a collection. Alongside the select box
I have links to add, edit and delete items. I'm just wondering what the best
way is to handle passing the ID of the selected item to the edit and delete
actions.

For example, if the user selects the option with value 12, I'd like to
forward to something like /editAction?id=12. Is there some way to tell the
html:link tag to dynamically construct the querystring on the client?

Thanks,
Kent


-
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: howto with validator

2005-07-05 Thread Nitesh Naveen
Well... You need not extend the validator plugin. You could write your
custom validator class and write a method in that... For eg. You could
specify this in your validator-rule.xml...

 validator name=whatever classname=com.myvalidation.FieldChecks
method=validateWhatever

All you need to have now is a class FieldChecks in the given package and a
method as specified. Now you have the validation. You could use this
validation - 'whatever' - in your validation.xml

HTH,
 
Nitesh
_

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com
_


-Original Message-
From: Dewitte Rémi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 05, 2005 4:36 PM
To: Struts Users Mailing List
Subject: Re: howto with validator


Ok thanks, i'll try to achieve with the validator-rule.xml. But if i can't
you 
suggest me to extends the plugin validator to include more specific rules, 
didn't you ?

Rémi

Le Mardi 5 Juillet 2005 07:45, Nitesh Naveen a écrit :
 You could do this with validator and indexed properties.
 When using indexed properties, JavaScript validations doesn't work. 
 However the server side validations does. This should suffice what you 
 need... In case you have some validations that involve business logic, 
 you could add more validations, customize the validator-rule.xml add 
 your own validation there point it to a custom validator method in the 
 validator you have coded.


 HTH,

 Nitesh
 _

 Disclaimer:
 Information contained and transmitted by this e-mail is confidential, 
 proprietary, and legally privileged data of Cordiant Technologies that 
 is intended for use only by the addressee. If you are not the intended 
 recipient, you are notified that any dissemination, distribution, or 
 copying of this e-mail is strictly prohibited and you are requested to 
 delete this e-mail immediately and notify the originator. Any views 
 expressed by an individual do not necessarily reflect the view of 
 Cordiant Technologies. The recipient should scan this email and any 
 attachments for viruses as Cordiant Technologies is not liable for the 
 presence of viruses in this email. Cordiant Technologies does not 
 accept liability for any errors or omissions as the internet 
 communications cannot be guaranteed to be timely, secure, error or 
 virus-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete.

 To know more about Cordiant Technologies, please visit 
 http://www.cordiant.com _


 -Original Message-
 From: Dewitte Rémi [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 04, 2005 9:21 PM
 To: Struts Users Mailing List
 Subject: howto with validator


 Hello everybody !
 I have some howto questions related to validator.
 I'd like to do some checks on my form :

 1) in a multibox question, i'd like to check at least 2 are checked 
 and at most 4.

 2) I have a mapped property, I'd like to check every mymap(key) is 
 answered.

 3) I have a form property of type java.lang.String[], which is an 
 array of

 names(html:text property=names[0]/). I'd like to check all the 
 names with usual validator features.

 Is it possible with the validator or may I make it in my actionForm ?

 Thanks

 Rémi

 -
 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: Velocity Question

2005-07-05 Thread Nitesh Naveen
You could probably use format macro for formatting the number...

http://www.atlassian.com/software/jira/docs/api/3.1.1/com/atlassian/jira/uti
l/velocity/NumberTool.html
http://www.opensubscriber.com/message/velocity-user@jakarta.apache.org/14631
34.html


Thanks  Regards,
 
Nitesh
_

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com
_


-Original Message-
From: Lucas Bern [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 06, 2005 8:20 AM
To: Struts Users Mailing List
Subject: Re: Velocity Question


HI!
I´m not sre what you mean... but
StringUtils is not  an abstract class, so you could put in the context of
Velocity an instance of StringUtils velContext.put(StringUtils, new
StringUtils() ); In your template...
 
$StringUtils.leftPad( $car.id, 6, '0') $StringUtils.leftPad( $car.na000me,
15, ' ')
 
wish it helps...
 
Lucas
 


Vinicius Caldeira Carvalho [EMAIL PROTECTED] escribió:
Sorry for the OT. But since they're kinda related ... Does velocity provides
a way to fill gaps on my variables? Translating... I have a pojo car, which
has ID and Name Id must have size 6 with zero left padd, and Name 15 with
with white spaces padding. Now let's suppose I have:

Car beetle = new Car(1,beetle);
When printing:
$car.id $car.name
I get
1 beetle
When the desirable would be:
1 beetle

This is for reporting purposes

Thanks all



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


__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar


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



RE: ActionForm reset() and redirect.

2005-07-04 Thread Nitesh Naveen
Try putting in some logic where ever you are assigning the value... like if
it is not set then set it to false... if it is already set don't touch it!

HTH
Nitesh

-Original Message-
From: Ben [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 04, 2005 1:05 PM
To: Struts
Subject: ActionForm reset() and redirect.

Hi

My form has some boolean properties and I set them to false in the
reset method. The Action that handles the form has redirect attribute
as true, i.e if there is an error, it redirects to the same page that
has the form with errors. When it redirects with errors, the form
retains values for other properties except the boolean ones. What I
can do to fix this? If I don't set the boolean properties to false in
the reset method, the form works fine.

Please help, thanks.
Ben

-
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: howto with validator

2005-07-04 Thread Nitesh Naveen
You could do this with validator and indexed properties.
When using indexed properties, JavaScript validations doesn't work. However
the server side validations does.
This should suffice what you need...
In case you have some validations that involve business logic, you could add
more validations, customize the validator-rule.xml add your own validation
there point it to a custom validator method in the validator you have coded.


HTH,
 
Nitesh
_

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com
_


-Original Message-
From: Dewitte Rémi [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 04, 2005 9:21 PM
To: Struts Users Mailing List
Subject: howto with validator


Hello everybody !
I have some howto questions related to validator.
I'd like to do some checks on my form :

1) in a multibox question, i'd like to check at least 2 are checked and at 
most 4.

2) I have a mapped property, I'd like to check every mymap(key) is answered.

3) I have a form property of type java.lang.String[], which is an array of

names(html:text property=names[0]/). I'd like to check all the names
with 
usual validator features.

Is it possible with the validator or may I make it in my actionForm ?

Thanks

Rémi

-
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: deal with nested properties

2005-07-01 Thread Nitesh Naveen

You should probably have...

form-bean name=questionnaireForm
type=org.apache.struts.validator.DynaValidatorForm
  form-property name=page type=java.lang.Integer initial=1/
  form-property name=firstName type=java.lang.String initial=Nom
/
  form-property name=lastName type=java.lang.String /
 form-property name=child type=java.lang.String initial=N/
  form-property name=numChild type=java.lang.Integer initial=0/
  form-property name= children  type=package.Personne[] /
/form-bean

HTH
Nitesh


-Original Message-
From: Dewitte Rémi [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 01, 2005 5:54 PM
To: Struts Users Mailing List
Subject: deal with nested properties

Hi all !
I have another problem to submit :

Here is my bean
form-bean name=questionnaireForm 
type=org.apache.struts.validator.DynaValidatorForm
  form-property name=page type=java.lang.Integer initial=1/
  form-property name=firstName type=java.lang.String initial=Nom
/
  form-property name=lastName type=java.lang.String /
 form-property name=child type=java.lang.String initial=N/
  form-property name=numChild type=java.lang.Integer initial=0/
/form-bean

where Personne is a class of two attributes {name,age} with their getters
and 
setters.

In my jsp, I try do do this :

bean:define id=numChild name=questionnaireForm property=numChild 
type=java.lang.Integer/
c:forEach begin=1 end='%=numChild.intValue()%' var=ind
bean:define name=ind id=ind2 type=java.lang.Integer/
tr
tdbean:write name=ind//td
tdhtml:text property='%=children[+(ind2.intValue()-1)+].name%' 
size=30 maxlength=30//td
tdhtml:text property='%=children[+(ind2.intValue()-1)+].age%' 
size=30 maxlength=30//td
/tr
/c:forEach

And i get this error : 
No getter method for property children[0].name of bean 
org.apache.struts.taglib.html.BEAN

Following the Struts FAQ for Indexed properties, it seems it should work...

Please tell me what I missed.
Rémi

-
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: DynaActionForm values problem after submit

2005-06-30 Thread Nitesh

Try putting some debugs into your action class...
probably your pre-population logic is running over your edited data!

Nitesh
- Original Message - 
From: Ciaran Hanley [EMAIL PROTECTED]

To: 'Struts User Mailing List' struts-user@jakarta.apache.org
Sent: Thursday, June 30, 2005 3:11 PM
Subject: DynaActionForm values problem after submit


Can anybody help me with the problem below please. I've hit a brick wall
with it! :)

-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
Sent: 28 June 2005 20:02
To: 'Struts User Mailing List'
Subject: Unable to read DynaForm array values

I have the following DynaActionForm bean (where EditPaymentForm extends
DynaActionForm so I can use the validation method) and corresponding action
mapping

form-bean name=paymentsForm type=app.EditPaymentForm
 form-property name=payments type=app.PaymentBean[]/
 form-property name=name type=java.lang.String /
/form-bean

action path=/editpayments
   type=app.EditPaymentAction
   name=paymentsForm
   scope=session
/action


I pre-populate this form in my Action class for display on a JSP for
editing. The values show up fine in the JSP text boxes. When the form is
submitted the String name property changes fine, but the values in the
payments array is not being saved. I just get the original pre-populated
data when I use the get methods after submitting.

Here is a snippet from the JSP

html:form action=/editpayments?action=edit
 logic:iterate name=paymentsForm property=payments id=PaymentBean
   html:text name=PaymentBean property=paymentAmount indexed=true /
 /logic:iterate
 html:text property=name /

!-- etc --


And here is form class

public class EditPaymentForm extends DynaActionForm implements Serializable
{
 public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request)
 {
   //custom checks
 }
}

Can anybody help me figure out why the values aren't being saved upon
submitting the form please?

Thanks



-
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: DynaActionForm values problem after submit

2005-06-30 Thread Nitesh

should've been
logic:iterate name=paymentsForm property=payments id=payments
   html:text name=payments property=paymentAmount indexed=true /
/logic:iterate

basically your generated html would look like...
input type=text name=payments[0].paymentAmount /
input type=text name=payments[1].paymentAmount /
...

HTH
Nitesh

- Original Message - 
From: Marsh-Bourdon, Christopher [EMAIL PROTECTED]

To: 'Struts Users Mailing List' user@struts.apache.org
Sent: Thursday, June 30, 2005 3:15 PM
Subject: RE: DynaActionForm values problem after submit


Is it the name of the property is 'paymentAmount' yet in the form 
definition

it states the name as 'payments'?

Christopher Marsh-Bourdon
www.marsh-bourdon.com


-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
Sent: 30 June 2005 10:42
To: 'Struts User Mailing List'
Subject: DynaActionForm values problem after submit

Can anybody help me with the problem below please. I've hit a brick wall
with it! :)

-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
Sent: 28 June 2005 20:02
To: 'Struts User Mailing List'
Subject: Unable to read DynaForm array values

I have the following DynaActionForm bean (where EditPaymentForm extends
DynaActionForm so I can use the validation method) and corresponding 
action

mapping

form-bean name=paymentsForm type=app.EditPaymentForm
 form-property name=payments type=app.PaymentBean[]/
 form-property name=name type=java.lang.String / /form-bean

action path=/editpayments
   type=app.EditPaymentAction
   name=paymentsForm
   scope=session
/action


I pre-populate this form in my Action class for display on a JSP for
editing. The values show up fine in the JSP text boxes. When the form is
submitted the String name property changes fine, but the values in the
payments array is not being saved. I just get the original pre-populated
data when I use the get methods after submitting.

Here is a snippet from the JSP

html:form action=/editpayments?action=edit
 logic:iterate name=paymentsForm property=payments id=PaymentBean
   html:text name=PaymentBean property=paymentAmount indexed=true 
/

 /logic:iterate
 html:text property=name /

!-- etc --


And here is form class

public class EditPaymentForm extends DynaActionForm implements 
Serializable

{
 public ActionErrors validate(ActionMapping mapping, 
HttpServletRequest

request)
 {
   //custom checks
 }
}

Can anybody help me figure out why the values aren't being saved upon
submitting the form please?

Thanks



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



The information contained herein is confidential and is intended solely 
for the

addressee. Access by any other party is unauthorised without the express
written permission of the sender. If you are not the intended recipient, 
please
contact the sender either via the company switchboard on +44 (0)20 7623 
8000, or
via e-mail return. If you have received this e-mail in error or wish to 
read our

e-mail disclaimer statement and monitoring policy, please refer to
http://www.drkw.com/disc/email/ or contact the sender. 3166



-
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 dynamic GET data

2005-06-30 Thread Nitesh
Probably you could get the GET data in the action class which goes to a 
intermediate JSP which does nothing but forwards to the right JSP using the 
GET data.


HTH
Nitesh
- Original Message - 
From: Karianne Berg [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Thursday, June 30, 2005 3:32 PM
Subject: Using dynamic GET data



Hello,

I'm fairly new to Struts, and I'm trying to transform a web presentation
application of some size into using Struts for the Controller part, since 
it has

grown really, really long.

For the presentation part of the application, the users are supposed to 
follow
links and get presented with information based on the GET data in the 
url's.
Normally, I would just extend DispathAction for this (that was my first 
plan,
anyway). Problem is, the information in the GET data is given by the user 
who
made the presentation in the publishing part of the application. How can I 
make
Actions that can handle any type of GET data and still get the user 
dispatched

to the right jsp page?

Thanks in advance,
Karianne

-
Start.no tilbyr nå raskere bredbånd til lavere pris.
Sjekk http://www.start.no/bredband/ for mer informasjon

-
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: multiselect checkbox inside multiselect dropdown

2005-06-30 Thread Nitesh
You should probably try to put in the DHTML Folder tree to display your 
list...

There should be script available online for doing this...
the change you'll have to put in your folder tree would be to add checkboxes 
in addition to the text.


HTH
Nitesh
- Original Message - 
From: Vicky [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 30, 2005 4:26 PM
Subject: Re: multiselect checkbox inside multiselect dropdown



Anybody with the solutions please?

--- Vicky [EMAIL PROTECTED] wrote:


I need to design a control on Struts UI page with
following functionalities.

* I have two attributes: Region, office. I have to
design following tree structure on UI
+Region 1 (checkbox)
office1 (checkbox)
office2 (checkbox)
office3 (checkbox)

+Region 2 (checkbox)
office1 (checkbox)
office2 (checkbox)

Based on above UI (which I don't quite sure how to
achieve in multi select dropdown) if user selects
office1 thenregion1 should get selected
automatically.
If user selects Region 2 then it should select all
offices underneadh automatically.

can anyone guide me how do i go achieve these two
functionalities
first to auto select things and second how do I
build
this kind of UI (multi select , multi select in drop
down). Any help with code examples would be much
appreciated.

Thanks,

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com



-

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







__
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail

-
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: Passing collection Objects from html form to Action class

2005-06-30 Thread Nitesh
You could probably think of putting them as a session/request attribute and 
access it from action class!


Nitesh
- Original Message - 
From: Phani [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 30, 2005 10:08 PM
Subject: RE: Passing collection Objects from html form to Action class



Tell me which is performance efficient  desired way:

Putting the form in session or making a trip to the
database..

assuming we have collection of 50 - 60 records..

Phani..

--- Mark Benussi [EMAIL PROTECTED] wrote:


Sadly you cannot unless you make the scope of the
form session.

I find it limiting to say the least!



-Original Message-
From: Phani [mailto:[EMAIL PROTECTED]
Sent: 30 June 2005 16:14
To: Struts Users Mailing List
Subject: Passing collection Objects from html form
to Action class

I have a Collection Object in my JSP which I am able
to display using display Tag.

I want to render those collection objects when I
submit my html form, so that I can retrieve them in
my
Action class as form property.

If it is a string, I can render it as hidden field..

input type=hidden name=name
value=%=myForm.getName()%/

And in the Action class I can just say,

String name = myForm.getName();

How can I achieve the same thing for a collection
object.

Thanks,
Phani.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com



-

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




-

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





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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





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



Re: iterate on a value

2005-06-30 Thread Nitesh

Use a normal JSP scriptlet and loop over to put in the required fields.

HTH
Nitesh

- Original Message - 
From: Dewitte Rémi [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 30, 2005 11:46 PM
Subject: iterate on a value



Hello !
In my form , i ask the number of children. On the next page, i'd like to
display as many textboxes as children to get their name.
logic:iterate provides iteration on array or collection, how can i 
iterate

on the number of children ?
Thanks !

-
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: check role - isUserInRole in jstl

2005-06-30 Thread Nitesh

Try if  this works...
c:if test=%= request.isUserInRole('aa') %
/c:if

Nitesh


- Original Message - 
From: Grzegorz Stasica [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Thursday, June 30, 2005 10:18 PM
Subject: check role - isUserInRole in jstl



I've a code like that
c:if test=${request.isUserInRole('aa')}
/c:if

but I get an error that namespace has to be specified.
IsUserInRole is a function so probably I invoke it incorectlly.
How can I check user's role in jstl?


-
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:file

2005-06-30 Thread Nitesh

The page expiring has probably nothing to do with the html:file.
Try removing that html:file and then go through the same steps and verify if 
you get the same problem.


Mostly this may have to do with the page you are going back to being a 
submitted reuqest which has expired


Nitesh

- Original Message - 
From: vinod varghese [EMAIL PROTECTED]

To: user@struts.apache.org
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 30, 2005 10:30 PM
Subject: Using html:file



Hi,

I have a particular issue using the html:file tag. The situation is that 
my jsp uses a html:file tag.First I submit the jsp which returns a 
validation error through the html:errors tag. I correct those errors and 
again submit the form which after processing in the action takes to 
another jsp and brings up the screen. Now my problem is that when I hit 
the browser back button the page is shown as expired.


In both the above cases my jsp just contains a html:file tag but I havent 
used it.


_
Test Your Memory and Win Amazing Prizes! 
http://adfarm.mediaplex.com/ad/ck/4686-26272-10936-429?ck=BrainTeaser DVD 
Players, Digicams  more!



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





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



Re: How to create form rows dynamically

2005-06-29 Thread Nitesh

Probably you should try using the validator framework for validation.
you could avoid using the custom form in case you just use it for 
validation.

You could add in your validations into the validation-rules and use it.

Make sure your form has sesion scope.
That apart, Im not sure why you don't get the updated values...


Nitesh


- Original Message - 
From: Ciaran Hanley [EMAIL PROTECTED]

To: 'Struts User Mailing List' struts-user@jakarta.apache.org
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 28, 2005 7:23 PM
Subject: Re: How to create form rows dynamically


Hi,

I followed the example you attached and it seemed to have worked except when
I submit the form I cannot get at the form values.

For example when I submit the form if the newAmnt text box gets a new value
of say 10.00, the value on the server side is still returned as 0.00 (the
original value).

Would you know what might cause this? I am using a form which extends
DynaActionForm so I can use the validation method.

-Original Message-
From: Nitesh [mailto:[EMAIL PROTECTED]
Sent: 23 June 2005 10:50
To: Struts Users Mailing List
Subject: Re: How to create form rows dynamically

Attaching the answer John had given me for indexed properties.
Hope this would help...


- Original Message - 
From: Ciaran Hanley [EMAIL PROTECTED]

To: 'Struts User Mailing List' struts-user@jakarta.apache.org
Sent: Thursday, June 23, 2005 3:01 PM
Subject: How to create form rows dynamically



Can somebody help me or propose a solution to the following please.



I wish to create a form dynamically. Depending on the business logic there
could be 0 to N rows in the form. I tried to use a form with an array of
strings and use the indexed=true setting in the html:text boxes but as I
was not following any example I ran into problems and didn't have any
guide
as to where I was going wrong.



I also need to iterate over a bean containing information which
corresponds
to the form as the form boxes are being displayed.



Say if there is 3 rows required, it should ok like the following.



Payment Old AmntNew Amnt  Date

1   35  [45]  [12/12/04]

2   35  [45]  [12/01/05]

3   35  [45]  [12/02/05]



Where [] represents a html:text box.



I am also unsure as to how to access these values when I get to the
form/action classes.



Any help would be much appreciated!












-
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: Problems with validator and IE 5.0

2005-06-28 Thread Nitesh
Guess you would need to modify the JavaScript in your validator-rules 
suitably!!!


HTH
Nitesh
- Original Message - 
From: Lionel [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Tuesday, June 28, 2005 4:08 PM
Subject: Problems with validator and IE 5.0



Hi all!

How can I use struts validator with IE 5.0 ?
The getAttributeNode javascript function which is called to get the form
name is not supported by IE 5.0.
(using form.name would work...)
Thanks.




-
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: javascript html:fprm and getElementById

2005-06-26 Thread Nitesh

Try out...

function setParam(mode)
{
 document.forms[myform].action =%=(String) 
request.getAttribute(origin)%+ mode+ .do;

 document.forms[0].submit();
}

HTH
Nitesh
- Original Message - 


Hi,
I need to change the action of my form on the fly. I use the following
javascript:
function setParam(mode)
{
document.getElementById(myform).action =%=(String)
request.getAttribute(origin)%
+ mode+ .do;
document.forms[0].submit();

}
and my form is :
html:form action=%=(String) request.getAttribute(origin)%
styleId=myform

It works perfect under mozilla but not IE. I think the problem is that IE
looks for Id in the name field of form and he couln't find it.
Could anyone help me?
Regards
ARash





-
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: javascript html:fprm and getElementById

2005-06-26 Thread Nitesh

Forgot to add that myform should be the form name!

Nitesh
- Original Message - 
From: Nitesh [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Monday, June 27, 2005 10:23 AM
Subject: Re: javascript html:fprm and getElementById



Try out...

function setParam(mode)
{
 document.forms[myform].action =%=(String) 
request.getAttribute(origin)%+ mode+ .do;

 document.forms[0].submit();
}

HTH
Nitesh
- Original Message - 


Hi,
I need to change the action of my form on the fly. I use the following
javascript:
function setParam(mode)
{
document.getElementById(myform).action =%=(String)
request.getAttribute(origin)%
+ mode+ .do;
document.forms[0].submit();

}
and my form is :
html:form action=%=(String) request.getAttribute(origin)%
styleId=myform

It works perfect under mozilla but not IE. I think the problem is that IE
looks for Id in the name field of form and he couln't find it.
Could anyone help me?
Regards
ARash





-
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: javascript html:fprm and getElementById

2005-06-26 Thread Nitesh
getElementById is indeed the standards-compliant method... but something 
which came in a bit late!!! Browser  IE 5+ and Netscape 6+ support them... 
but the earlier version browsers does not support getElementById (since 
these browsers date before the standard was introduced.


Also the standard practice followed for manipulating forms in the HTML 
document using JavaScript is the form array/object rather than 
getElementById. (Doesn't mean that you cannot/should not use getElementById) 
getElementById is introduced keeping in mind the DHTML parts and as a 
standard way to access the DOM elements which were not exposed as 
arrays/object for JavaScript. For e.g.. accessing the table cells/rows or 
DIV/SPAN elements etc to bring in DHTML effects.


HTH,
Nitesh Naveen

- Original Message - 
From: Frank W. Zammetti [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Monday, June 27, 2005 10:39 AM
Subject: RE: javascript html:fprm and getElementById


Remember that getElementById is the standards-compliant method, the 
others are not, IIRC.  They of course work too, but when manipulating DOM 
objects, getElementById is supposed to be used, according to the current 
standards.


Is there such a thing as casting in JS?  I'm not sure.  I don't think 
there is as far as object references go anyway, but I could be wrong.


Frank

-Original Message-
   From: Nitish Kumar[EMAIL PROTECTED]
   Sent: 6/27/05 12:37:42 AM
   To: 'Struts Users Mailing List'user@struts.apache.org
   Subject: RE: javascript html:fprm and getElementById


   I geuss, some thing working or not working in JavaScript is a lot 
dependent

   on what version of what browser, are you using.

   Well, Any ways, from my previous experience with JavaScript, usually

   document.getElementById gives you an object, and casting it to form 
doesnt

   work all the time..

   it is always better to use document.forms[i].action .


   Thanks and Regards,
   Nitish Kumar




   -Original Message-
   From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
   Sent: Monday, June 27, 2005 3:05 AM
   To: Struts Users Mailing List
   Subject: Re: javascript html:fprm and getElementById


   Why do you believe this does not work?  I just tried in IE and it 
worked

   fine, as I would expect since I do this sort of thing all the time.

   I would suggest throwing an alert before and after the code setting the
   action, display what the action of the form is.  I did this and it does
   indeed change.

   -- 
   Frank W. Zammetti

   Founder and Chief Software Architect
   Omnytex Technologies
   http://www.omnytex.com

   Arash Bijanzadeh wrote:
Hi,
I need to change the action of my form on the fly. I use the 
following

javascript:
function setParam(mode)
{
document.getElementById(myform).action =%=(String)
request.getAttribute(origin)%
+ mode+ .do;
document.forms[0].submit();
   
}
and my form is :
html:form action=%=(String) request.getAttribute(origin)%
styleId=myform 
   
It works perfect under mozilla but not IE. I think the problem is 
that IE

looks for Id in the name field of form and he couln't find it.
Could anyone help me?
Regards
ARash
   







[Message truncated. Tap Edit-Mark for Download to get remaining portion.]


-
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: JAAS example

2005-06-23 Thread Nitesh
http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/JAASRefGuide.html 
and

http://struts.apache.org/userGuide/preface.html#jaas

could be a starting point...

HTH
Nitesh
- Original Message - 
From: Arash Bijanzadeh [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 23, 2005 2:47 PM
Subject: JAAS example


Hi all,
I am searching for an example of using struts security framework and JAAS
maybe. Could anyone lead me to a document/tutorial/example?
Thanks
Arash B.


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



Re: How to create form rows dynamically

2005-06-23 Thread Nitesh

Attaching the answer John had given me for indexed properties.
Hope this would help...


- Original Message - 
From: Ciaran Hanley [EMAIL PROTECTED]

To: 'Struts User Mailing List' struts-user@jakarta.apache.org
Sent: Thursday, June 23, 2005 3:01 PM
Subject: How to create form rows dynamically



Can somebody help me or propose a solution to the following please.



I wish to create a form dynamically. Depending on the business logic there
could be 0 to N rows in the form. I tried to use a form with an array of
strings and use the indexed=true setting in the html:text boxes but as I
was not following any example I ran into problems and didn't have any 
guide

as to where I was going wrong.



I also need to iterate over a bean containing information which 
corresponds

to the form as the form boxes are being displayed.



Say if there is 3 rows required, it should ok like the following.



Payment Old AmntNew Amnt  Date

1   35  [45]  [12/12/04]

2   35  [45]  [12/01/05]

3   35  [45]  [12/02/05]



Where [] represents a html:text box.



I am also unsure as to how to access these values when I get to the
form/action classes.



Any help would be much appreciated!




---BeginMessage---
In the struts-config.xml:

form-bean name=ManageAccountsForm type=application.EditUsersForm
form-property name=users type=application.UserBean[]
/form-bean


action-mappings
action
  path=/application/EditUsers
  type=application.EditUsersAction
  name=EditUsersForm
  scope=session

  forward
name=success
path=editUsers.jsp
redirect=false
  /
action-mappings


In EditUsersAction.java execute method

// get collection of users from the database
Collection users = getUserBeans ();

// put collection into form as an array for editing
form.set ( users, users.toArray ( new UserBean[0] ) );

In editUsers.jsp

logic:iterate id=users name=EditUsersForm property=users
html:text name=users property=name indexed=true
/logic:iterate

In the produced HTML:

input type=text name=users[0].name /

If you need to client side validation, you'll probably need to write your
own JSP to deal with the element above.

As for using validate.xml to validate on the server side. I've never tried
it with arrays, I just iterate over them in the validate (...) method of the
form, like so:

UserBean users[] = (UserBean[]) form.get ( users );
for ( int i = 0; i  users.length; i++ ) {
// check on the attributes of UserBean users[i]
}

Hope that example clears it up for you.

John



On 20050603 5:05 AM, Nitesh [EMAIL PROTECTED] wrote:

 Thanks for the answer John...
 
 Could you give me an example as to how we pre populate the array?
 
 Regards,
 Nitesh
 - Original Message -
 From: John Fitzpatrick [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Thursday, June 02, 2005 6:00 PM
 Subject: Re: Problem using indexed properties and validator framework
 
 
 
 For an Array in a DynaForm property, you can either set the size in the
 form-property descriptor or, in the case of a session form, pre-populate
 the
 Array in your action with the number of elements you desire.
 
 
 
 
 -
 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]


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

Re: JAAS example

2005-06-23 Thread Nitesh
Googling results...

http://jakarta.apache.org/slide/howto-jaas.html
http://www.isys.uni-klu.ac.at/ISYS/Courses/04WS/webtechnologien/downloads/TomcatConfig.pdf



Nitesh

- Original Message - 
  From: Arash Bijanzadeh 
  To: Nitesh 
  Sent: Thursday, June 23, 2005 3:14 PM
  Subject: Re: JAAS example


  I am familiar with JASS. My question is how struts using the JAAS for 
security, how shall I implement it and for the starting point how can I get a 
JAAS user in a Action working with the tomcat?


  On 6/23/05, Nitesh [EMAIL PROTECTED] wrote: 
http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/JAASRefGuide.html 
and
http://struts.apache.org/userGuide/preface.html#jaas

could be a starting point...

HTH
Nitesh
- Original Message - 
From: Arash Bijanzadeh [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org 
Sent: Thursday, June 23, 2005 2:47 PM
Subject: JAAS example


Hi all,
I am searching for an example of using struts security framework and JAAS
maybe. Could anyone lead me to a document/tutorial/example? 
Thanks
Arash B.





Re: JAAS example

2005-06-23 Thread Nitesh
And...

http://www.jroller.com/page/tomdz/20041215


Nitesh 

  Googling results...

  http://jakarta.apache.org/slide/howto-jaas.html
  
http://www.isys.uni-klu.ac.at/ISYS/Courses/04WS/webtechnologien/downloads/TomcatConfig.pdf



  Nitesh

  - Original Message - 
From: Arash Bijanzadeh 
To: Nitesh 
Sent: Thursday, June 23, 2005 3:14 PM
Subject: Re: JAAS example


I am familiar with JASS. My question is how struts using the JAAS for 
security, how shall I implement it and for the starting point how can I get a 
JAAS user in a Action working with the tomcat?


On 6/23/05, Nitesh [EMAIL PROTECTED] wrote: 
  http://java.sun.com/j2se/1.4.2/docs/guide/security/jaas/JAASRefGuide.html 
  and
  http://struts.apache.org/userGuide/preface.html#jaas

  could be a starting point...

  HTH
  Nitesh
  - Original Message - 
  From: Arash Bijanzadeh [EMAIL PROTECTED]
  To: Struts Users Mailing List user@struts.apache.org 
  Sent: Thursday, June 23, 2005 2:47 PM
  Subject: JAAS example


  Hi all,
  I am searching for an example of using struts security framework and JAAS
  maybe. Could anyone lead me to a document/tutorial/example? 
  Thanks
  Arash B.





Re: Accessing nested properties

2005-06-22 Thread Nitesh

Guess this is not standard way of doing it...
kinda wicked way... try this... might work

logic:iterate id=foos name=foo_array
  % pageContext.setAttribute(fooBar,foos.getBar()); %
  logic:greaterThan name=fooBar property=test value=1000
 //do something
  /logic:greaterThan
/logic:iterate

HTH
Nitesh


 Fredrik Bostrom wrote:

 Hi list,

 How do I access a nested property in an iterated object?

 I've got two classes like this (heavily simplified and stripped):

 class Foo {
   Bar bar = new Bar();
 }

 class Bar {
   int test = 10; //any value
 }

 In my jsp-page, I'm iterating an array of foo-objects and I want to
 access the test-field in the Bar-class from within the iteration. How
 do I do that?

 This is what I'd like to do:

 logic:iterate id=foos name=foo_array
   logic:greaterThan name=foos property=bar.test value=1000
  //do something
   /logic:greaterThan
 /logic:iterate

 But this doesn't work... Any ideas?


 Regards,
   Fredrik Boström



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


--
Fredrik Boström
+358 44 306 1324
[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: Accessing nested properties

2005-06-22 Thread Nitesh

Ok... got that now!. The standard struts way of doing this would be...

logic:iterate id=foos name=foo_array
  bean:define id=fooBar property=bar name=foos/
  logic:greaterThan name=fooBar property=test value=1000
 //do something
  /logic:greaterThan
/logic:iterate

(somehow that was not working in the example I tried to make sure before I 
send the solution. now it works!!!)


HTH
Nitesh

- Original Message - 
From: Nitesh [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 22, 2005 11:31 AM
Subject: Re: Accessing nested properties



Guess this is not standard way of doing it...
kinda wicked way... try this... might work

logic:iterate id=foos name=foo_array
  % pageContext.setAttribute(fooBar,foos.getBar()); %
  logic:greaterThan name=fooBar property=test value=1000
 //do something
  /logic:greaterThan
/logic:iterate

HTH
Nitesh


 Fredrik Bostrom wrote:

 Hi list,

 How do I access a nested property in an iterated object?

 I've got two classes like this (heavily simplified and stripped):

 class Foo {
   Bar bar = new Bar();
 }

 class Bar {
   int test = 10; //any value
 }

 In my jsp-page, I'm iterating an array of foo-objects and I want to
 access the test-field in the Bar-class from within the iteration. How
 do I do that?

 This is what I'd like to do:

 logic:iterate id=foos name=foo_array
   logic:greaterThan name=foos property=bar.test value=1000
  //do something
   /logic:greaterThan
 /logic:iterate

 But this doesn't work... Any ideas?


 Regards,
   Fredrik Boström



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


--
Fredrik Boström
+358 44 306 1324
[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]





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



Re: How to use multiple tiles definitions files for multi channel

2005-06-22 Thread Nitesh

Tageting multiple channels is definitely possible with Struts...
Tiles coudl aid you doing this.
But times is not the prime technology involved...

Your UI components need to be XML-based rather than JSP based for this.
You could use plug-ins to fomat your xmls for the channel intended.

There are some plug-ins avaiable for this already... I couldn't find much 
abt these...

I stumbled upon this on a search...
http://javatoolbox.com/Toolede6f9ab-1b07-400b-93ff-46dd85038a5f.aspx

HTH
Nitesh


- Original Message - 
From: Michael Mattox [EMAIL PROTECTED]

To: Laurie Harper [EMAIL PROTECTED]
Cc: user@struts.apache.org
Sent: Wednesday, June 22, 2005 4:28 PM
Subject: Re: How to use multiple tiles definitions files for multi channel



In the tiles documentation webapp, it's stated:

A mechanism similar to Java properties files is used for definitions
files : you can have one definition file per key. The appropriate
definition is loaded according to the key.

I'd like to use this to have different tiles for web  wap devices.  Can
someone explain how to do this?  I cannot find any information on how
this
works, I've searched everywhere.  I see how it's done for the language
based on the Locale, but not for a user defined key in the session.


Struts doesn't provide anything specifically for this. There's all sorts
of ways you could approach it; one possibility would be to map user
agent header strings to local variants and define separate resource
bundles for web vs. wap.


The text I quoted above was from the tiles documentation, which claims
Tiles *is* able to do this.  I just can't figure out how.  I'm now
wondering if this text is incorrect and tiles does not offer this.

The problem isn't related to resource bundles, the problem is I need
separate JSPs for web  wap.  I'd like to have a tiles-defs-web.xml
associated with a session key device value web and tiles-defs-wap.xml
associated with a session key device value wap.  Default would be
web.  Is this possible?  It seems like an easy thing to do.

-Michael



--
This E-mail is confidential.  It may also be legally privileged.  If you 
are
not the addressee you may not copy, forward, disclose or use any part of 
it.
If you have received this message in error, please delete it and all 
copies

from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error 
or
virus-free.  The sender does not accept liability for any errors or 
omissions.



-
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: validator and xdoclet

2005-06-22 Thread Nitesh

You could use
!DOCTYPE form-validation PUBLIC
 -//Apache Software Foundation//DTD Commons Validator Rules 
Configuration 1.1.3//EN

 http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd;

Better still you could get the latest struts jar from Jakarta struts and use 
the vlaidator-rule bundled with that...


HTH
Nitesh

- Original Message - 
From: roberto [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Wednesday, June 22, 2005 4:58 PM
Subject: validator and xdoclet



Hi people,
I'm an italian student and i have a problem with
struts validator.
I'm working in a universitary project based on
standard j2ee for a web applicaton. This project works
on jboss with struts, ejb, all handled with xdoclet.
The deployment is made by Ant.
I have a form written to works with the validator
framework. I followed the tutorial finded in old email
and the books programming with jakarta struts.

The problem is that this line
html:javascript formName=SignupForm/
throws an NullException.
Forward the jboss after the deployment throws
FileNotFoundException: \WEB-INF\validator_1_1.dtd
because the validator-rules.xml has this line:
!DOCTYPE form-validation PUBLIC
 -//Apache Software Foundation//DTD Commons
Validator Rules Configuration 1.0//EN
 /WEB-INF/validator_1_1.dtd

Why I have this exceptions?
If I was inexact I can explain it another time.

thanks,
Roberto









___
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it

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





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



Re: How to use multiple tiles definitions files for multi channel

2005-06-22 Thread Nitesh

This javaworld article might help

http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html

HTH
Nitesh
- Original Message - 
From: Nitesh [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org; 
[EMAIL PROTECTED]

Sent: Wednesday, June 22, 2005 4:39 PM
Subject: Re: How to use multiple tiles definitions files for multi channel



Tageting multiple channels is definitely possible with Struts...
Tiles coudl aid you doing this.
But times is not the prime technology involved...

Your UI components need to be XML-based rather than JSP based for this.
You could use plug-ins to fomat your xmls for the channel intended.

There are some plug-ins avaiable for this already... I couldn't find much 
abt these...

I stumbled upon this on a search...
http://javatoolbox.com/Toolede6f9ab-1b07-400b-93ff-46dd85038a5f.aspx

HTH
Nitesh


- Original Message - 
From: Michael Mattox [EMAIL PROTECTED]

To: Laurie Harper [EMAIL PROTECTED]
Cc: user@struts.apache.org
Sent: Wednesday, June 22, 2005 4:28 PM
Subject: Re: How to use multiple tiles definitions files for multi channel



In the tiles documentation webapp, it's stated:

A mechanism similar to Java properties files is used for definitions
files : you can have one definition file per key. The appropriate
definition is loaded according to the key.

I'd like to use this to have different tiles for web  wap devices. 
Can

someone explain how to do this?  I cannot find any information on how
this
works, I've searched everywhere.  I see how it's done for the language
based on the Locale, but not for a user defined key in the session.


Struts doesn't provide anything specifically for this. There's all sorts
of ways you could approach it; one possibility would be to map user
agent header strings to local variants and define separate resource
bundles for web vs. wap.


The text I quoted above was from the tiles documentation, which claims
Tiles *is* able to do this.  I just can't figure out how.  I'm now
wondering if this text is incorrect and tiles does not offer this.

The problem isn't related to resource bundles, the problem is I need
separate JSPs for web  wap.  I'd like to have a tiles-defs-web.xml
associated with a session key device value web and tiles-defs-wap.xml
associated with a session key device value wap.  Default would be
web.  Is this possible?  It seems like an easy thing to do.

-Michael



--
This E-mail is confidential.  It may also be legally privileged.  If you 
are
not the addressee you may not copy, forward, disclose or use any part of 
it.
If you have received this message in error, please delete it and all 
copies

from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error 
or
virus-free.  The sender does not accept liability for any errors or 
omissions.



-
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: validator and xdoclet

2005-06-22 Thread Nitesh
May be you could go to the URL get the required DTD and put the same in your 
WEB-INF


Nitesh

- Original Message - 
From: roberto [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 22, 2005 6:14 PM
Subject: Re: validator and xdoclet



Unfortunately this solution not resolve my problem. I
work with jboss in localhost therefore when I deploy
my appication the server respond wiht the exception
java.net.UnknownHostException: jakarta.apache.org
and the form not works.

thank's for fast reply.

Roberto


--- Nitesh [EMAIL PROTECTED] ha scritto:


You could use
!DOCTYPE form-validation PUBLIC
  -//Apache Software Foundation//DTD
Commons Validator Rules
Configuration 1.1.3//EN



http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd;


Better still you could get the latest struts jar
from Jakarta struts and use
the vlaidator-rule bundled with that...

HTH
Nitesh

- Original Message - 
From: roberto [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Wednesday, June 22, 2005 4:58 PM
Subject: validator and xdoclet


 Hi people,
 I'm an italian student and i have a problem with
 struts validator.
 I'm working in a universitary project based on
 standard j2ee for a web applicaton. This project
works
 on jboss with struts, ejb, all handled with
xdoclet.
 The deployment is made by Ant.
 I have a form written to works with the validator
 framework. I followed the tutorial finded in old
email
 and the books programming with jakarta struts.

 The problem is that this line
 html:javascript formName=SignupForm/
 throws an NullException.
 Forward the jboss after the deployment throws
 FileNotFoundException:
\WEB-INF\validator_1_1.dtd
 because the validator-rules.xml has this line:
 !DOCTYPE form-validation PUBLIC
  -//Apache Software Foundation//DTD
Commons
 Validator Rules Configuration 1.0//EN
  /WEB-INF/validator_1_1.dtd

 Why I have this exceptions?
 If I was inexact I can explain it another time.

 thanks,
 Roberto









 ___
 Yahoo! Mail: gratis 1GB per i messaggi e allegati
da 10MB
 http://mail.yahoo.it




-

 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]










___
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it

-
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: Setting value at runtime in logic:equal

2005-06-22 Thread Nitesh

You are probably looking for...
logic:equal name=orderObj property=statusCode  value=%= 
OrderObj.getWhatever() %


Nitesh

- Original Message - 
From: Brad Rhoads [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 22, 2005 7:25 PM
Subject: Re: Setting value at runtime in logic:equal



Nitesh wrote:

You could use logic:equal name=orderObj property=statusCode 
value=%= val %

where you can set val depending on any conditions, input at runtime!


That's exactly what I *want* to do. orderObj is a collection that I'm 
iterating through. How do I get val to come from the current iteration?




HTH

Nitesh


- Original Message - From: Brad Rhoads [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, June 21, 2005 11:08 PM
Subject: Setting value at runtime in logic:equal




How do I test statusCode for some other property in my orderObj, instead 
of hard coding On Hold as I'm doing now?


logic:iterate id='orderObj' collection='%= 
request.getAttribute(orders)  %'

   tr class=lstLine1
   td
   logic:equal name=orderObj property=statusCode 
value=On Hold
   html:multibox property='selectedOrders' 
disabled=false
   bean:write name=orderObj property=orderID 
filter=true/-bean:write name=orderObj property=shipID 
filter=true/

   /html:multibox
/logic:equal
   /td
   /tr
   /logic:iterate

Thanks for the help.

-
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: Indexed Values

2005-06-22 Thread Nitesh
indexed properties are probably used when you have a no of rows of the same 
set of properties. For eg. it would be like a collection of objects with one 
or more membersin each row.

Eg: in case you have the object in the form bean
logic:iterate id=users name=UserListAdmin property=users
   html:text property=userName indexed=true name=users /
...
or
logic:iterate id=users name=userObjCol type=com.whatever.User
   html:text property=userName indexed=true name=users /
...

HTH
Nitesh

- Original Message - 
From: Ciaran Hanley [EMAIL PROTECTED]

To: 'Struts User Mailing List' struts-user@jakarta.apache.org
Sent: Wednesday, June 22, 2005 9:54 PM
Subject: Indexed Values



Can somebody please explain why properties of a bean appear on a JSP like
this when the indexed=true property is set

org.apache.struts.taglib.html.BEAN[0].propertyName
org.apache.struts.taglib.html.BEAN[1].propertyName
org.apache.struts.taglib.html.BEAN[2].propertyName

instead of propertyName[0], propertyName[1] as I would expect.

Thanks







-
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: regarding javascript problem

2005-06-22 Thread Nitesh

You could use the onsubmit of the form tag as well...

html:form name=delForm action=/DeleteForm onsubmit=return delete()


---
html:submit value=Delete/ 
/html:form



HTH
Nitesh
- Original Message - 
From: Khan [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Thursday, June 23, 2005 10:30 AM
Subject: regarding javascript problem


Hi,
 I have problem in submiting my form through javascript by onclick event, 
it say that this property cant be supported. The form gets submitted by 
html:submit button, no prob. Any idea how to proceed but through 
javascript only.

My code:
script language=javascript
function delete(){
if(condition){
checking some validations
} 
document.delForm.submit(); // from here i want to submit the form

}
/script
html:form name=delForm action=/DeleteForm


---
html:button value=Delete onclick=Javascript:delete();
!-- html:submit value=Delete/ --
/html:form
Thanks in advance
Regards
Khan
user@struts.apache.org


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



Re: Setting value at runtime in logic:equal

2005-06-21 Thread Nitesh
You could use logic:equal name=orderObj property=statusCode  value=%= 
val %

where you can set val depending on any conditions, input at runtime!

HTH

Nitesh


- Original Message - 
From: Brad Rhoads [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, June 21, 2005 11:08 PM
Subject: Setting value at runtime in logic:equal




How do I test statusCode for some other property in my orderObj, instead 
of hard coding On Hold as I'm doing now?


logic:iterate id='orderObj' collection='%= 
request.getAttribute(orders)  %'

   tr class=lstLine1
   td
   logic:equal name=orderObj property=statusCode 
value=On Hold
   html:multibox property='selectedOrders' 
disabled=false
   bean:write name=orderObj property=orderID 
filter=true/-bean:write name=orderObj property=shipID 
filter=true/

   /html:multibox
/logic:equal
   /td
   /tr
   /logic:iterate

Thanks for the help.

-
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: long struts-config.xml file

2005-06-17 Thread Nitesh
You could also think about using multiple struts-config files... say one for 
each module and use them (in the web.xml for action param-value give the 
comma separated config file list.)


Nitesh

- Original Message - 
From: John Henry Xu [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Friday, June 17, 2005 9:34 AM
Subject: long struts-config.xml file


Hi all,

In a project I am working on, we have a very lengthy struts-config.xml
file to handle complex actions jsps (200+) take.

Does anyone have this situation (very complex struts-config.xml)? Please
tell me about your experience.

Also, anyone see a blog or forum written by struts technology? If you
know, can you tell me the link?

Thanks.

Jack H. Xu
Technology columnist and 
authorhttp://www.usanalyst.comhttp://www.getusjobs.com


--
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



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



Re: another newbie

2005-06-17 Thread Nitesh
Looks like you have an action in the html:form in submit.jsp which is not 
there in the struts-config action mappings (checkout the case of the actions 
as well)


Nitesh
- Original Message - 
From: Amin Mohd Sani [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 17, 2005 11:59 AM
Subject: RE: another newbie


Anyone using eclipse and jboss with struts?

I'm getting this error as below :

12:30:48,329 ERROR [Engine] StandardWrapperValve[jsp]: Servlet.service()
for ser
vlet jsp threw exception
javax.servlet.jsp.JspException: Cannot retrieve mapping for action
/submit
   at
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:753)
   at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
   at
org.apache.jsp.submit_jsp._jspx_meth_html_form_0(submit_jsp.java:140)

it looks like I'm missing something on the eclipse side.


TIA,

Amin

-
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: long struts-config.xml file

2005-06-17 Thread Nitesh

There may not be a performance issue...
probably could have some effect in startup (not sure if there are any 
though!) .


Mainly this would be done to make your config files more 'readable'
Also it makes sense to group the related ones together depending on 
functionality/module or whatever parameters that could separate/group 
actions/jsps/etc together.


Nitesh

- Original Message - 
From: Yuniar Setiawan [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 17, 2005 11:55 AM
Subject: Re: long struts-config.xml file


Is there any performance issue when you have very long struts-config.xml?
I'm having about 200+ action either but so far everything is running well,
or perhaps not yet?

On 6/17/05, Nitesh [EMAIL PROTECTED] wrote:


You could also think about using multiple struts-config files... say one
for
each module and use them (in the web.xml for action param-value give the
comma separated config file list.)

Nitesh

- Original Message -
From: John Henry Xu [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Friday, June 17, 2005 9:34 AM
Subject: long struts-config.xml file


Hi all,

In a project I am working on, we have a very lengthy struts-config.xml
file to handle complex actions jsps (200+) take.

Does anyone have this situation (very complex struts-config.xml)? Please
tell me about your experience.

Also, anyone see a blog or forum written by struts technology? If you
know, can you tell me the link?

Thanks.

Jack H. Xu
Technology columnist and
authorhttp://www.usanalyst.comhttp://www.getusjobs.com

--
___
Sign-up for Ads Free at Mail.com http://Mail.com
http://promo.mail.com/adsfreejump.htm



-
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: [OT] Convert Java Object into XML. Is there a simple tool in Jakarta projects or elsewere

2005-06-17 Thread Nitesh
You could probably try using JAXB... That API is given by sun for Java for 
XML binding... gives you option to create java objects from an XML schema so 
that converting xml to java and vice-versa can be done without much work! 
Take a look at


http://java.sun.com/xml/jaxb/

Nitesh
- Original Message - 
From: David Gagnon [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 17, 2005 6:43 PM
Subject: [OT] Convert Java Object into XML. Is there a simple tool in 
Jakarta projects or elsewere




Hi all,

 Sorry for this OT.  I'm looking for a way to output an object into XML 
for debugging purpose.
I'm pretty sure I can do it myself with beanUtils and xml-api ..but I hate 
reinventing the whell and pretty sure there is a simple tool somewhere.


Thanks for your help!

Have a nice week-end
/David

-
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: Howto display errors when using Struts Validator

2005-06-17 Thread Nitesh

1. Displaying errors on the JSP page is not differnt from the normal action
form validation. You could add html:errors / whereever you need to display
the error. In addition you could add a html:javascript
formName=YourFormName / in your JSP along with  adding onsubmit=return
validateYourFormName(this) in the html:form would give you an additional
client side JavaScript validation automatically plugged in.

2. You could have the reset method in the formbean as normal. I din't see
any reason why you couldn't.

3. Well.. in struts all the error and success actions are forwards and a JSP
forward does the forward without coming back to the client browser. Hence
url will remain the same... Does that really matter... you would look at the
page rather than what is there in the URL!

HTH
Nitesh
- Original Message - 
From: Thai Dang Vu [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Saturday, June 18, 2005 2:08 AM
Subject: Howto display errors when using Struts Validator


Hello,

I don't know how to display errors in the jsp input page when using Struts
Validator. This is my case:

- validation.xml
...
   formset
 form name=getNameForm
   field property=name depends=required
 arg0 key=Name resource=false/
   /field
   field property=phone depends=required, mask
 msg key=Phone number name=mask resource=false/
 arg0 key=A phone number resource=false/
 var
   var-namemask/var-name
   var-value^(\d{3}-\d{3}-\d{4})|(\(\d{3}\)
?\d{3}-\d{4})$/var-value
 /var
   /field
 /form
   /formset
...

- struts-config.xml
...
form-beans
 form-bean name=getNameForm type=GetNameForm/
/form-beans
action-mappings
 action input=/inputname.jsp name=getNameForm path=/greeting
  scope=request type=GreetingAction validate=true
  forward name=greeting path=/greeting.jsp/
 /action
/action-mappings
message-resources parameter=MyMessageResources/
plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property property=pathnames value=/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml/
/plug-in
...

- validator-rules.xml isn't changed.

- GetNameForm.java
public class GetNameForm extends ValidatorForm {
private String name;
private String phone;
... getter, setter methods

My questions are:

1. How can I dislay the errors in the input jsp file when the name and phone
values don't meet the requirement?

2. Can I have the reset method in the Form Bean? If I can't, how can I reset
those values?

3.  When I run it with the invalid values for name or phone, Struts forwards
me to the jsp input page but the address in the address bar is greeting.do.
How can I make it inputname.jsp?

Sincerely,

Thai


-
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: another newbie

2005-06-16 Thread Nitesh

Map the action class in the struts config and have the link point to the
action
i.e. a href=/MyAction.do...

Nitesh
- Original Message - 
From: Anand Vijay [EMAIL PROTECTED]

To: Nitesh [EMAIL PROTECTED]
Sent: Thursday, June 16, 2005 10:34 AM
Subject: Re: another newbie



Hi

Thanks for the help ...

How to invoke an action class if it is a link ?


Nitesh said the following on 16/06/2005 10:33 AM:


You could populate the combo independently using a logic:iterate tag in
the
JSP
Use a bean/helper to get the values as a collection and pass the same to
the
iterator.

alternate method is to have an action class before the control comes to
the
JSP where in you could get the collection. (Here also you need to use the
logic:iterate tag in the JSP)

HTH

Regards

Nitesh

- Original Message - From: Anand Vijay [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Wednesday, June 15, 2005 4:00 PM
Subject: another newbie



Hi All

I have a link in my application for user registration form . Form has
combo box that needs to be populated from database. How to achieve this?
Where do we write our bean to fetch the data?

Thanks in advance

Regards
Vijay

-
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: Pass parameter to javascript function

2005-06-16 Thread Nitesh

Hope you are getting the values (see the source on your page and find out)
The reason JavaScript doesn't work is that the value of idProveedor is a 
string which is not declared. So it should work if you give the same within 
quotes.

Try...
html:radio idName=lista
onclick=setBusquedaProveedor('${idProveedor}','${strRazonSocial}')
property=idProveedor value=idProveedor /
or
html:radio idName=lista
onclick=setBusquedaProveedor(\${idProveedor}\,\${strRazonSocial}\)
property=idProveedor value=idProveedor /

HTH
Nitesh


- Original Message - 
From: Rafael Taboada [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 16, 2005 11:55 AM
Subject: Re: Pass parameter to javascript function


I tried with all the suggestions but it doesn't work:
Does anybody know the problem?
My code is:
logic:iterate id=lista name=busquedaproveedorForm
property=lstResultado
html:radio idName=lista
onclick=setBusquedaProveedor(${idProveedor},${strRazonSocial})
property=idProveedor value=idProveedor /
/logic:iterate
I try to pass idProveedor and strRazonSocial to a javascript function...
But it doesn't work. I tried with lista.idProveedor but nothing...
Do u know the correct declaration???
Thanks

--
Rafael Taboada
Software Engineer

Cell : +511-97753290

No creo en el destino pues no me gusta tener la idea de controlar mi vida


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



Re: Pass parameter to javascript function

2005-06-16 Thread Nitesh
Did you try using the expression tags... that may work. (you may need to 
change the methods to the right ones...)


html:radio idName='lista'
onclick='setBusquedaProveedor(%= lista.getIdProveedor() %,%= 
lista.getStrRazonSocial() %)'

property='idProveedor' value='idProveedor' /

The bean:write would not work in html:radio since the tag doesn't 
allow/recognize nested tags.


Nitesh


- Original Message - 
From: Rafael Taboada [EMAIL PROTECTED]

Cc: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 16, 2005 8:35 PM
Subject: Re: Pass parameter to javascript function


Thank u very much for all ur help...
 Zarar: the same thing, it takes as String value
In my code:
html:radio idName='lista'
onclick='setBusquedaProveedor(${idProveedor},${strRazonSocial})'
property='idProveedor' value='idProveedor' /
In the source code(runtime):
input type=radio name=idProveedor value=1
onclick=setBusquedaProveedor(${idProveedor},${strRazonSocial})


--
Rafael Taboada
Software Engineer

Cell : +511-97753290

No creo en el destino pues no me gusta tener la idea de controlar mi vida


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



Re: another newbie

2005-06-15 Thread Nitesh

You could populate the combo independently using a logic:iterate tag in the
JSP
Use a bean/helper to get the values as a collection and pass the same to the
iterator.

alternate method is to have an action class before the control comes to the
JSP where in you could get the collection. (Here also you need to use the
logic:iterate tag in the JSP)

HTH

Regards

Nitesh

- Original Message - 
From: Anand Vijay [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Wednesday, June 15, 2005 4:00 PM
Subject: another newbie



Hi All

I have a link in my application for user registration form . Form has 
combo box that needs to be populated from database. How to achieve this? 
Where do we write our bean to fetch the data?


Thanks in advance

Regards
Vijay

-
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: [OT] Validating email addresses

2005-06-15 Thread Nitesh

Richard,

JavaScript validations are majorly done on client side and so it would be 
possible to do a actual validation of the email addresses. The JavaScript 
email validations mostly will check
whether the email is in a valid format. (i.e. even [EMAIL PROTECTED] would pass a 
validation)


If you have to do a whois validation the best would be to use the struts 
validator framework. This gives you a two-pronged validation - both client 
side as well as server side. The clientside Javascript validation ill check 
if the email is of valid format. You could probably override the server side 
validation to actually plug-in the code to validate with whois.


The other option would be to have a hidden frame, while validating the email 
address, use the hidden frame to redirect to a JSP or servlet which 
validates the email with whois and prompt the user accordingly.


HTH

Regards,
Nitesh


- Original Message - 
From: Richard Reyes [EMAIL PROTECTED]

To: Martin Gainty [EMAIL PROTECTED]
Cc: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 16, 2005 9:21 AM
Subject: Re: [OT] Validating email addresses


Unfortunately guys all will be done on javascript. Any suggestion on
proven downloadble javascript components would be very much
appreciated. I might just code for the domain name validations.

Can I get the valid list from whois.org?

Thanks All
Richard

On 6/15/05, Martin Gainty [EMAIL PROTECTED] wrote:

Richard-
Can you run basic DNS nslookup utilities and or have access to
BIND a.root-servers.net - m.root-servers.net?
-OR-

You may want to use a combination of parsing the URL such as
http://java.sun.com/docs/books/tutorial/networking/urls/urlInfo.html

import java.net.*;
import java.io.*;

public class ParseURL {
   public static void main(String[] args) throws Exception {
   URL aURL = new URL(http://java.sun.com:80/docs/books/;
  + tutorial/index.html#DOWNLOADING);
   System.out.println(protocol =  + aURL.getProtocol());
   System.out.println(host =  + aURL.getHost());
   System.out.println(filename =  + aURL.getFile());
   System.out.println(port =  + aURL.getPort());
   System.out.println(ref =  + aURL.getRef());
   }
}

and then attempting to access the URL
http://java.sun.com/docs/books/tutorial/networking/urls/connecting.html
try {
   URL yahoo = new URL(http://www.yahoo.com/;);
   URLConnection yahooConnection = yahoo.openConnection();

} catch (MalformedURLException e) { // new URL() failed
   . . .
} catch (IOException e) {   // openConnection() failed
   . . .
}

Martin-
- Original Message -
From: Richard Reyes [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 15, 2005 6:02 AM
Subject: [OT] Validating email addresses


Hi Guys,

I plan to validate email addresses and Domain names entered by users
via those downloadable
javascripts. Any suggestions?

Also if I am to validate these fields do I need to know the valid .com
or .net domains?

Please advise
TIA!

Richard

-
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: problem with indexed property and logic:iterate

2005-06-14 Thread Nitesh

Just passing you a solution I had got from the user list earlier

Nitesh

- Original Message - 
From: John Fitzpatrick [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 03, 2005 6:06 PM
Subject: Re: Problem using indexed properties and validator framework



In the struts-config.xml:

   form-bean name=ManageAccountsForm type=application.EditUsersForm
   form-property name=users type=application.UserBean[]
   /form-bean


   action-mappings
   action
 path=/application/EditUsers
 type=application.EditUsersAction
 name=EditUsersForm
 scope=session
   
 forward
   name=success
   path=editUsers.jsp
   redirect=false
 /
   action-mappings


In EditUsersAction.java execute method

   // get collection of users from the database
   Collection users = getUserBeans ();

   // put collection into form as an array for editing
   form.set ( users, users.toArray ( new UserBean[0] ) );

In editUsers.jsp

   logic:iterate id=users name=EditUsersForm property=users
   html:text name=users property=name indexed=true
   /logic:iterate

In the produced HTML:

   input type=text name=users[0].name /

If you need to client side validation, you'll probably need to write your
own JSP to deal with the element above.

As for using validate.xml to validate on the server side. I've never tried
it with arrays, I just iterate over them in the validate (...) method of 
the

form, like so:

   UserBean users[] = (UserBean[]) form.get ( users );
   for ( int i = 0; i  users.length; i++ ) {
   // check on the attributes of UserBean users[i]
   }

Hope that example clears it up for you.

John



On 20050603 5:05 AM, Nitesh [EMAIL PROTECTED] wrote:


Thanks for the answer John...

Could you give me an example as to how we pre populate the array?

Regards,
Nitesh
- Original Message -
From: John Fitzpatrick [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 02, 2005 6:00 PM
Subject: Re: Problem using indexed properties and validator framework




For an Array in a DynaForm property, you can either set the size in the
form-property descriptor or, in the case of a session form, pre-populate
the
Array in your action with the number of elements you desire.





-
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: Prob with html:select id -- Plz help me OUT

2005-06-09 Thread Nitesh

Jeevan,

Any specific reason as to why you have to have the id attribute?

Nitesh
- Original Message - 
From: Kade Jeevan Kumar [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 09, 2005 6:13 PM
Subject: RE: Prob with html:select id -- Plz help me OUT




Hi Nitin!

I am using Struts 1.1




Nitin Mandolkar [EMAIL PROTECTED] wrote:
Hello can I know which struts you are using.

Then and then only I can ans you.

-ni3.


-Original Message-
From: Kade Jeevan Kumar [mailto:[EMAIL PROTECTED]
Sent: 09 June 2005 13:28
To: user@struts.apache.org
Subject: Prob with -- Plz help me OUT

Hi!

i have an html code

i need to convert the above code using struts library. but the problemhere 
is,struts-tld cann't take id attribute. i strictly need to use id. 
Give me the solution for this ASAP. -Thanks in 
AdvanceJeevan -Discover Yahoo! Get 
on-the-go sports scores, stock quotes, news  more. Check it 
out!-To 
unsubscribe, e-mail: [EMAIL PROTECTED] additional 
commands, e-mail: [EMAIL PROTECTED]


-
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news  more. Check it out! 



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



Re: select box with lot of options. Need help.

2005-06-06 Thread Nitesh

Looks like a Javascript problem...
try this script... hope it helps.

 function addMapping(objSourceElement, objTargetElement)
 {

   if (objSourceElement.selectedIndex == -1)
   {
alert(Please select the tasks from the Available Tasks);
return;
   }

var objectsToRemove = new Array();
for(i=0;iobjSourceElement.options.length;i++)
{
 if(objSourceElement.options[i].selected)
 {
  objTargetElement.options.length +=1;
  objTargetElement.options[objTargetElement.options.length-1].text = 
objSourceElement.options[i].text;
  objTargetElement.options[objTargetElement.options.length-1].value = 
objSourceElement.options[i].value;

  objectsToRemove[objectsToRemove.length] = objSourceElement.options[i];
 }
}
for(k=0;kobjectsToRemove.length;k++)
{
 objSourceElement.removeChild(objectsToRemove[k]);
}

 }

regards,
Nitesh
- Original Message - 
From: senthil Kumar [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Monday, June 06, 2005 11:06 AM
Subject: select box with lot of options. Need help.



Hi all.,


I have a select box with lot of options. I want to add a selected 
options with another select box once click a add button.


Now i can add one by one.But  once i selected more than one options, still 
it is adding one, remaining all are deleted.



I want add to another select box once selected more than one options also.

Any can help me.

Here i am putting my JavaScript code.

Thanks in advance.
Regs.
senthil

html:button property=next styleClass=buttonwidthlarge value=gt;gt 
onclick=addMapping(this.form.taskList, this.form.mappingTask); 
tabindex=12/br/






// This function gets called when ADD button clicked
 function addMapping(objSourceElement, objTargetElement)
 {

   if (objSourceElement.selectedIndex == -1)
   {
alert(Please select the tasks from the Available Tasks);
return;
   }

   var aryTempSourceOptions = new Array();
   var x = 0;
   var intTargetLen = objTargetElement.length++;

   //populate the mapping name list box with CSV file column and the 
sample field column
   objTargetElement.options[intTargetLen].text = 
objSourceElement.options[objSourceElement.selectedIndex].text;
   objTargetElement.options[intTargetLen].value = 
objSourceElement.options[objSourceElement.selectedIndex].value;



   //This is to recreate the fileheaders list box
   for (var i = 0; i  objSourceElement.length; i++) {
if (!objSourceElement.options[i].selected) {
 var objTempValues = new Object();
 objTempValues.text = objSourceElement.options[i].text;
 objTempValues.value = objSourceElement.options[i].value; 
aryTempSourceOptions[x] = objTempValues;

 x++;
}
   }
   objSourceElement.length = aryTempSourceOptions.length;
   for (var i = 0; i  aryTempSourceOptions.length; i++) {
 objSourceElement.options[i].text = aryTempSourceOptions[i].text; 
objSourceElement.options[i].value = aryTempSourceOptions[i].value;

   }
   x = 0;
   aryTempSourceOptions = new Array();
   objSourceElement.selectedIndex = -1;
 }

This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged 
information. If you are not the intended recipient or received it in 
error, please contact the sender by reply e-mail and destroy all copies of 
the original message. Please do not copy it for any purpose or disclose 
its contents.


Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved 



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



Re: Problem using indexed properties and validator framework (fixed)

2005-06-05 Thread Nitesh

Thanks for all the help John.
I could work it out tweaking on your solution.

Regards,
Nitesh

- Original Message - 
From: John Fitzpatrick [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 03, 2005 6:06 PM
Subject: Re: Problem using indexed properties and validator framework



In the struts-config.xml:

   form-bean name=ManageAccountsForm type=application.EditUsersForm
   form-property name=users type=application.UserBean[]
   /form-bean


   action-mappings
   action
 path=/application/EditUsers
 type=application.EditUsersAction
 name=EditUsersForm
 scope=session
   
 forward
   name=success
   path=editUsers.jsp
   redirect=false
 /
   action-mappings


In EditUsersAction.java execute method

   // get collection of users from the database
   Collection users = getUserBeans ();

   // put collection into form as an array for editing
   form.set ( users, users.toArray ( new UserBean[0] ) );

In editUsers.jsp

   logic:iterate id=users name=EditUsersForm property=users
   html:text name=users property=name indexed=true
   /logic:iterate

In the produced HTML:

   input type=text name=users[0].name /

If you need to client side validation, you'll probably need to write your
own JSP to deal with the element above.

As for using validate.xml to validate on the server side. I've never tried
it with arrays, I just iterate over them in the validate (...) method of 
the

form, like so:

   UserBean users[] = (UserBean[]) form.get ( users );
   for ( int i = 0; i  users.length; i++ ) {
   // check on the attributes of UserBean users[i]
   }

Hope that example clears it up for you.

John



On 20050603 5:05 AM, Nitesh [EMAIL PROTECTED] wrote:


Thanks for the answer John...

Could you give me an example as to how we pre populate the array?

Regards,
Nitesh
- Original Message -
From: John Fitzpatrick [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 02, 2005 6:00 PM
Subject: Re: Problem using indexed properties and validator framework




For an Array in a DynaForm property, you can either set the size in the
form-property descriptor or, in the case of a session form, pre-populate
the
Array in your action with the number of elements you desire.





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



Problem using validator framework

2005-06-03 Thread Nitesh
I'm trying to use the validator framework. for client and server side 
validations. I'm using Struts 1.1.

I have in my struts-config.xml

 form-beans
  form-bean name=UserListAdmin dynamic=true 
type=com.sample.forms.SampleDynaForm
   form-property name=test type=java.lang.String /
  /form-bean
 /form-beans
 action path=/ModifyUserList type=com.sample.actions.UserListAdminAction 
name=UserListAdmin scope=session
  forward name=failure path=/UserAdmin.jsp/
  forward name=success path=/UserList.jsp /
 /action
 plug-in className=org.apache.struts.validator.ValidatorPlugIn
  set-property property=pathnames 
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/
 /plug-in

a form which look like...

 public class SampleDynaForm extends DynaValidatorForm
{

 /**
 * Constructor
 */
 public SampleDynaForm()
 {
  super();
  System.out.println(initiated a SampleDynaForm);
 }
 public void reset(ActionMapping mapping, HttpServletRequest request)
 {
  // Reset values are provided as samples only. Change as appropriate.
  System.out.println(reset in SampleDynaForm);
 }
 public ActionErrors validate(
  ActionMapping mapping,
  HttpServletRequest request)
 {
  ActionErrors errors = super.validate(mapping, request);
  System.out.println(errors after validation:+errors.size());
  if(errors == null)
  {
   errors = new ActionErrors();
  }
  System.out.println(errors returned:+errors.size());
  return errors;
 }
}


an action class execute method which...

 public ActionForward execute(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws Exception {

  ActionErrors errors = new ActionErrors();
  ActionForward forward = new ActionForward();
  DynaActionForm theForm = (DynaActionForm) form;
  // return value

  try {
   String testInput = (String)theForm.get(test);
   System.out.println(testInput:+testInput);
  } catch (Exception e) {
   // Report the error using the appropriate name and ID.
   System.out.println(Exception:\n+e.toString());
   errors.add(action.error, new ActionError(e.toString()));
  }

  // If a message is required, save the specified key(s)
  // into the request for use by the struts:errors tag.
  for(Iterator iter=errors.get();iter.hasNext();)
  {
   System.out.println(errors:\n+iter.next());
  }
  if(errors.isEmpty())
   forward = mapping.findForward(success);
  else
  {
   saveErrors(request, errors);
   forward = mapping.findForward(failure);
  }


  // Finish with
  return (forward);

 }


validation.xml

formset
  form name=userListAdmin
   field property=test depends=required
arg0 key=label.test/arg0
   /field
  /form
 /formset

JSP page

 html:form action=/ModifyUserList method=post onsubmit=return 
validateUserListAdmin(this)
html:errors/
table cellpadding=2 cellspacing=2 border=0
 tr tdhtml:text property=test //td /tr
 tr tdhtml:submit property=bSubmit //td
 /tr
/tbody/table

I've copied the validation-rules.xml from the one available with the 
jakarta-struts-1.1.zip downloaded.

The problem is that it doesn't seem to be validating on server side at all!!! I 
modified the validation-rule.xml javascript to return true always in the 
javascript method so that it gives a prompt and still goes on to submit the 
form. But once the form is submitted, looks like the validator framework 
doesn't do anything!!!

Am I doing something wrong here!!! 


Thanks in advance for any help

Nitesh

Re: Problem using validator framework

2005-06-03 Thread Nitesh

How much careless one can be!!!

The problem was with the form name in validation.xml (userListAdmin instead 
of UserListAdmin)


:)

- Original Message - 
From: Nitesh [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 03, 2005 12:40 PM
Subject: Problem using validator framework


I'm trying to use the validator framework. for client and server side 
validations. I'm using Struts 1.1.


I have in my struts-config.xml

form-beans
 form-bean name=UserListAdmin dynamic=true 
type=com.sample.forms.SampleDynaForm

  form-property name=test type=java.lang.String /
 /form-bean
/form-beans
action path=/ModifyUserList 
type=com.sample.actions.UserListAdminAction name=UserListAdmin 
scope=session

 forward name=failure path=/UserAdmin.jsp/
 forward name=success path=/UserList.jsp /
/action
plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property property=pathnames 
value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/

/plug-in

a form which look like...

public class SampleDynaForm extends DynaValidatorForm
{

/**
* Constructor
*/
public SampleDynaForm()
{
 super();
 System.out.println(initiated a SampleDynaForm);
}
public void reset(ActionMapping mapping, HttpServletRequest request)
{
 // Reset values are provided as samples only. Change as appropriate.
 System.out.println(reset in SampleDynaForm);
}
public ActionErrors validate(
 ActionMapping mapping,
 HttpServletRequest request)
{
 ActionErrors errors = super.validate(mapping, request);
 System.out.println(errors after validation:+errors.size());
 if(errors == null)
 {
  errors = new ActionErrors();
 }
 System.out.println(errors returned:+errors.size());
 return errors;
}
}


an action class execute method which...

public ActionForward execute(
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
 throws Exception {

 ActionErrors errors = new ActionErrors();
 ActionForward forward = new ActionForward();
 DynaActionForm theForm = (DynaActionForm) form;
 // return value

 try {
  String testInput = (String)theForm.get(test);
  System.out.println(testInput:+testInput);
 } catch (Exception e) {
  // Report the error using the appropriate name and ID.
  System.out.println(Exception:\n+e.toString());
  errors.add(action.error, new ActionError(e.toString()));
 }

 // If a message is required, save the specified key(s)
 // into the request for use by the struts:errors tag.
 for(Iterator iter=errors.get();iter.hasNext();)
 {
  System.out.println(errors:\n+iter.next());
 }
 if(errors.isEmpty())
  forward = mapping.findForward(success);
 else
 {
  saveErrors(request, errors);
  forward = mapping.findForward(failure);
 }


 // Finish with
 return (forward);

}


validation.xml

formset
 form name=userListAdmin
  field property=test depends=required
   arg0 key=label.test/arg0
  /field
 /form
/formset

JSP page

html:form action=/ModifyUserList method=post onsubmit=return 
validateUserListAdmin(this)

html:errors/
table cellpadding=2 cellspacing=2 border=0
tr tdhtml:text property=test //td /tr
tr tdhtml:submit property=bSubmit //td
/tr
/tbody/table

I've copied the validation-rules.xml from the one available with the 
jakarta-struts-1.1.zip downloaded.


The problem is that it doesn't seem to be validating on server side at 
all!!! I modified the validation-rule.xml javascript to return true always 
in the javascript method so that it gives a prompt and still goes on to 
submit the form. But once the form is submitted, looks like the validator 
framework doesn't do anything!!!


Am I doing something wrong here!!!


Thanks in advance for any help

Nitesh 



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



Re: Problem using indexed properties and validator framework

2005-06-03 Thread Nitesh

Thanks for the answer John...

Could you give me an example as to how we pre populate the array?

Regards,
Nitesh
- Original Message - 
From: John Fitzpatrick [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 02, 2005 6:00 PM
Subject: Re: Problem using indexed properties and validator framework




For an Array in a DynaForm property, you can either set the size in the
form-property descriptor or, in the case of a session form, pre-populate 
the

Array in your action with the number of elements you desire.





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



Problem using indexed properties and validator framework

2005-06-02 Thread Nitesh
Hi,

I'm trying to use the validator framework with dyna forms.

In the JSP page I have a list of user details being listed for edit.

 logic:iterate name=userList id=userList collection=%= userListCol % 
type=com.sample.vo.UserDetails
 tr
  tdhtml:text property=userName indexed=true name=userList //td
  tdhtml:text property=userAddress indexed=true name=userList //td
  tdhtml:text property=userCountry indexed=true name=userList //td
  tdhtml:text property=userZipCode indexed=true name=userList //td
  tdhtml:text property=userEmail indexed=true name=userList //td
  tdhtml:text property=userPhone indexed=true name=userList //td
 /tr
 /logic:iterate

I want this part to be validated on submit, and I intend to use validator 
framework with dynaforms.
My Struts config looks like...

  form-bean name=UserListAdmin 
type=org.apache.struts.action.DynaActionForm
   form-property name=userList type=com.sample.vo.UserDetails[] size=3 /
   form-property name=test type=java.lang.String /
  /form-bean



and my validation.xml looks like

  form name=userListAdmin
   field property=test depends=required
arg0 key=label.test/arg0
   /field
   field property=userList depends=required indexedListProperty=userName
arg0 key=label.username/arg0
   /field
   field property=userList depends=required 
indexedListProperty=userAddress
arg0 key=label.address/arg0
   /field

 /form


The problems I face are:
1. When I try to use ArrayList instead of UserDetails[] for flexibility since I 
cannot predict the no of users in the list, I get ArrayIndexOutOfBounds 
exception.
2. The client side validation defined in the validation-rules is not generated 
for the indexed property. (Same page I have a non-indexed property and the 
client side validation is generated for this!)
3. By using UserDetails[], I do get the list in the Action class, but 
validation is not happening! (again problem only for the indexed property. 
works fine for the normal one.

Any help to resolve this would be great!


Thanks in Advance

Nitesh N

Problem using indexed properties and validator framework

2005-06-02 Thread Nitesh
Hi,

I'm trying to use the validator framework with dyna forms.

In the JSP page I have a list of user details being listed for edit.

 logic:iterate name=userList id=userList collection=%= userListCol % 
type=com.sample.vo.UserDetails
 tr
  tdhtml:text property=userName indexed=true name=userList //td
  tdhtml:text property=userAddress indexed=true name=userList //td
  tdhtml:text property=userCountry indexed=true name=userList //td
  tdhtml:text property=userZipCode indexed=true name=userList //td
  tdhtml:text property=userEmail indexed=true name=userList //td
  tdhtml:text property=userPhone indexed=true name=userList //td
 /tr
 /logic:iterate

I want this part to be validated on submit, and I intend to use validator 
framework with dynaforms.
My Struts config looks like...

  form-bean name=UserListAdmin 
type=org.apache.struts.action.DynaActionForm
   form-property name=userList type=com.sample.vo.UserDetails[] size=3 /
   form-property name=test type=java.lang.String /
  /form-bean



and my validation.xml looks like

  form name=userListAdmin
   field property=test depends=required
arg0 key=label.test/arg0
   /field
   field property=userList depends=required indexedListProperty=userName
arg0 key=label.username/arg0
   /field
   field property=userList depends=required 
indexedListProperty=userAddress
arg0 key=label.address/arg0
   /field

 /form


The problems I face are:
1. When I try to use ArrayList instead of UserDetails[] for flexibility since I 
cannot predict the no of users in the list, I get ArrayIndexOutOfBounds 
exception.
2. The client side validation defined in the validation-rules is not generated 
for the indexed property. (Same page I have a non-indexed property and the 
client side validation is generated for this!)
3. By using UserDetails[], I do get the list in the Action class, but 
validation is not happening! (again problem only for the indexed property. 
works fine for the normal one.

Any help to resolve this would be great!


Thanks in Advance

Nitesh N

Re: Problem using indexed properties and validator framework

2005-06-02 Thread Nitesh

John,

Thank you for the answer.

I tried removing size with the form having session scope and it gave me 
java.lang.ArrayIndexOutOfBoundsException.


Tried using ArrayList and gives me java.lang.IndexOutOfBoundsException

Regards,

Nitesh

- Original Message - 


From: John Fitzpatrick [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 02, 2005 5:15 PM
Subject: Re: Problem using indexed properties and validator framework




Looks like you've got a few issues. Let me answer what I can and see if 
that

helps:

On 20050602 7:34 AM, Nitesh [EMAIL PROTECTED] wrote:


Hi,

I'm trying to use the validator framework with dyna forms.

In the JSP page I have a list of user details being listed for edit.

logic:iterate name=userList id=userList collection=%= userListCol 
%

type=com.sample.vo.UserDetails
tr
tdhtml:text property=userName indexed=true name=userList //td
tdhtml:text property=userAddress indexed=true name=userList 
//td
tdhtml:text property=userCountry indexed=true name=userList 
//td
tdhtml:text property=userZipCode indexed=true name=userList 
//td
tdhtml:text property=userEmail indexed=true name=userList 
//td
tdhtml:text property=userPhone indexed=true name=userList 
//td

/tr
/logic:iterate

I want this part to be validated on submit, and I intend to use validator
framework with dynaforms.
My Struts config looks like...

form-bean name=UserListAdmin
type=org.apache.struts.action.DynaActionForm
 form-property name=userList type=com.sample.vo.UserDetails[] 
size=3 /

 form-property name=test type=java.lang.String /
/form-bean



and my validation.xml looks like

form name=userListAdmin
 field property=test depends=required
  arg0 key=label.test/arg0
 /field
 field property=userList depends=required 
indexedListProperty=userName

  arg0 key=label.username/arg0
 /field
 field property=userList depends=required
indexedListProperty=userAddress
  arg0 key=label.address/arg0
 /field

/form


The problems I face are:
1. When I try to use ArrayList instead of UserDetails[] for flexibility 
since

I cannot predict the no of users in the list, I get ArrayIndexOutOfBounds
exception.


If you make your form session scoped, you can drop the size attribute from
the 'userList' form-property. The Array will the size of the array you put
into the form in your Action.

2. The client side validation defined in the validation-rules is not 
generated
for the indexed property. (Same page I have a non-indexed property and 
the

client side validation is generated for this!)


This may be a situation where you cannot generate automatic client-side
validation and will have to either write it yourself, or just use server
side validation and represent the form if you have an error.


3. By using UserDetails[], I do get the list in the Action class, but
validation is not happening! (again problem only for the indexed 
property.

works fine for the normal one.


In my experience, whenever I deal with Indexed properties, I've had to
create the actual Form class and put the validation into the validate 
(...)

method.


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