Setting values of nested collection

2004-09-30 Thread Danielle Boukovska
Hi all
I have a problem with setting the values on a hierarchy of nested
properties.
I have an ActionForm which has a property A of type HashMap. A is keyed 
on
Strings, and each value of A is a Collection (ArrayList). This 
collection
contains objects of type B.
I am trying to iterate through the keys A, and for each key, iterate 
through
the corresponding value (which is an ArrayList of B objects), i.e. I am
trying to do 2 levels of iteration. The I want to display a property of 
B
and let the user change it. I am able to display the properties of 
object B
on the screen. However, for some reason the nested:text tag doesn't 
work -
the textbox is there, but the input does not populate the form.
The following is what I am trying to do.
nested:iterate id=idForA property=A
nested:iterate name=idForA property=value  !--this should access
collection of B objects --
nested:text property=foo!--allow user to enter a
property of B --
/nested 
/nested
/nested
The problem is that when I enter a new value for foo, nothing happens; 
the
value of the nested property is not set. Is it possible to iterate through a HashMap, 
and let the user update its values?
I am quite new to Struts, and have spent a lot of time trying to get 
this to
work, but no luck. Any help will be appreciated!
Thanks
Danielle
 

  
-
 ALL-NEW Yahoo! Messenger - all new features - even more fun!  



-
 ALL-NEW Yahoo! Messenger - all new features - even more fun!  

Apache Tomcat

2004-09-30 Thread Shailender Jain
Hello All,

I have got a form which has got some 200 rows which needs to be
submitted to server for updation.
I am using Tomcat 5..0.16 as the webserver.

This passing of data from browser to server seems to be very slow.
Is there any way by which i  can increase the speed.

I know this is dependent on the network.
But can anything being done as a developer.

Thanks
Shailender Jain


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



RE: Apache Tomcat

2004-09-30 Thread Mazen, Tamer S
Dear Shailender,
You can put those 200 rows in session and use paging mechanismto display part of those 
rows for example (20-30) row per page.
BR

-Original Message-
From: Shailender Jain [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 9:01 AM
To: [EMAIL PROTECTED]
Subject: Apache Tomcat


Hello All,

I have got a form which has got some 200 rows which needs to be submitted to server 
for updation. I am using Tomcat 5..0.16 as the webserver.

This passing of data from browser to server seems to be very slow. Is there any way by 
which i  can increase the speed.

I know this is dependent on the network.
But can anything being done as a developer.

Thanks
Shailender Jain


-
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: Refresh problem

2004-09-30 Thread Paul McCulloch
The token is set in a session scope attribute named
org.apache.struts.action.TOKEN. It should be relatively straightforward to
include it's value within the link, as a parameter named
org.apache.struts.taglib.html.TOKEN. I suggest you take a look at the
TokenProcessor class if you have any issues getting this working.

Paul

 -Original Message-
 From: andy wix [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 29, 2004 6:02 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Refresh problem
 
 
 Hi,
 
 Ah, that will be why... I use a link to submit.  Is there any 
 way to force 
 this to happen without a form?
 
 Thanks,
 Andy
 
 _
 It's fast, it's easy and it's free. Get MSN Messenger today! 
 http://www.msn.co.uk/messenger
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



RE: JSTL and Tiles

2004-09-30 Thread Paul McCulloch
Try using request scope (rather than the default of page) when you use JSTL
to set your attribute value. Changes to the named attribute will be picked
up by any code which is executed afterwards.

Paul

 -Original Message-
 From: CRANFORD, CHRIS [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 29, 2004 6:54 PM
 To: '[EMAIL PROTECTED]'
 Subject: JSTL and Tiles
 
 
 I have a JSP which uses JSTL to define a variable.  This same JSP uses
 tiles:insert to include a page segment that also needs to be 
 able to have
 visibility to its parent JSTL variable.  How can I pass that 
 variable to the
 inserted tiles page and have it update the variables value so that the
 remainder of the container JSP sees any changes made by the 
 inserted page?
 
 ___
 Chris Cranford
 Programmer/Developer
 SETECH Inc.  Companies
 6302 Fairview Rd, Suite 201
 Charlotte, NC  28210
 Phone: (704) 362-9423, Fax: (704) 362-9409, Mobile: (704) 650-1042 
 Email: [EMAIL PROTECTED]
 
 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread Adam Lipscombe
Hi,
 
Under some circumstances my app receives a set of request params at the
login.jsp page. After the user has authenticated these params need to be
passed to the next page to be displayed (home.jsp). home.jsp then displays
differently depending on the params passed. Normally there will be no params
at all.
 
 
My original plan was to pass the params through to the login action (that
gets called from the login.jsp) and then forward them to home.jsp by
building a parameter ?name=valuename1=value1 string and appending it to
the home.jsp url.
 
My problem seems to be passing the params from login.jsp to the login
action:
 
1. First, I tried storing the params in the request with
request.setAttribute() in the login.jsp page.
But, the login action gets a different request instance from that in
which the request params were stored so the params are no longer there.
 
(I could store them in the session I suppose but don't really want them
there for the duration of the users session. Seems like it should be
easier).
 
 
2. I then tried storing the params in the login actionform but for some
reason this doesn't work either.
 
 
I trawled through the mailing list archive - lots of oblique references to
similar problems but nothing definitive
 
What is the best way to do this? Is there a standard solution?
 
 
 
TIA - Adam
 
 


Re: FW: R: Detecting the previous JSP

2004-09-30 Thread calandraca
I strongly suggest to use DOM object model when programming
JavaScript, since I do it my applications are accessed from Safari,
IE, Firefox without problems and no browser dependent code is
required. In your case I'd do this:

1. The html form:

html:form action=/editRegistration
onsubmit=validateRegistrationForm(this) styleId=myFrm

Note that I have added the styleId attribute, this will be rendered as
an id attribute when html is generated. The id attribute identify your
html node in the node tree (in this case the form node).

2. The javascript function callDelete: we use DOM
(http://www.w3.org/DOM) to locate a node and change its attributes:
 
function callDelete() {
  frm = document.getElementById(myFrm);  
  frm.setAttribute(action, /deleteRegistration);
  frm.submit();
}

* With document.getElementById(...) you can locate an object of your
html document if it has an id attribute.
* With node.setAttribute(attributeName, value) you can modify the
value of an attribute or add it if it doesn't exists.
* And there are many other useful and simple methods you can use like
getElementsByTagName, appendChild ... Try this for more information
http://www.scottandrew.com/weblog/articles/dom_2

Hope this help.





On Wed, 29 Sep 2004 16:29:39 -0400, Shabada, Gnaneshwer
[EMAIL PROTECTED] wrote:
 All.
 
 I am posting again so that someone can shed some light on this..
 
 I am trying to submit an action from a button thru a Javascript function.
 
 My Javascript code is :
 
 function callDelete()
 {
 document.forms[0].action=/deleteRegistration;
 document.forms[0].submit();  JS error
 }
 
 
 My JSP code is something like this:
 
 html:form action=/editRegistration
 onsubmit=validateRegistrationForm(this)
  .
  so on..
  .
  .
  .
 html:submit property=submit
 bean:message key=button.update /
 /html:submit
 html:submit onclick=javascipt:callDelete();
 bean:message key=button.delete /
 /html:submit
 /html:form
 
 When I click the UPDATE button, the default /editRegistration action is
 called. But when I click the Delete button I want to submit the
 /deleteRegistration thru JS function. I don't know why but I am getting
 this browser Javascript error saying Object doesn't support this property
 or method on the submit line (shown above). Am I doing anything wrong? Does
 struts html form support javascript action submission. Is there any other
 way to do this?
 
 Please help
 
 
 Gnan
 
 
 This email message is for the sole use of the intended recipient (s) and may
 contain confidential and privileged information. Any unauthorized review,
 use, disclosure or distribution is prohibited. If you are not the intended
 recipient, please contact the sender by reply email and destroy all copies
 of the original message. To reply to our email administrator directly, send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.
 
 -
 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: ImageButtonBean LookupDispatchAction

2004-09-30 Thread Michael McGrady
Ben wrote:
Hi
Anyone knows any example on how to use ImageButtonBean in
LookupDispatchAction? Or can someone give me an example
implementation? Thanks.
Regards,
Ben
This is mixing two different and competing systems, and each of them is 
heavier and more complex than they need to be in the first instance.  
Check out http://www.michaelmcgrady.com/button.jsp for five solutions to 
the button issue that are preferrable in my opinion. 

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


Reusing methods across actions classes

2004-09-30 Thread Ciaran Hanley
Hey,

 

Bit of a dummy question here but I am wondering what is the best way to
reuse methods across different action classes. Is it acceptable to make an
instance of an action class within an action class so I can use one of its
methods. Or would it be better to simply copy and paste the method into the
both classes. Or should I extract all common methods into one class and
create an instance of this class as required. Any suggestions?

 

CH



[Struts Workflow] source code available for struts-workflow-1-0-3-demo ?

2004-09-30 Thread Mark Songhurst
Hi.

If anyone from LivingLogic (or otherwise) can send me the source code (.java files) 
for the struts-workflow-1-0-3-demo.war file then it would be much appreciated and 
assist me greatly in integrating struts-workflow into my application.

Many Thanks, 
Mark.

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

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



RE: Reusing methods across actions classes

2004-09-30 Thread Mark Benussi
Yes. call your super class myaction or whatever you feel helps.
And also please dont copy both mailing lists.
Original Message Follows
From: Ciaran Hanley [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' 
[EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: RE: Reusing methods across actions classes
Date: Thu, 30 Sep 2004 11:25:25 +0100

My actions already extend Action. Should I write a superclass that extends
Action, and then extend this class, is that correct?
Thanks.
-Original Message-
From: Mark Benussi [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 11:19
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Reusing methods across actions classes
I would say that if you have common functionality such as a method that all
objects [Actions] share then place the common method in a super class
[Action] that the other classes can extend.
Original Message Follows
From: Ciaran Hanley [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts User Mailing List [EMAIL PROTECTED]
Subject: Reusing methods across actions classes
Date: Thu, 30 Sep 2004 11:16:20 +0100
Hey,

Bit of a dummy question here but I am wondering what is the best way to
reuse methods across different action classes. Is it acceptable to make an
instance of an action class within an action class so I can use one of its
methods. Or would it be better to simply copy and paste the method into the
both classes. Or should I extract all common methods into one class and
create an instance of this class as required. Any suggestions?

CH

-
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: Reusing methods across actions classes

2004-09-30 Thread Prasenjit Narwade
Probably you can create a Generic Action class which extends Struts Action
class and make all your Action classes extend this class. You can then put
the reusable methods in this class and it can be used by all your Action
classes.

-Prasenjit


-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 3:46 PM
To: Struts User Mailing List
Subject: Reusing methods across actions classes


Hey,

 

Bit of a dummy question here but I am wondering what is the best way to
reuse methods across different action classes. Is it acceptable to make
an
instance of an action class within an action class so I can use one of
its
methods. Or would it be better to simply copy and paste the method into
the
both classes. Or should I extract all common methods into one class and
create an instance of this class as required. Any suggestions?

 

CH

Quinnox is an Award Winning IT services organisation, accredited to CMM
Level 5. We are successfully delivering Application Development,
Integration, Support and Testing services to clients in the Finance,
Manufacturing, Retail and Telecom sectors. Particular focus areas include
e-Business and ERP (notably SAP) solutions.

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



NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread andy wix
Hi,
It's probably better to store them in the session rather then passing from 
page to page.
In Login action:

   HttpSession session = request.getSession();
session.setAttribute(YourParams, params);
and get them in the next page:
YourClass xxx = (YourClass)session.getAttribute(YourParams);
regards,
Andy
_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread HG
Hi Andy

A session variable can be expensive. Why not just put it on the request by
using request.setAttribute in one action and getting it again using
request.getAttribute in another action?

What is your parameter? A simple type, object, graph of objects?




- Original Message - 
From: andy wix [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:03 PM
Subject: NEWBIE: How to pass parameters between JSPs


 Hi,

 It's probably better to store them in the session rather then passing from
 page to page.
 In Login action:

 HttpSession session = request.getSession();
  session.setAttribute(YourParams, params);

 and get them in the next page:

  YourClass xxx = (YourClass)session.getAttribute(YourParams);

 regards,
 Andy

 _
 Express yourself with cool new emoticons
http://www.msn.co.uk/specials/myemo


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



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



Re: NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread HG
Forget my previous post. Was answering an answer... :-)  Might need some
sleep.. :-)
- Original Message - 
From: andy wix [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:03 PM
Subject: NEWBIE: How to pass parameters between JSPs


 Hi,

 It's probably better to store them in the session rather then passing from
 page to page.
 In Login action:

 HttpSession session = request.getSession();
  session.setAttribute(YourParams, params);

 and get them in the next page:

  YourClass xxx = (YourClass)session.getAttribute(YourParams);

 regards,
 Andy

 _
 Express yourself with cool new emoticons
http://www.msn.co.uk/specials/myemo


 -
 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: ImageButtonBean LookupDispatchAction

2004-09-30 Thread Michael McGrady
Note, Ben, that in LookupDispatchAction we do the following:

Used the mapping attirbute parameter method to find Delete It in the 
request object name/value parameter pair method='Delete It'.  Created 
a reverse map of all the keys in the application resource property file 
for the users locale which allowed us to get button.delete from the 
key Delete It.  We are not yet done.  We then use the value 
button.delete as the key in a map we have coded into our 
LookupDispatchAction subclass to get the value delete.  If this seems 
like a good idea to you, then we think differently.  All l have to say 
about this is WHEW!.  LOL


The ImageButtonBean is as convoluted and requires that we create a 
slough of classes and objects.  This is, I would suggesrt, something we 
might not want to recommend to coders.


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


Re: multi box and required validation

2004-09-30 Thread Ratnakar Parakala
Anand, We are using validator framework and validating multibox and multiselect. We 
are not doing anything special, but like ordinary string validation.  Here is the code 
snippet:
field property=taskSequenceTasks depends=required
  arg0 key=label.tasks.selecttasksequencetasks/
/field
 
HTH,
Ratnakar
Anand M S [EMAIL PROTECTED] wrote:
I'm using org.apache.struts.validator.DynaValidatorForm for form type in 
struts-config.xml, i do not have sub class, so there is no overrriden method 
for reset. Form is in request scope, i guess it's fine.
It's loading validation rules and validation is working correctly for other 
fileds on the same form, so validation is turned on and it gets called upon 
form submission.

The only thing here is the form fields data type String[] and for all other 
fields it's String, required validation is only works with for String data 
type?

Thanks
Anand


From: Wendy Smoak 
Reply-To: Struts Users Mailing List 
To: Struts Users Mailing List 
Subject: Re: multi box and required validation
Date: Wed, 29 Sep 2004 10:01:27 -0700

From: Anand M S 
  if i don't
  select any one of the checkboxes and submit, it did not rise error
message,
  it suppose to give error message as it is required field.

Where do you expect the error message to appear? What do you have in the
JSP?

Are you sure validation is turned on in your action mapping? (I _think_ it
defaults to on, but check.)

What do the logs say-- you should see the validation get set up when you
deploy the webapp, and then later a message when the form passes validation
(or not).

Have you overridden validate(...) and forgotten to call 
super.validate(...)?

As you can tell, I have no idea what the problem is. These are things I
would ask myself while trying to figure it out, maybe you'll stumble across
the answer, or perhaps someone else reading here will see it. The more
relevant information you give, the more likely you are to get help.

--
Wendy Smoak


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


_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


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



-
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.

Re: ImageButtonBean LookupDispatchAction

2004-09-30 Thread Michael McGrady
Michael McGrady wrote:
Note, Ben, that in LookupDispatchAction we do the following:

Used the mapping attirbute parameter method to find Delete It in 
the request object name/value parameter pair method='Delete It'.  
Created a reverse map of all the keys in the application resource 
property file for the users locale which allowed us to get 
button.delete from the key Delete It.  We are not yet done.  We 
then use the value button.delete as the key in a map we have coded 
into our LookupDispatchAction subclass to get the value delete.  If 
this seems like a good idea to you, then we think differently.  All l 
have to say about this is WHEW!.  LOL


Note also that, instead of following that lonesome Chisholm Trail, we 
can simply do the following:


   public static String getName(HttpServletRequest request) {
   String command = null;
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   while(enum.hasMoreElements()) {
 buttonValue = (String)enum.nextElement();
 if(buttonValue.endsWith(.x)) {
   command = buttonValue.substring(0,buttonValue.indexOf('.'));
 }
   }
   return command;
   }

And get the value of the method from either input type='submit' 
name='create.x' value='create or input type='image' name='create' 
src='create.gif'.  This is the solution I offer called ImageTagUtil.  
If you don't like mining the value .x, you can use your imagination.  
I mine the value dispatch instead of .x in much of what is on my site.


Cheers,
Michael
 public static String getName(HttpServletRequest request) {
   String methodName  = null;
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   while(enum.hasMoreElements()) {
 buttonValue = (String)enum.nextElement();
 if(buttonValue.indexOf(.dispatch) = 0) {
   methodName = buttonValue;
   break;
 }
   }
   return methodName.substring(0,methodName.indexOf('.'));
 }
 public static String getName(HttpServletRequest request) {
   String methodName  = null;
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   while(enum.hasMoreElements()) {
 buttonValue = (String)enum.nextElement();
 if(buttonValue.indexOf(.dispatch) = 0) {
   methodName = buttonValue;
   break;
 }
   }
   return methodName.substring(0,methodName.indexOf('.'));
 }
}
}

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


Re: The Original Web Page Cannot Be Found (HTTP 404) After Validation is Turned On

2004-09-30 Thread Caroline Jen
I have tried /ContentMgmt.do

I got the same HTTP 404 file not found error.
--- Gabriel França Campolina [EMAIL PROTECTED]
wrote:

 Try put the /ContentMgmt.do
 
 
 
 
 On Wed, 29 Sep 2004 12:00:31 -0700 (PDT), Caroline
 Jen
 [EMAIL PROTECTED] wrote:
  I have action mapping in the struts-config.xml
 like
  this:
  
 action
 path=/ContentMgmt   // the path for a
 link
 type=org.dhsinfo.content.SelectPage
 scope=request
 validate=false
forward
 name=success
 path=.frame.Content/
 /action
  
  The .frame.Content is defined in the tiles-def.xml
 to
  display a drop-down menu based on the data
 obtained
  from the action servlet SelectPage.java.
  
  This drop-down menu is included in the
  'editTitleForm'.  The Submit button of the form
 has
  the following action mapping:
  
 action
 path=/content/UpdateTitle
 type=org.dhsinfo.content.UpdateTitle
 name=editTitleForm
 scope=request
 validate=true
 input=/ContentMgmt
forward
name=success
path=.title.Confirmation/
 /action
  
  If there is no validation errors, successful
 execution
  of the UpdateTitle.java will give me the
  .title.Confirmation in the tiles definition.  If
  there are validation errors, I want to go back to
 the
  first action mapping (note that
 input=/ContentMgmt
  ).
  
  I intentionally made validation mistakes for
 testing
  purpose and click on the Submit button of the
 form.  I
  got Internet Explorer HTTP 404 - file not found:
  
  The page you are looking for might have been
 removed,
  had its name changed, or is temporarily
 unavailable.
  
  Please try the following:
  
  If you typed the page address in the Address bar,
 make
  sure that it is spelled correctly.
  
  Open the localhost:8080 home page, and then look
 for
  links to the information you want.
  Click the  Back button to try another link.
  Click  Search to look for information on the
 Internet.
  
  What should I do to fix the problem?
  
  __
  Do you Yahoo!?
  Yahoo! Mail - 50x more storage than other
 providers!
  http://promotions.yahoo.com/new_mail
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
 
 
 
 -- 
 Gabriel França Campolina
 Tel: 9202-8320
 

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




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



Validation of Forms in a DispatchAction ???

2004-09-30 Thread Charles . Gouin-Vallerand
Hi all,
I got a problem, I want to validate several Form in a
DispatchAction. But, this Action is called after a validation of an other
type of form. I got a Null Exception Pointer when I validate through my
DispatchAction. Somebody has an idea, how I can validate without problem.
Here an extract of my code :
The action mapping 

action path=/createMasterFromFile
type=plateinv.actions.plate.MPCreateAction
name=plateCreationForm
parameter=method
validate=true
input=tiles.plate.master.create.option
  forward name=createFromFile
path=tiles.plate.master.create.confirmationMP/
  forward name=createFromFileMPDP
path=tiles.plate.master.create.confirmationMPDP/
/action

public class MPCreateAction extends DispatchAction {
...
public ActionForward createFromFile(ActionMapping mapping,ActionForm form,
  HttpServletRequest request,
HttpServletResponse response) throws
Exception {

DynaValidatorForm pcf = (DynaValidatorForm) form;
//retrieve the file representation
FormFile file = (FormFile) pcf.get(fileName);
ReadMP rmp = new ReadMP(file.getInputStream());
Collection collMP = rmp.read();  //Collection of MasterPlateForm
Iterator it = collMP.iterator();
while(it.hasNext()) {
MasterPlateForm mpf = ( MasterPlateForm ) it.next();
Enumeration enum = request.getAttributeNames();
mpf.validate( mapping, request ); // Where I call the validate
method
}
return mapping.findForward(createFromFile);
}
}

public class MasterPlateForm extends ValidatorForm {
.
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionMessages errors = super.validate(mapping,request);  // This is
the line where the null pointer exception is called
String method = request.getParameter(method).toString();

if(method.equals(cancel)) {
return null;
} else {  
return (ActionErrors) errors;
}
}
}

I wait your ideas !

Charles Gouin-Vallerand 



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



Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Nadia Kunkov
Hi,
I'm wondering if I should use validate() method of ActionForm instead of JavaScript to 
validate the form.  I can see the advantage of validate() when you have an 
internationalized application, but otherwise why would I have an overhead of going 
back to the server when I can do the validation on the client side?  I'm a struts 
newbie so I might not see the advantage of validate yet, so can someone tell me why 
JavaScript would be an inferior choice ( when internationalization is not an issue ). 

Thanks
NK

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



Re: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Jeff Beal
Nadia Kunkov wrote:
Hi,
I'm wondering if I should use validate() method of ActionForm instead of JavaScript to validate the form.  I can see the advantage of validate() when you have an internationalized application, but otherwise why would I have an overhead of going back to the server when I can do the validation on the client side?  I'm a struts newbie so I might not see the advantage of validate yet, so can someone tell me why JavaScript would be an inferior choice ( when internationalization is not an issue ). 

Thanks
NK
In short, you don't have control over your users' environment.  They 
could be running old browsers; they could have JavaScript disabled; they 
could be running a browser with non-standard JavaScript support; their 
browser could be buggy.  Malicious users could even manually assemble 
HTTP requests with invalid data.

By using server-side validation, you take control over all of the data 
coming into your web application.  If you leave validation to the 
browser, there is always the chance that bad data is going to sneak into 
your system and do something that you don't expect.

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

Re: NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread HG
Hi Adam

I might be overwhelmed by the lack of sleep, but... I can simply don't get
it.. So please confirm'

1 ) You have a login.jsp and a LoginAction
2) When the submit button (or whatever) is pressed on the rendered (by
login.jsp) HTML page, LoginAction is called.
3) In LoginAction, you can get to the value of the fields (in login.jsp),
through the attached FormBean (say LoginForm) instance.
4) You can take these values and store them as attributes on the request and
forward (NOT redirect) to another action/jsp.
5) In the action/jsp you get these attributes again from the request

Is the problem that you are using redirect??  It can be set up in the
struts-config.xml

Regards

Henrik


- Original Message - 
From: Adam Lipscombe [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 2:01 PM
Subject: RE: NEWBIE: How to pass parameters between JSPs


Folks


Thanks for your replies
I tried using request.setAttribute(), but the HttpServletRequest instance
changes between Login.jsp and the login action. The  instance that Login.jsp
stores the params in is not the same instance that is passed into the login
action. Hence he params are not present in the login action.


The param I want to pass is a Map of name/value pairs.


Maybe the standard solution is to just put it in the session?


TIA -Adam



-Original Message-
From: HG [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 12:32
To: Struts Users Mailing List
Subject: Re: NEWBIE: How to pass parameters between JSPs


Hi Andy

A session variable can be expensive. Why not just put it on the request by
using request.setAttribute in one action and getting it again using
request.getAttribute in another action?

What is your parameter? A simple type, object, graph of objects?




- Original Message - 
From: andy wix [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:03 PM
Subject: NEWBIE: How to pass parameters between JSPs


 Hi,

 It's probably better to store them in the session rather then passing
 from page to page. In Login action:

 HttpSession session = request.getSession();
  session.setAttribute(YourParams, params);

 and get them in the next page:

  YourClass xxx =
 (YourClass)session.getAttribute(YourParams);

 regards,
 Andy

 _
 Express yourself with cool new emoticons
http://www.msn.co.uk/specials/myemo


 -
 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: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Sachin Bhutada


hi Nadia, 
 What if the client who is accessing ur application disables the
java script and keeps on hitting the server contineous ?
  Secondly, Using javascript its little difficult to modify the html
pages. But using validate method and html:errors/   u can lay out ur error
messages properly. 
   
At this moment I only see these two advantages of validate method. 

sachin

-Original Message-
From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 6:35 PM
To: Struts help (E-mail)
Subject: Validate() vs JavaScript where is the advantage?


Hi,
I'm wondering if I should use validate() method of ActionForm instead of
JavaScript to validate the form.  I can see the advantage of validate() when
you have an internationalized application, but otherwise why would I have an
overhead of going back to the server when I can do the validation on the
client side?  I'm a struts newbie so I might not see the advantage of
validate yet, so can someone tell me why JavaScript would be an inferior
choice ( when internationalization is not an issue ). 

Thanks
NK

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


RE: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Sachin Bhutada

Nadia,

By using struts and validator framework u can show internationalized
java script error messages as well. 

sachin

-Original Message-
From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 6:35 PM
To: Struts help (E-mail)
Subject: Validate() vs JavaScript where is the advantage?


Hi,
I'm wondering if I should use validate() method of ActionForm instead of
JavaScript to validate the form.  I can see the advantage of validate() when
you have an internationalized application, but otherwise why would I have an
overhead of going back to the server when I can do the validation on the
client side?  I'm a struts newbie so I might not see the advantage of
validate yet, so can someone tell me why JavaScript would be an inferior
choice ( when internationalization is not an issue ). 

Thanks
NK

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


html:messages with multiple bundles?

2004-09-30 Thread Woodchuck
hihi,

has anyone a good way to handle displaying multiple messages that come
from multiple bundles (resource files) on the jsp?

how can i make my jsp handle messages that can come from more than one
bundle?

the reason why i need to do this is because we made a base
application that all projects will include.  this base application
contains generic functionality that all future projects will inherit. 
so it has it's own bundles of messages, that has now come into the
situation where it's possible that the returned ActionMessages or
ActionErrors collection contains ActionMessage or ActionError objects
with keys coming from the base bundles and the project bundles.  ie. it
is not guaranteed that all message collection keys will come from one
bundle.

any suggestions on how to handle this is greatly appreciated as always.

please and thanks,
woodchuck




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



RE: NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread Adam Lipscombe
Hi Henrik


Yes that's it. I tried what you suggest and it works. Many thanks.

What I was trying to avoid was storing the params in the LoginForm
actionform. It seems like this approach uses the LoginForm ActionForm as a
forwarding mechanism for params passed into Login.jsp.

What I tried was this:
In Login.jsp itself I stored the params in the request instance via
setAttribute(). If I later try to fish them out in the Login action they are
not available - because the request instance has changed. I did not use the
ActionForm to pass them from Login.jsp to Login Action.


Is using the ActionForm like you suggest the normal way to handle this
situation? (i.e. passing through params).


TIA - Adam







-Original Message-
From: HG [mailto:[EMAIL PROTECTED] 
Sent: 30 September 2004 14:14
To: Struts Users Mailing List
Subject: Re: NEWBIE: How to pass parameters between JSPs


Hi Adam

I might be overwhelmed by the lack of sleep, but... I can simply don't get
it.. So please confirm'

1 ) You have a login.jsp and a LoginAction
2) When the submit button (or whatever) is pressed on the rendered (by
login.jsp) HTML page, LoginAction is called.
3) In LoginAction, you can get to the value of the fields (in login.jsp),
through the attached FormBean (say LoginForm) instance.
4) You can take these values and store them as attributes on the request and
forward (NOT redirect) to another action/jsp.
5) In the action/jsp you get these attributes again from the request

Is the problem that you are using redirect??  It can be set up in the
struts-config.xml

Regards

Henrik


- Original Message - 
From: Adam Lipscombe [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 2:01 PM
Subject: RE: NEWBIE: How to pass parameters between JSPs


Folks


Thanks for your replies
I tried using request.setAttribute(), but the HttpServletRequest instance
changes between Login.jsp and the login action. The  instance that Login.jsp
stores the params in is not the same instance that is passed into the login
action. Hence he params are not present in the login action.


The param I want to pass is a Map of name/value pairs.


Maybe the standard solution is to just put it in the session?


TIA -Adam



-Original Message-
From: HG [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 12:32
To: Struts Users Mailing List
Subject: Re: NEWBIE: How to pass parameters between JSPs


Hi Andy

A session variable can be expensive. Why not just put it on the request by
using request.setAttribute in one action and getting it again using
request.getAttribute in another action?

What is your parameter? A simple type, object, graph of objects?




- Original Message - 
From: andy wix [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:03 PM
Subject: NEWBIE: How to pass parameters between JSPs


 Hi,

 It's probably better to store them in the session rather then passing 
 from page to page. In Login action:

 HttpSession session = request.getSession();
  session.setAttribute(YourParams, params);

 and get them in the next page:

  YourClass xxx = 
 (YourClass)session.getAttribute(YourParams);

 regards,
 Andy

 _
 Express yourself with cool new emoticons
http://www.msn.co.uk/specials/myemo


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



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



The best pratice to developer a login system

2004-09-30 Thread Gabriel França Campolina
Hi folks,

I never developed a login system,and I'm need developer this now with
autheticantion and perfis of the user, I'd like know if exists
anything developed or how created a system with secury in the Struts

Sorry my english, I´m Braziliam.

Thanks,


-- 
Gabriel França Campolina
Tel: 9202-8320

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



RE: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Nadia Kunkov
Thanks for the replies.
Have you ever noticed a performance difference though?  
Is it significant?
Nadia


-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal
Sent: Thursday, September 30, 2004 9:14 AM
To: [EMAIL PROTECTED]
Subject: Re: Validate() vs JavaScript where is the advantage?


Nadia Kunkov wrote:
 Hi,
 I'm wondering if I should use validate() method of ActionForm instead of JavaScript 
 to validate the form.  I can see the advantage of validate() when you have an 
 internationalized application, but otherwise why would I have an overhead of going 
 back to the server when I can do the validation on the client side?  I'm a struts 
 newbie so I might not see the advantage of validate yet, so can someone tell me why 
 JavaScript would be an inferior choice ( when internationalization is not an issue 
 ). 
 
 Thanks
 NK
In short, you don't have control over your users' environment.  They 
could be running old browsers; they could have JavaScript disabled; they 
could be running a browser with non-standard JavaScript support; their 
browser could be buggy.  Malicious users could even manually assemble 
HTTP requests with invalid data.

By using server-side validation, you take control over all of the data 
coming into your web application.  If you leave validation to the 
browser, there is always the chance that bad data is going to sneak into 
your system and do something that you don't expect.

-- Jeff


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



Re: NEWBIE: How to pass parameters between JSPs

2004-09-30 Thread HG
Hi Adam

Glad it worked out.

The ActionForm is the Struts way of interacting with HTML forms. It is a
kkey concept of the Struts framework.
So, what basically happens here is that an Action CAN be tied to a FormBean,
and the FormBean serves as a layer between your HTML form and the action.
So, all your action has to do, is to inspect the attributes of the FormBean
to get to the data the user entered in the HTML form.
The trick here is naming of html tags as you already figured out.

I don't know what others on this list do, but as a rule of thumb I always
use the constellation:
JSP-FormBean-Action

When polulating the jsp, you can also use the very same FormBean, to set up
defaults, fill lists, whatever. It works in both directions.
JSP-FormBean and
FormBean-JSP

HTH

Henrik



- Original Message - 
From: Adam Lipscombe [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 3:37 PM
Subject: RE: NEWBIE: How to pass parameters between JSPs


Hi Henrik


Yes that's it. I tried what you suggest and it works. Many thanks.

What I was trying to avoid was storing the params in the LoginForm
actionform. It seems like this approach uses the LoginForm ActionForm as a
forwarding mechanism for params passed into Login.jsp.

What I tried was this:
In Login.jsp itself I stored the params in the request instance via
setAttribute(). If I later try to fish them out in the Login action they are
not available - because the request instance has changed. I did not use the
ActionForm to pass them from Login.jsp to Login Action.


Is using the ActionForm like you suggest the normal way to handle this
situation? (i.e. passing through params).


TIA - Adam







-Original Message-
From: HG [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 14:14
To: Struts Users Mailing List
Subject: Re: NEWBIE: How to pass parameters between JSPs


Hi Adam

I might be overwhelmed by the lack of sleep, but... I can simply don't get
it.. So please confirm'

1 ) You have a login.jsp and a LoginAction
2) When the submit button (or whatever) is pressed on the rendered (by
login.jsp) HTML page, LoginAction is called.
3) In LoginAction, you can get to the value of the fields (in login.jsp),
through the attached FormBean (say LoginForm) instance.
4) You can take these values and store them as attributes on the request and
forward (NOT redirect) to another action/jsp.
5) In the action/jsp you get these attributes again from the request

Is the problem that you are using redirect??  It can be set up in the
struts-config.xml

Regards

Henrik


- Original Message - 
From: Adam Lipscombe [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 2:01 PM
Subject: RE: NEWBIE: How to pass parameters between JSPs


Folks


Thanks for your replies
I tried using request.setAttribute(), but the HttpServletRequest instance
changes between Login.jsp and the login action. The  instance that Login.jsp
stores the params in is not the same instance that is passed into the login
action. Hence he params are not present in the login action.


The param I want to pass is a Map of name/value pairs.


Maybe the standard solution is to just put it in the session?


TIA -Adam



-Original Message-
From: HG [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 12:32
To: Struts Users Mailing List
Subject: Re: NEWBIE: How to pass parameters between JSPs


Hi Andy

A session variable can be expensive. Why not just put it on the request by
using request.setAttribute in one action and getting it again using
request.getAttribute in another action?

What is your parameter? A simple type, object, graph of objects?




- Original Message - 
From: andy wix [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:03 PM
Subject: NEWBIE: How to pass parameters between JSPs


 Hi,

 It's probably better to store them in the session rather then passing
 from page to page. In Login action:

 HttpSession session = request.getSession();
  session.setAttribute(YourParams, params);

 and get them in the next page:

  YourClass xxx =
 (YourClass)session.getAttribute(YourParams);

 regards,
 Andy

 _
 Express yourself with cool new emoticons
http://www.msn.co.uk/specials/myemo


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

Re: ImageButtonBean LookupDispatchAction

2004-09-30 Thread Carlos Cajina - Hotmail
Hi Ben.

I see that Mike McGrady already pointed you in the right direction :^)
I've tried the solution he proposes with execelent results... if you have
any further questions or doubts I'll be glad to help.

Regards,

Carlos

Premature optimization is the root of all evil.
Donald E. Knuth
- Original Message - 
From: Ben [EMAIL PROTECTED]
To: Struts [EMAIL PROTECTED]
Sent: Wednesday, September 29, 2004 11:58 PM
Subject: ImageButtonBean  LookupDispatchAction


 Hi

 Anyone knows any example on how to use ImageButtonBean in
 LookupDispatchAction? Or can someone give me an example
 implementation? Thanks.

 Regards,
 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: The best pratice to developer a login system

2004-09-30 Thread Sean Schofield
J2EE provides some good security options out of the box.  I would look 
into security constraints.  Sun has a nice tutorial:

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Security.html
Sean
Gabriel França Campolina wrote:
Hi folks,
I never developed a login system,and I'm need developer this now with
autheticantion and perfis of the user, I'd like know if exists
anything developed or how created a system with secury in the Struts
Sorry my english, I´m Braziliam.
Thanks,
 


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


RE: html:messages with multiple bundles?

2004-09-30 Thread Paul McCulloch
A simple solution would be to change your build process to combine the base
properties and the applications properties into one resource file.

Paul

 -Original Message-
 From: Woodchuck [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 2:23 PM
 To: struts
 Subject: html:messages with multiple bundles?
 
 
 hihi,
 
 has anyone a good way to handle displaying multiple messages that come
 from multiple bundles (resource files) on the jsp?
 
 how can i make my jsp handle messages that can come from more than one
 bundle?
 
 the reason why i need to do this is because we made a base
 application that all projects will include.  this base application
 contains generic functionality that all future projects will inherit. 
 so it has it's own bundles of messages, that has now come into the
 situation where it's possible that the returned ActionMessages or
 ActionErrors collection contains ActionMessage or ActionError objects
 with keys coming from the base bundles and the project 
 bundles.  ie. it
 is not guaranteed that all message collection keys will come from one
 bundle.
 
 any suggestions on how to handle this is greatly appreciated 
 as always.
 
 please and thanks,
 woodchuck
 
 
 
   
 ___
 Do you Yahoo!?
 Declare Yourself - Register online to vote today!
 http://vote.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



Test

2004-09-30 Thread fzlists
Please ignore, just testing my ability to post to the list.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Thank you

2004-09-30 Thread fzlists
I'm not actually a new user to the list, but unfortunately from work I am forced to 
use a webmail client, but even more unfortunately there is a bug in the client that 
causes my messages to not get through to the list.  So, I had to throw together a 
quick eMail client myself just to be able to post during work hours.  Argh.

 RECEIVED
 WELCOME

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: 2004/09/30 10:11 AM
 To: [EMAIL PROTECTED]
 Subject: Test


 Please ignore, just testing my ability to post to the list.

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

RE: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Brantley Hobbs
Performance is likely to be the last thing you'll be worried about if
someone sneaks malicious input past your validation.

Client-side form validation is just plain /wrong/!

Never trust input you get back from a client.  Never.

Brantley

 -Original Message-
 From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 9:58 AM
 To: Struts Users Mailing List
 Subject: RE: Validate() vs JavaScript where is the advantage?
 
 Thanks for the replies.
 Have you ever noticed a performance difference though?
 Is it significant?
 Nadia
 
 
 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal
 Sent: Thursday, September 30, 2004 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Validate() vs JavaScript where is the advantage?
 
 
 Nadia Kunkov wrote:
  Hi,
  I'm wondering if I should use validate() method of ActionForm
instead of
 JavaScript to validate the form.  I can see the advantage of
validate()
 when you have an internationalized application, but otherwise why
would I
 have an overhead of going back to the server when I can do the
validation
 on the client side?  I'm a struts newbie so I might not see the
advantage
 of validate yet, so can someone tell me why JavaScript would be an
 inferior choice ( when internationalization is not an issue ).
 
  Thanks
  NK
 In short, you don't have control over your users' environment.  They
 could be running old browsers; they could have JavaScript disabled;
they
 could be running a browser with non-standard JavaScript support; their
 browser could be buggy.  Malicious users could even manually assemble
 HTTP requests with invalid data.
 
 By using server-side validation, you take control over all of the data
 coming into your web application.  If you leave validation to the
 browser, there is always the chance that bad data is going to sneak
into
 your system and do something that you don't expect.
 
 -- Jeff
 
 
 -
 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: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Luis Urueña Frías
Hi!

JavaScript is one more technology added to the HTTP world. This protocol
was origannly designed
to transmit formatted data, so Javascript is fully optional. There is only
one methos to check the validity
of data, by means of server validation (struts or not). Javascript
validation helps because errors were detected
in cliente side, so implies lower network's data transmition. However,
Javascript is optional (could be disabled,
or not implemente by the browser) and have browser dependence.

Regards,


Luis Urueña Frías Oficina 101
Edificio Galileo, módulo Rojo
Parque Tecnológico de Boecillo Valladolid - España



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



RE: FW: R: Detecting the previous JSP

2004-09-30 Thread fzlists
Did you forget to post it?  I'm not seeing it here... Remember, it's the HTML as 
rendered on the browser, NOT what's in your JSP.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 10:27 am, Shabada, Gnaneshwer said:
 
 OK. Here is the html code from the JSP. Let me know if I am missing
 anything.
 
 Thanks for your help
 
 -Original Message-
 From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 29, 2004 5:05 PM
 To: Struts Users Mailing List
 Subject: Re: FW: R: Detecting the previous JSP
 
 
 Gnan, can you post the HTML that is generated by this?  I.e., what you
 see when you do View Source in your browser... I have a hunch what's
 going on, but I need to see that to be sure...
 
 Shabada, Gnaneshwer wrote:
 All.

 I am posting again so that someone can shed some light on this..

 I am trying to submit an action from a button thru a Javascript
 function.


 My Javascript code is :

 function callDelete()
 {
  document.forms[0].action=/deleteRegistration;
  document.forms[0].submit();  JS error
 }


 My JSP code is something like this:

 html:form action=/editRegistration
 onsubmit=validateRegistrationForm(this)
  .
  so on..
  .
  .
  .
 html:submit property=submit
 bean:message key=button.update /
 /html:submit
 html:submit onclick=javascipt:callDelete();
 bean:message key=button.delete /
 /html:submit
 /html:form

 When I click the UPDATE button, the default /editRegistration action
 is
 called. But when I click the Delete button I want to submit the
 /deleteRegistration thru JS function. I don't know why but I am
 getting
 this browser Javascript error saying Object doesn't support this
 property
 or method on the submit line (shown above). Am I doing anything wrong?
 Does
 struts html form support javascript action submission. Is there any
 other
 way to do this?

 Please help
 Gnan

 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized
 review,
 use, disclosure or distribution is prohibited. If you are not the
 intended
 recipient, please contact the sender by reply email and destroy all
 copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.

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





 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized review,
 use, disclosure or distribution is prohibited. If you are not the intended
 recipient, please contact the sender by reply email and destroy all copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.
 
 
 
 -
 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: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread fzlists
While absolutely agree with the premise that you shouldn't trust what the client sends 
you, I think this reponse is a little too rigid.  You need to take into account the 
environment your working in.

If your talking about a situation where your clients are captive (i.e., an 
internal-only application where you know the browser type coming in), you can do some 
things that you can't do on a public-facing site.

I've built a number of apps here at work that are exceptional in the sense that many 
people think they are using a fat-client because of the functionality and speed they 
see.  I could only have accomplished many of the things I have in those cases because 
we're an IE-only shop with virtually no chance of ever switching (I've been told this 
from higher-ups, so it's not my problem if they change their minds).  Some of the 
things that makes these apps unusual is because of all the client-side scripting that 
is done and all the dynamic HTML tricks I play.  It allows you to have a webapp that 
doesn't REACT like a webapp because you avoid a lot of the round-trips to the server 
for things that could be done on the client, and you can have functionality you 
couldn't do otherwise (like instantaneous sorting of a table without touching the 
server for instance).

I'm the first to admit you have to be careful in situations like this because it's 
easy to cause yourself trouble if you don't do it right.  And of course if they ever 
do decide to change browsers we're going to have problems.  But this is a decision 
that I don't think is as clear-cut as some are saying here (unless as I said it's a 
public site, then yes, I think it IS clear-cut: do it all on the server!)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 10:26 am, Brantley Hobbs said:
 Performance is likely to be the last thing you'll be worried about if
 someone sneaks malicious input past your validation.
 
 Client-side form validation is just plain /wrong/!
 
 Never trust input you get back from a client.  Never.
 
 Brantley
 
 -Original Message-
 From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 9:58 AM
 To: Struts Users Mailing List
 Subject: RE: Validate() vs JavaScript where is the advantage?

 Thanks for the replies.
 Have you ever noticed a performance difference though?
 Is it significant?
 Nadia


 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal
 Sent: Thursday, September 30, 2004 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Validate() vs JavaScript where is the advantage?


 Nadia Kunkov wrote:
  Hi,
  I'm wondering if I should use validate() method of ActionForm
 instead of
 JavaScript to validate the form.  I can see the advantage of
 validate()
 when you have an internationalized application, but otherwise why
 would I
 have an overhead of going back to the server when I can do the
 validation
 on the client side?  I'm a struts newbie so I might not see the
 advantage
 of validate yet, so can someone tell me why JavaScript would be an
 inferior choice ( when internationalization is not an issue ).
 
  Thanks
  NK
 In short, you don't have control over your users' environment.  They
 could be running old browsers; they could have JavaScript disabled;
 they
 could be running a browser with non-standard JavaScript support; their
 browser could be buggy.  Malicious users could even manually assemble
 HTTP requests with invalid data.

 By using server-side validation, you take control over all of the data
 coming into your web application.  If you leave validation to the
 browser, there is always the chance that bad data is going to sneak
 into
 your system and do something that you don't expect.

 -- Jeff


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

J2EE versions and Struts

2004-09-30 Thread Brent Vaughn
What versions of J2EE are compliant with the newest release of Struts?



J2EE versions and Struts

2004-09-30 Thread Brent Vaughn
What versions of J2EE are compliant with the newest release of Struts?



Struts ans JSR 168

2004-09-30 Thread Xavier Lawrence
Hi all,

I am looking for a working example of a struts application where its views 
would be seen in JSR-168 portlets.

I would like to make my struts-portlets application work on Tomcat, with pluto 
for example.
 
Can anybody give me a link of a working example, or even send me some source 
code ? I'll be thrilled...

Other possibility that would please me a lot:
- I have a working JSR-168 portlet application working with pluto
- I have a working struts example.

What should I do now to perform a merge of the 2 applications to obtain 
my portlet-struts program ?

Thanks in advance.

Cheers

Xavier

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



RE: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Brantley Hobbs
In limited, very controlled environments, I can see the advantages of
client-side validation, but even then I would still validate server side
because all it takes is one disgruntled employee and all of a sudden
your nice controlled environment is blown apart.

The only way you can guarantee a secure application is to trust nothing
and no one.

While I understand the pragmatic nature of the controlled environment
(and believe me, I've developed applications with similar assumptions),
the fact remains that trusting that the client cannot possibly deliver
bad or malicious data is a security breach waiting to happen.

My $0.02

Brantley



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 10:41 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Validate() vs JavaScript where is the advantage?
 
 While absolutely agree with the premise that you shouldn't trust what
the
 client sends you, I think this reponse is a little too rigid.  You
need to
 take into account the environment your working in.
 
 If your talking about a situation where your clients are captive
(i.e., an
 internal-only application where you know the browser type coming in),
you
 can do some things that you can't do on a public-facing site.
 
 I've built a number of apps here at work that are exceptional in the
sense
 that many people think they are using a fat-client because of the
 functionality and speed they see.  I could only have accomplished many
of
 the things I have in those cases because we're an IE-only shop with
 virtually no chance of ever switching (I've been told this from
higher-
 ups, so it's not my problem if they change their minds).  Some of the
 things that makes these apps unusual is because of all the client-side
 scripting that is done and all the dynamic HTML tricks I play.  It
allows
 you to have a webapp that doesn't REACT like a webapp because you
avoid a
 lot of the round-trips to the server for things that could be done on
the
 client, and you can have functionality you couldn't do otherwise (like
 instantaneous sorting of a table without touching the server for
 instance).
 
 I'm the first to admit you have to be careful in situations like this
 because it's easy to cause yourself trouble if you don't do it right.
And
 of course if they ever do decide to change browsers we're going to
have
 problems.  But this is a decision that I don't think is as clear-cut
as
 some are saying here (unless as I said it's a public site, then yes, I
 think it IS clear-cut: do it all on the server!)
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 On Thu, September 30, 2004 10:26 am, Brantley Hobbs said:
  Performance is likely to be the last thing you'll be worried about
if
  someone sneaks malicious input past your validation.
 
  Client-side form validation is just plain /wrong/!
 
  Never trust input you get back from a client.  Never.
 
  Brantley
 
  -Original Message-
  From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
  Sent: Thursday, September 30, 2004 9:58 AM
  To: Struts Users Mailing List
  Subject: RE: Validate() vs JavaScript where is the advantage?
 
  Thanks for the replies.
  Have you ever noticed a performance difference though?
  Is it significant?
  Nadia
 
 
  -Original Message-
  From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal
  Sent: Thursday, September 30, 2004 9:14 AM
  To: [EMAIL PROTECTED]
  Subject: Re: Validate() vs JavaScript where is the advantage?
 
 
  Nadia Kunkov wrote:
   Hi,
   I'm wondering if I should use validate() method of ActionForm
  instead of
  JavaScript to validate the form.  I can see the advantage of
  validate()
  when you have an internationalized application, but otherwise why
  would I
  have an overhead of going back to the server when I can do the
  validation
  on the client side?  I'm a struts newbie so I might not see the
  advantage
  of validate yet, so can someone tell me why JavaScript would be an
  inferior choice ( when internationalization is not an issue ).
  
   Thanks
   NK
  In short, you don't have control over your users' environment.
They
  could be running old browsers; they could have JavaScript disabled;
  they
  could be running a browser with non-standard JavaScript support;
their
  browser could be buggy.  Malicious users could even manually
assemble
  HTTP requests with invalid data.
 
  By using server-side validation, you take control over all of the
data
  coming into your web application.  If you leave validation to the
  browser, there is always the chance that bad data is going to sneak
  into
  your system and do something that you don't expect.
 
  -- Jeff
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
-
  To 

RE: FW: R: Detecting the previous JSP

2004-09-30 Thread Shabada, Gnaneshwer

Oops, I sent it as an attachment. I guess the mailing list doesn't take it.
Anyways, below is the rendered html code from my JSP. When I click the
DELETE button, the JS error comes on line 38 i.e, as marked below..Let me
know if you find anything

Thanks for your help







!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN





html
head
base href=http://localhost:9080/registration/editregister.jsp;
!-- COMPLETE THE CONTENT ATTRIBUTE FOR THE FOLLOWING META TAGS --
meta name=owner content=www.bisiadedokun.com
meta name=description content=short description of page
meta name=keywords content=put keywords here
meta name=review content=MMDD
meta name=security content=public or protected
!-- EDITOR USED --
meta name=GENERATOR
content=IBM WebSphere Page Designer V4.0 for Windows
!-- STYLE SHEETS --
meta http-equiv=Content-Style-Type content=text/css
link href=/registration/theme/Master.css rel=stylesheet
type=text/css
link href=/registration/theme/netscape.css rel=stylesheet
type=text/css
link href=/registration/theme/ie.css rel=stylesheet
type=text/css

style type=text/css/style
!-- BEGIN MAIN --
titleMember Registration/title

SCRIPT language=Javascript
function callDelete()
{
alert(Let's delete);
document.forms[0].action=/deleteRegistration;
alert(Let's delete again);
document.forms[0].submit();
 ERROR RIGHT HERE
}



/SCRIPT

/head
body bgcolor=#ff



table cellpadding=0 cellspacing=0 border=0 width=100%
height=100
col span=1 width=39
tbody
tr
td width=148 height=38img
src=/registration/images/odot.gif height=38 width=148 border=0/td
td bgcolor=#99 width=39 height=38img
src=/registration/images/odot.gif height=1 width=39 border=0/td
td bgcolor=#99 height=38 colspan=2
table cellpadding=0 cellspacing=0
bgcolor=#99 width=100%
border=0
tbody
tr
td align=center
class=site-titleMember Registration/td
!--TD align=rightimg
src=/registration/images/ibm_logo_sm_fff.gif height=15 width=44
border=0/TD--
/tr
/tbody
/table
/td
td rowspan=4 bgcolor=#99img
src=/registration/images/odot.gif height=1 width=10 border=0img
src=/registration/images/odot.gif height=1 width=1 border=0/td
/tr
tr
td height=33 rowspan=2/td
td rowspan=4 width=39img
src=/registration/images/odot.gif height=1 width=39 border=0/td
td colspan=2nbsp;/td
/tr
tr
td colspan=2 height=1

background=/registration/images/back_dots_66f.gif/td
/tr
tr
td rowspan=2 valign=top height=650
bgcolor=#ffimg src=/registration/images/odot.gif height=1
width=1 border=0/td
td rowspan=2 colspan=2 valign=top
table border=0 width=100% cellpadding=0
cellspacing=0
tbody
tr
td!-- BEGIN OPTIONAL
BREADCRUMBING --/td
td rowspan=7
width=10img src=/registration/images/odot.gif height=10 width=10
border=0/td
/tr
!-- BEGIN PRIMARY CONTENT --
tr
td
class=headRegister/td
/tr
!--
tr
tdfont color=#ff
br
 /font/td
/tr
--
tr
td class=subheadPlease
update the following form:/td
/tr
tr
tdimg
src=/registration/images/asterisk.gif height=15 width=15 border=0 =
a required field/td
/tr
tr
td valign=topform
name=registrationForm method=post
action=/registration/editRegistration.do
onsubmit=validateRegistrationForm(this)

jstl and the brink of madness

2004-09-30 Thread andy wix
Hi,
The following expression always evaluates to true even though I can see the 
create parameter in the request.

%@ taglib uri=jstl/c prefix=c %
c:choose
 c:when test=${empty param.create}hello/c:when
 c:otherwisegoodbye/c:otherwise
/c:choose
I set the parameter up in the previous action with:
request.setAttribute(create,create);
Any ideas?
Thanks,
Andy
_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: jstl and the brink of madness

2004-09-30 Thread Paul McCulloch
I don't think scoped attributes  parameters are the same thing. Try
http://somehost/app/mypage.jsp?create=something to set a parameter.

Paul

 -Original Message-
 From: andy wix [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 3:59 PM
 To: [EMAIL PROTECTED]
 Subject: jstl and the brink of madness
 
 
 Hi,
 
 The following expression always evaluates to true even though 
 I can see the 
 create parameter in the request.
 
 %@ taglib uri=jstl/c prefix=c %
 
 c:choose
   c:when test=${empty param.create}hello/c:when
   c:otherwisegoodbye/c:otherwise
 /c:choose
 
 I set the parameter up in the previous action with:
 request.setAttribute(create,create);
 
 Any ideas?
 
 Thanks,
 Andy
 
 _
 Express yourself with cool new emoticons 
 http://www.msn.co.uk/specials/myemo
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



Re: jstl and the brink of madness

2004-09-30 Thread Duncan Mills
Shouldn't your test be:
c:choose
c:when test=${empty requestScope.create}hello/c:when
c:otherwisegoodbye/c:otherwise
/c:choose
As you've set this as a Request attribute
Regards
Duncan Mills
andy wix wrote:
Hi,
The following expression always evaluates to true even though I can 
see the create parameter in the request.

%@ taglib uri=jstl/c prefix=c %
c:choose
 c:when test=${empty param.create}hello/c:when
 c:otherwisegoodbye/c:otherwise
/c:choose
I set the parameter up in the previous action with:
request.setAttribute(create,create);
Any ideas?
Thanks,
Andy
_
Express yourself with cool new emoticons 
http://www.msn.co.uk/specials/myemo

-
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: html:messages with multiple bundles?

2004-09-30 Thread Niall Pemberton
There are outstanding enhacement requests for this kind of feature:

http://issues.apache.org/bugzilla/show_bug.cgi?id=7892
http://issues.apache.org/bugzilla/show_bug.cgi?id=30401

Niall

- Original Message - 
From: Woodchuck [EMAIL PROTECTED]
To: struts [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 2:23 PM
Subject: html:messages with multiple bundles?


 hihi,
 
 has anyone a good way to handle displaying multiple messages that come
 from multiple bundles (resource files) on the jsp?
 
 how can i make my jsp handle messages that can come from more than one
 bundle?
 
 the reason why i need to do this is because we made a base
 application that all projects will include.  this base application
 contains generic functionality that all future projects will inherit. 
 so it has it's own bundles of messages, that has now come into the
 situation where it's possible that the returned ActionMessages or
 ActionErrors collection contains ActionMessage or ActionError objects
 with keys coming from the base bundles and the project bundles.  ie. it
 is not guaranteed that all message collection keys will come from one
 bundle.
 
 any suggestions on how to handle this is greatly appreciated as always.
 
 please and thanks,
 woodchuck
 
 
 
 
 ___
 Do you Yahoo!?
 Declare Yourself - Register online to vote today!
 http://vote.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: jstl and the brink of madness

2004-09-30 Thread Fredrik Sundberg

Try ${empty create} instead.
Regards,
/Fredrik




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



RE: FW: R: Detecting the previous JSP

2004-09-30 Thread fzlists
Found the problem!

Note that you have a submit button with the NAME submit... This is confusing the 
call to the submit() method in your JS function.  Change the name of the button to 
submit1 or something and it'll work.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 10:54 am, Shabada, Gnaneshwer said:
 
 Oops, I sent it as an attachment. I guess the mailing list doesn't take
 it.
 Anyways, below is the rendered html code from my JSP. When I click the
 DELETE button, the JS error comes on line 38 i.e, as marked below..Let me
 know if you find anything
 
 Thanks for your help
 
 
 
 
 
 
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
 
 
 
 
 
 html
 head
 base href=http://localhost:9080/registration/editregister.jsp;
 !-- COMPLETE THE CONTENT ATTRIBUTE FOR THE FOLLOWING META TAGS --
 meta name=owner content=www.bisiadedokun.com
 meta name=description content=short description of page
 meta name=keywords content=put keywords here
 meta name=review content=MMDD
 meta name=security content=public or protected
 !-- EDITOR USED --
 meta name=GENERATOR
   content=IBM WebSphere Page Designer V4.0 for Windows
 !-- STYLE SHEETS --
 meta http-equiv=Content-Style-Type content=text/css
 link href=/registration/theme/Master.css rel=stylesheet
   type=text/css
 link href=/registration/theme/netscape.css rel=stylesheet
   type=text/css
 link href=/registration/theme/ie.css rel=stylesheet
   type=text/css
 
 style type=text/css/style
 !-- BEGIN MAIN --
 titleMember Registration/title
 
 SCRIPT language=Javascript
 function callDelete()
 {
   alert(Let's delete);
   document.forms[0].action=/deleteRegistration;
   alert(Let's delete again);
   document.forms[0].submit();
  ERROR RIGHT HERE
 }
 
 
 
 /SCRIPT
 
 /head
 body bgcolor=#ff
 
 
 
 table cellpadding=0 cellspacing=0 border=0 width=100%
   height=100
   col span=1 width=39
   tbody
   tr
   td width=148 height=38img
 src=/registration/images/odot.gif height=38 width=148
 border=0/td
   td bgcolor=#99 width=39 height=38img
 src=/registration/images/odot.gif height=1 width=39 border=0/td
   td bgcolor=#99 height=38 colspan=2
   table cellpadding=0 cellspacing=0
 bgcolor=#99 width=100%
   border=0
   tbody
   tr
   td align=center
 class=site-titleMember Registration/td
   !--TD align=rightimg
 src=/registration/images/ibm_logo_sm_fff.gif height=15 width=44
 border=0/TD--
   /tr
   /tbody
   /table
   /td
   td rowspan=4 bgcolor=#99img
 src=/registration/images/odot.gif height=1 width=10 border=0img
 src=/registration/images/odot.gif height=1 width=1 border=0/td
   /tr
   tr
   td height=33 rowspan=2/td
   td rowspan=4 width=39img
 src=/registration/images/odot.gif height=1 width=39 border=0/td
   td colspan=2nbsp;/td
   /tr
   tr
   td colspan=2 height=1
 
 background=/registration/images/back_dots_66f.gif/td
   /tr
   tr
   td rowspan=2 valign=top height=650
 bgcolor=#ffimg src=/registration/images/odot.gif height=1
 width=1 border=0/td
   td rowspan=2 colspan=2 valign=top
   table border=0 width=100% cellpadding=0
 cellspacing=0
   tbody
   tr
   td!-- BEGIN OPTIONAL
 BREADCRUMBING --/td
   td rowspan=7
 width=10img src=/registration/images/odot.gif height=10 width=10
 border=0/td
   /tr
   !-- BEGIN PRIMARY CONTENT --
   tr
   td
 class=headRegister/td
   /tr
   !--
   tr
   tdfont color=#ff
 br
/font/td
   /tr
   --
   tr
   td class=subheadPlease
 update the following form:/td
   /tr
   tr
  

RE: Validate() vs JavaScript where is the advantage?

2004-09-30 Thread Nadia Kunkov
Thank you very much.
I appreciate all your inputs.
Nadia
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 10:41 AM
To: [EMAIL PROTECTED]
Subject: RE: Validate() vs JavaScript where is the advantage?


While absolutely agree with the premise that you shouldn't trust what the client sends 
you, I think this reponse is a little too rigid.  You need to take into account the 
environment your working in.

If your talking about a situation where your clients are captive (i.e., an 
internal-only application where you know the browser type coming in), you can do some 
things that you can't do on a public-facing site.

I've built a number of apps here at work that are exceptional in the sense that many 
people think they are using a fat-client because of the functionality and speed they 
see.  I could only have accomplished many of the things I have in those cases because 
we're an IE-only shop with virtually no chance of ever switching (I've been told this 
from higher-ups, so it's not my problem if they change their minds).  Some of the 
things that makes these apps unusual is because of all the client-side scripting that 
is done and all the dynamic HTML tricks I play.  It allows you to have a webapp that 
doesn't REACT like a webapp because you avoid a lot of the round-trips to the server 
for things that could be done on the client, and you can have functionality you 
couldn't do otherwise (like instantaneous sorting of a table without touching the 
server for instance).

I'm the first to admit you have to be careful in situations like this because it's 
easy to cause yourself trouble if you don't do it right.  And of course if they ever 
do decide to change browsers we're going to have problems.  But this is a decision 
that I don't think is as clear-cut as some are saying here (unless as I said it's a 
public site, then yes, I think it IS clear-cut: do it all on the server!)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 10:26 am, Brantley Hobbs said:
 Performance is likely to be the last thing you'll be worried about if
 someone sneaks malicious input past your validation.
 
 Client-side form validation is just plain /wrong/!
 
 Never trust input you get back from a client.  Never.
 
 Brantley
 
 -Original Message-
 From: Nadia Kunkov [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 9:58 AM
 To: Struts Users Mailing List
 Subject: RE: Validate() vs JavaScript where is the advantage?

 Thanks for the replies.
 Have you ever noticed a performance difference though?
 Is it significant?
 Nadia


 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Jeff Beal
 Sent: Thursday, September 30, 2004 9:14 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Validate() vs JavaScript where is the advantage?


 Nadia Kunkov wrote:
  Hi,
  I'm wondering if I should use validate() method of ActionForm
 instead of
 JavaScript to validate the form.  I can see the advantage of
 validate()
 when you have an internationalized application, but otherwise why
 would I
 have an overhead of going back to the server when I can do the
 validation
 on the client side?  I'm a struts newbie so I might not see the
 advantage
 of validate yet, so can someone tell me why JavaScript would be an
 inferior choice ( when internationalization is not an issue ).
 
  Thanks
  NK
 In short, you don't have control over your users' environment.  They
 could be running old browsers; they could have JavaScript disabled;
 they
 could be running a browser with non-standard JavaScript support; their
 browser could be buggy.  Malicious users could even manually assemble
 HTTP requests with invalid data.

 By using server-side validation, you take control over all of the data
 coming into your web application.  If you leave validation to the
 browser, there is always the chance that bad data is going to sneak
 into
 your system and do something that you don't expect.

 -- Jeff


 -
 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: jstl and the brink of madness

2004-09-30 Thread andy wix
Hi,
Thanks - requestScope.create works.
I was copying from page 12 of Core JSTL - can't belive all you read!
Cheers,
Andy
_
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/

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


RE: FW: R: Detecting the previous JSP

2004-09-30 Thread Shabada, Gnaneshwer

Dohh!! that was silly of me :)

Thanks Frank. Nice eye. I got rid of that JS problem now but it still
wouldn't recognize my action on submit. I get the following error on my
console. 

[9/30/04 11:27:48:550 EDT] 3324009f OSEListenerDi E PLGN0021E: Servlet
Request Processor Exception: Virtual Host/WebGroup Not Found : The web group
/deleteRegistration.do has not been defined


I tried changing it to /deleteRegistration.do but no effect. I have it
configured in my struts-config as

action path=/deleteRegistration
type=org.acaosa.registration.web.DeleteRegistrationAction
name=deleteForm scope=request
forward name=success
path=/WEB-INF/view/searchResults.jsp
/forward
/action

Not sure why it doesn't find it. Appreciate your help.

Thanks

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 11:21 AM
To: [EMAIL PROTECTED]
Subject: RE: FW: R: Detecting the previous JSP


Found the problem!

Note that you have a submit button with the NAME submit... This is
confusing the call to the submit() method in your JS function.  Change the
name of the button to submit1 or something and it'll work.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

 SCRIPT language=Javascript
 function callDelete()
 {
   alert(Let's delete);
   document.forms[0].action=/deleteRegistration;
   alert(Let's delete again);
   document.forms[0].submit();
  ERROR RIGHT HERE
 }
 
 
 
 /SCRIPT
 

 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to [EMAIL PROTECTED] 
Toys R Us, Inc.

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



RE: html error handling

2004-09-30 Thread Barnett, Brian W.
Can you show us your jsp code?

-Original Message-
From: Shahin Hadjikuliev [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 6:32 AM
To: [EMAIL PROTECTED]
Subject: html error handling

Hi, 
I have jsp with html:error/ tag, if an error accures its displaying
only error message , I want to display error and html form under it,
how can I achive it?

Thanx

-
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: FW: R: Detecting the previous JSP

2004-09-30 Thread Shabada, Gnaneshwer


Never mind.. I think I am really being impatient..:)

I found it, its the path to the action in the JS function. Had to set it to
full path..it works now

Thanks anyways 

-Original Message-
From: Shabada, Gnaneshwer [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 11:34 AM
To: 'Struts Users Mailing List'
Subject: RE: FW: R: Detecting the previous JSP



Dohh!! that was silly of me :)

Thanks Frank. Nice eye. I got rid of that JS problem now but it still
wouldn't recognize my action on submit. I get the following error on my
console. 

[9/30/04 11:27:48:550 EDT] 3324009f OSEListenerDi E PLGN0021E: Servlet
Request Processor Exception: Virtual Host/WebGroup Not Found : The web group
/deleteRegistration.do has not been defined


I tried changing it to /deleteRegistration.do but no effect. I have it
configured in my struts-config as

action path=/deleteRegistration
type=org.acaosa.registration.web.DeleteRegistrationAction
name=deleteForm scope=request
forward name=success
path=/WEB-INF/view/searchResults.jsp
/forward
/action

Not sure why it doesn't find it. Appreciate your help.

Thanks

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 11:21 AM
To: [EMAIL PROTECTED]
Subject: RE: FW: R: Detecting the previous JSP


Found the problem!

Note that you have a submit button with the NAME submit... This is
confusing the call to the submit() method in your JS function.  Change the
name of the button to submit1 or something and it'll work.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

 SCRIPT language=Javascript
 function callDelete()
 {
   alert(Let's delete);
   document.forms[0].action=/deleteRegistration;
   alert(Let's delete again);
   document.forms[0].submit();
  ERROR RIGHT HERE
 }
 
 
 
 /SCRIPT
 

 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to [EMAIL PROTECTED] 
Toys R Us, Inc.

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

 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to [EMAIL PROTECTED] 
Toys R Us, Inc.

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



Re: J2EE versions and Struts

2004-09-30 Thread Craig McClanahan
Struts 1.2.4 remains compatible with J2EE 1.2 or later (Servlet 2.2 or
later, and JSP 1.1 or later).  That is unlikely to be the case for
Struts 1.3, however.

Craig


On Thu, 30 Sep 2004 09:44:13 -0500, Brent Vaughn
[EMAIL PROTECTED] wrote:
 What versions of J2EE are compliant with the newest release of Struts?
 


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



RE: Struts and Quartz Scheduler

2004-09-30 Thread Mick.Knutson
This works for me:

web.xml
servlet
servlet-nameQuartzInitializer/servlet-name

servlet-classcom.baselogic.yoursos.scheduler.QuartzInitializerServlet/servlet-class
load-on-startup1/load-on-startup
/servlet

quartz-config.xml:
?xml version=1.0 encoding=ISO-8859-1 ?
quartz-config
trigger-group name=AlertSenderTriggerGroup
trigger
name=AlertSenderTrigger
className=org.quartz.SimpleTrigger
set-property
property=repeatCount
value=5/
set-property
property=repeatInterval
value=10/
set-property
property=startTime
value=04/04/1999 14:00:00/
set-property
property=endTime
value=04/04/2999 15:00:00/
/trigger
/trigger-group
job-group
name=AlertSenderJobGroup
job name=AlertSenderJob
 
className=com.baselogic.yoursos.scheduler.jobs.AlertSenderJob
 description=Alert sending Job
 durability=true
 volatility=true
 requestsRecovery=true /
/job-group
schedule jobGroup=AlertSenderJobGroup
  triggerGroup=AlertSenderTriggerGroup
  job=AlertSenderJob
  trigger=AlertSenderTrigger/
/quartz-config






-Original Message-
From: Barnett, Brian W. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 29, 2004 8:58 PM
To: 'Struts Users Mailing List '
Subject: Struts and Quartz Scheduler


Has anyone here integrated Quartz with Struts? I'm having a hard time
finding examples on this combination.

I'm using the latest version of Quartz, 1.4.2, and I'm initializing it in
web.xml like this:

servlet
servlet-name
QuartzInitializer
/servlet-name 
display-name
Quartz Initializer Servlet
/display-name 
servlet-class
org.quartz.ee.servlet.QuartzInitializerServlet
/servlet-class 
load-on-startup
1
/load-on-startup
init-param
param-nameshutdown-on-unload/param-name
param-valuetrue/param-value
/init-param
/servlet  

Anything you could share with me would be greatly appreciated. If you have a
quartz.properties file you could share, info on how you access the
QuartInitializerServlet, submit jobs, etc., I'd love to see them. Sample
code would be great.

If you know of a good document that explains it, please let me know about
it.

Thanks a bunch,
Brian Barnett

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



Help! Iterating through nested hashmap and setting properties

2004-09-30 Thread boukovska
Hi all
I have a problem with setting the values on a hierarchy of nested
properties.
I have an ActionForm which has a property A of type HashMap. A is
keyed
on
Strings, and each value of A is a Collection (ArrayList). This
collection
contains objects of type B.
I am trying to iterate through the keys A, and for each key, iterate
through
the corresponding value (which is an ArrayList of B objects). The I
want to display a property of
B
and let the user change it. I am able to display the properties of
object B
on the screen. However, for some reason the nested:text tag doesn't
work -
the textbox is there, but the input does not populate the form.
The following is what I am trying to do.
nested:iterate id=idForA property=A
nested:iterate name=idForA property=value !--this should access
collection of B objects --
nested:text property=foo !--allow user to enter a
property of B --
/nested
/nested
/nested
The problem is that when I enter a new value for foo, nothing happens;
the
value of the nested property is not set. Is it possible to iterate
through a
HashMap, and let the user update its values?
I am quite new to Struts, and urgently need
this to
work, but no luck. Any help will be really appreciated!
Thanks
Danielle



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



Visual editors for JSP's with Struts tags

2004-09-30 Thread Adam Lipscombe
Folks,
 
 
My graphic designer is having difficulties with the design view in
DreamWeaver looking at JSp's with struts tags. We have the fwasi struts tag
plugs-ins for DW.
 
Basically it seems DW design view support for JSP/Struts is rudimentary at
best, and in our case mostly doesn't work.
I think half the problem is that our JSPs use lots of @ include
directives, and this seems to confuse DW (and indeed the visual view in
JBuilder).
 
Does anyone know of a Web development tool that has a good design view that
supports JSP / Struts?
 
 
TIA - Adam
 
 


RE: FW: R: Detecting the previous JSP

2004-09-30 Thread fzlists
You shouldn't need to put the full path in, just setting the action to 
deleteRegistration.do should be sufficient (assuming it's a root path, meaning not 
something like /my/app/deleteRegistration.  Not sure why it wouldn't work, looking 
at my own code that's what I have (i.e., NOT the full path)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 11:42 am, Shabada, Gnaneshwer said:
 
 
 Never mind.. I think I am really being impatient..:)
 
 I found it, its the path to the action in the JS function. Had to set it
 to
 full path..it works now
 
 Thanks anyways
 
 -Original Message-
 From: Shabada, Gnaneshwer [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 11:34 AM
 To: 'Struts Users Mailing List'
 Subject: RE: FW: R: Detecting the previous JSP
 
 
 
 Dohh!! that was silly of me :)
 
 Thanks Frank. Nice eye. I got rid of that JS problem now but it still
 wouldn't recognize my action on submit. I get the following error on my
 console.
 
 [9/30/04 11:27:48:550 EDT] 3324009f OSEListenerDi E PLGN0021E: Servlet
 Request Processor Exception: Virtual Host/WebGroup Not Found : The web
 group
 /deleteRegistration.do has not been defined
 
 
 I tried changing it to /deleteRegistration.do but no effect. I have it
 configured in my struts-config as
 
   action path=/deleteRegistration
 type=org.acaosa.registration.web.DeleteRegistrationAction
 name=deleteForm scope=request
   forward name=success
 path=/WEB-INF/view/searchResults.jsp
   /forward
   /action
 
 Not sure why it doesn't find it. Appreciate your help.
 
 Thanks
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: RE: FW: R: Detecting the previous JSP
 
 
 Found the problem!
 
 Note that you have a submit button with the NAME submit... This is
 confusing the call to the submit() method in your JS function.  Change the
 name of the button to submit1 or something and it'll work.
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 SCRIPT language=Javascript
 function callDelete()
 {
  alert(Let's delete);
  document.forms[0].action=/deleteRegistration;
  alert(Let's delete again);
  document.forms[0].submit();
  ERROR RIGHT
 HERE
 }



 /SCRIPT

 
 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized review,
 use, disclosure or distribution is prohibited. If you are not the intended
 recipient, please contact the sender by reply email and destroy all copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized review,
 use, disclosure or distribution is prohibited. If you are not the intended
 recipient, please contact the sender by reply email and destroy all copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.
 
 -
 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: Help! Iterating through nested hashmap and setting properties

2004-09-30 Thread Jeff Beal
boukovska wrote:
Hi all
I have a problem with setting the values on a hierarchy of nested
properties.
I have an ActionForm which has a property A of type HashMap. A is
keyed
on
Strings, and each value of A is a Collection (ArrayList). This
collection
contains objects of type B.
I am trying to iterate through the keys A, and for each key, iterate
through
the corresponding value (which is an ArrayList of B objects). The I
want to display a property of
B
and let the user change it. I am able to display the properties of
object B
on the screen. However, for some reason the nested:text tag doesn't
work -
the textbox is there, but the input does not populate the form.
The following is what I am trying to do.
nested:iterate id=idForA property=A
nested:iterate name=idForA property=value !--this should access
collection of B objects --
nested:text property=foo !--allow user to enter a
property of B --
/nested
/nested
/nested
The problem is that when I enter a new value for foo, nothing happens;
the
value of the nested property is not set. Is it possible to iterate
through a
HashMap, and let the user update its values?
I am quite new to Struts, and urgently need
this to
work, but no luck. Any help will be really appreciated!
Thanks
Danielle
What is the name property on the text box elements (in the client-side 
HTML) you are trying to edit?

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

Re: Visual editors for JSP's with Struts tags

2004-09-30 Thread Rogue Chameleon
have a look at the myeclipse (www.myeclipseide.com) add-on to eclipse
(www.eclipse.org).


On Thu, 30 Sep 2004 17:36:52 +0100, Adam Lipscombe
[EMAIL PROTECTED] wrote:
 Folks,
 
 My graphic designer is having difficulties with the design view in
 DreamWeaver looking at JSp's with struts tags. We have the fwasi struts tag
 plugs-ins for DW.
 
 Basically it seems DW design view support for JSP/Struts is rudimentary at
 best, and in our case mostly doesn't work.
 I think half the problem is that our JSPs use lots of @ include
 directives, and this seems to confuse DW (and indeed the visual view in
 JBuilder).
 
 Does anyone know of a Web development tool that has a good design view that
 supports JSP / Struts?
 
 TIA - Adam
 
 



-- 
...
Rogue Chameleon
...

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



RE: Help! Iterating through nested hashmap and setting properties

2004-09-30 Thread Boukovska, Danielle
I am trying to edit property foo below

-Original Message-
From: Jeff Beal [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 5:50 PM
To: [EMAIL PROTECTED]
Subject: Re: Help! Iterating through nested hashmap and setting properties


boukovska wrote:
 Hi all
 I have a problem with setting the values on a hierarchy of nested 
 properties. I have an ActionForm which has a property A of type 
 HashMap. A is keyed
 on
 Strings, and each value of A is a Collection (ArrayList). This
 collection
 contains objects of type B.
 I am trying to iterate through the keys A, and for each key, iterate
 through
 the corresponding value (which is an ArrayList of B objects). The I
 want to display a property of
 B
 and let the user change it. I am able to display the properties of
 object B
 on the screen. However, for some reason the nested:text tag doesn't
 work -
 the textbox is there, but the input does not populate the form.
 The following is what I am trying to do.
 nested:iterate id=idForA property=A
 nested:iterate name=idForA property=value !--this should access
 collection of B objects --
 nested:text property=foo !--allow user to enter a
 property of B --
 /nested
 /nested
 /nested
 The problem is that when I enter a new value for foo, nothing happens;
 the
 value of the nested property is not set. Is it possible to iterate
 through a
 HashMap, and let the user update its values?
 I am quite new to Struts, and urgently need
 this to
 work, but no luck. Any help will be really appreciated!
 Thanks
 Danielle
What is the name property on the text box elements (in the client-side 
HTML) you are trying to edit?

-
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: Reusing methods across actions classes

2004-09-30 Thread Danilo Gurovich
Why don't you just create an abstract action and extend it?

Danilo Gurovich
Manager, Web Development
LowerMyBills.com
[EMAIL PROTECTED]
2401 Colorado Ave., 2nd Floor 
Santa Monica, CA 90404
(310) 998-6412

 


-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 3:16 AM
To: Struts User Mailing List
Subject: Reusing methods across actions classes

Hey,

 

Bit of a dummy question here but I am wondering what is the best way to
reuse methods across different action classes. Is it acceptable to make
an
instance of an action class within an action class so I can use one of
its
methods. Or would it be better to simply copy and paste the method into
the
both classes. Or should I extract all common methods into one class and
create an instance of this class as required. Any suggestions?

 

CH


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



How to handle multiploe unknown form fields

2004-09-30 Thread fzlists
I have an interesting situation, one that has never come up before, and I'm unsure how 
to deal with it...

Imagine you have some records from a database representing various skills (i.e., HTML, 
Javascript, J2EE, etc.).  Each has a SkillID associated with it.

You create a JSP that lists each skill with a drop-down next to it.  The drop-down 
allows the user to select their skill level for each skill.

When the user hits Save, you need to update all the skills for that user.

That's the scenario.  Here's the question... Each drop-down is given the name of the 
SkllID.  But how do you write an ActionForm for that?

Since the database can be expanded to include new skills at any time, it's impractical 
to add getters and setters for each SkillID, and in fact breaks low coupling goals 
anyway.

Is there a standard way of accepting what kind of amounts to an array of inputs from a 
form and getting it into an ActionForm in some way (maybe as an ArrayList or 
something?).

TIA!

Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Reusing methods across actions classes

2004-09-30 Thread Sean Schofield
It may also depend on what kind of code you are trying to reuse.  If its 
something that is action-related (populating a form, etc.) then I would 
agree with Danilo's answer.

If on the other hand, the code is related to business logic that is 
really independent of the struts portion, then I would put this in a 
common class that can be reused from as many actions as need it.  In a 
lot of my applications I use a facade for my actions to communicate with 
seperate objects relating to business logic. 

This also has the nice benefit of keeping your business logic 
independent of the particular web solution (in this case Struts) you are 
using.  In fact, you can keep your business logic the same if you decide 
to write a client server app instead!

sean
Why don't you just create an abstract action and extend it?
Danilo Gurovich
Manager, Web Development
LowerMyBills.com
[EMAIL PROTECTED]
2401 Colorado Ave., 2nd Floor 
Santa Monica, CA 90404
(310) 998-6412


-Original Message-
From: Ciaran Hanley [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 3:16 AM
To: Struts User Mailing List
Subject: Reusing methods across actions classes

Hey,

Bit of a dummy question here but I am wondering what is the best way to
reuse methods across different action classes. Is it acceptable to make
an
instance of an action class within an action class so I can use one of
its
methods. Or would it be better to simply copy and paste the method into
the
both classes. Or should I extract all common methods into one class and
create an instance of this class as required. Any suggestions?

CH
-
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: J2EE versions and Struts

2004-09-30 Thread Vic Cekvenich
Servlet 2.2; ex: Tomcat 3.
.V
Brent Vaughn wrote:
What versions of J2EE are compliant with the newest release of Struts?


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


RE: Reusing methods across actions classes

2004-09-30 Thread fzlists
Writing your own Action class that extends Action and then extending that to make each 
class is an option.  

Depending on the nature of your shared code, it might be easier to just make an 
ActionHelpers class that contains a bunch of methods, maybe a bunch of static 
methods even, depending on what the code your trying to share actually is.  

I've done this in the past because I had some common code at the start and finish of 
each Action that had to execute (and there was a reason this worked while extending 
some class didn't, but I don't frankly remember the reason now).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 1:13 pm, Danilo Gurovich said:
 Why don't you just create an abstract action and extend it?
 
 Danilo Gurovich
 Manager, Web Development
 LowerMyBills.com
 [EMAIL PROTECTED]
 2401 Colorado Ave., 2nd Floor
 Santa Monica, CA 90404
 (310) 998-6412
 
 
 
 
 -Original Message-
 From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 3:16 AM
 To: Struts User Mailing List
 Subject: Reusing methods across actions classes
 
 Hey,
 
 
 
 Bit of a dummy question here but I am wondering what is the best way to
 reuse methods across different action classes. Is it acceptable to make
 an
 instance of an action class within an action class so I can use one of
 its
 methods. Or would it be better to simply copy and paste the method into
 the
 both classes. Or should I extract all common methods into one class and
 create an instance of this class as required. Any suggestions?
 
 
 
 CH
 
 
 -
 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: FW: R: Detecting the previous JSP

2004-09-30 Thread Shabada, Gnaneshwer

Well. If I say

document.forms[0].action=/registration/deleteRegistration.do;

it doesn't recognize as registration is the context root of my app and the
url was resolved as

http://localhost:9080/deleteRegistration.do

That is why it was giving me webGroup not found error. But when I set it to

document.forms[0].action=/registration/deleteRegistration.do;

it resolves to http://localhost:9080/registration/deleteRegistration.do

and works..I thought the same as you did too, but I guess you need to give
the relative path from context root.

Gnan


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 12:44 PM
To: [EMAIL PROTECTED]
Subject: RE: FW: R: Detecting the previous JSP


You shouldn't need to put the full path in, just setting the action to
deleteRegistration.do should be sufficient (assuming it's a root path,
meaning not something like /my/app/deleteRegistration.  Not sure why it
wouldn't work, looking at my own code that's what I have (i.e., NOT the full
path)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 11:42 am, Shabada, Gnaneshwer said:
 
 
 Never mind.. I think I am really being impatient..:)
 
 I found it, its the path to the action in the JS function. Had to set it
 to
 full path..it works now
 
 Thanks anyways
 
 -Original Message-
 From: Shabada, Gnaneshwer [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 11:34 AM
 To: 'Struts Users Mailing List'
 Subject: RE: FW: R: Detecting the previous JSP
 
 
 
 Dohh!! that was silly of me :)
 
 Thanks Frank. Nice eye. I got rid of that JS problem now but it still
 wouldn't recognize my action on submit. I get the following error on my
 console.
 
 [9/30/04 11:27:48:550 EDT] 3324009f OSEListenerDi E PLGN0021E: Servlet
 Request Processor Exception: Virtual Host/WebGroup Not Found : The web
 group
 /deleteRegistration.do has not been defined
 
 
 I tried changing it to /deleteRegistration.do but no effect. I have it
 configured in my struts-config as
 
   action path=/deleteRegistration
 type=org.acaosa.registration.web.DeleteRegistrationAction
 name=deleteForm scope=request
   forward name=success
 path=/WEB-INF/view/searchResults.jsp
   /forward
   /action
 
 Not sure why it doesn't find it. Appreciate your help.
 
 Thanks
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: RE: FW: R: Detecting the previous JSP
 
 
 Found the problem!
 
 Note that you have a submit button with the NAME submit... This is
 confusing the call to the submit() method in your JS function.  Change the
 name of the button to submit1 or something and it'll work.
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 SCRIPT language=Javascript
 function callDelete()
 {
  alert(Let's delete);
  document.forms[0].action=/deleteRegistration;
  alert(Let's delete again);
  document.forms[0].submit();
  ERROR RIGHT
 HERE
 }



 /SCRIPT

 
 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized review,
 use, disclosure or distribution is prohibited. If you are not the intended
 recipient, please contact the sender by reply email and destroy all copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized review,
 use, disclosure or distribution is prohibited. If you are not the intended
 recipient, please contact the sender by reply email and destroy all copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and 

timeouts

2004-09-30 Thread Lucero, Dennis M
I am setting  connection timeouts in server.xml  but these settings do
not seem to be working.  Does struts have a timeout function?
 
 
I am he, as you are he, as you are me, and we are all together.
 


RE: FW: R: Detecting the previous JSP

2004-09-30 Thread fzlists
Well, certainly it it works, that's what counts :)  But the path should be the path 
that is in your struts-config file, the physical path shouldn't matter, i.e., if your 
JSP in in the directory structure /my/app/jsp/part1, where /my is the root of the 
webapp, and you submit a form to /some/bogus/path/delete.do, it should work fine as 
long as that path your submitting to is valid in the config file.  It's kind of a 
virtual vs. physical thing (that confused me at first frankly).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 1:26 pm, Shabada, Gnaneshwer said:
 
 Well. If I say
 
 document.forms[0].action=/registration/deleteRegistration.do;
 
 it doesn't recognize as registration is the context root of my app and
 the
 url was resolved as
 
 http://localhost:9080/deleteRegistration.do
 
 That is why it was giving me webGroup not found error. But when I set it
 to
 
 document.forms[0].action=/registration/deleteRegistration.do;
 
 it resolves to http://localhost:9080/registration/deleteRegistration.do
 
 and works..I thought the same as you did too, but I guess you need to give
 the relative path from context root.
 
 Gnan
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 12:44 PM
 To: [EMAIL PROTECTED]
 Subject: RE: FW: R: Detecting the previous JSP
 
 
 You shouldn't need to put the full path in, just setting the action to
 deleteRegistration.do should be sufficient (assuming it's a root path,
 meaning not something like /my/app/deleteRegistration.  Not sure why it
 wouldn't work, looking at my own code that's what I have (i.e., NOT the
 full
 path)
 
 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 
 On Thu, September 30, 2004 11:42 am, Shabada, Gnaneshwer said:


 Never mind.. I think I am really being impatient..:)

 I found it, its the path to the action in the JS function. Had to set it
 to
 full path..it works now

 Thanks anyways

 -Original Message-
 From: Shabada, Gnaneshwer [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 11:34 AM
 To: 'Struts Users Mailing List'
 Subject: RE: FW: R: Detecting the previous JSP



 Dohh!! that was silly of me :)

 Thanks Frank. Nice eye. I got rid of that JS problem now but it still
 wouldn't recognize my action on submit. I get the following error on my
 console.

 [9/30/04 11:27:48:550 EDT] 3324009f OSEListenerDi E PLGN0021E: Servlet
 Request Processor Exception: Virtual Host/WebGroup Not Found : The web
 group
 /deleteRegistration.do has not been defined


 I tried changing it to /deleteRegistration.do but no effect. I have it
 configured in my struts-config as

  action path=/deleteRegistration
 type=org.acaosa.registration.web.DeleteRegistrationAction
 name=deleteForm scope=request
  forward name=success
 path=/WEB-INF/view/searchResults.jsp
  /forward
  /action

 Not sure why it doesn't find it. Appreciate your help.

 Thanks

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 11:21 AM
 To: [EMAIL PROTECTED]
 Subject: RE: FW: R: Detecting the previous JSP


 Found the problem!

 Note that you have a submit button with the NAME submit... This is
 confusing the call to the submit() method in your JS function.  Change
 the
 name of the button to submit1 or something and it'll work.

 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com

 SCRIPT language=Javascript
 function callDelete()
 {
 alert(Let's delete);
 document.forms[0].action=/deleteRegistration;
 alert(Let's delete again);
 document.forms[0].submit();
  ERROR RIGHT
 HERE
 }



 /SCRIPT


 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized
 review,
 use, disclosure or distribution is prohibited. If you are not the
 intended
 recipient, please contact the sender by reply email and destroy all
 copies
 of the original message. To reply to our email administrator directly,
 send
 an email to [EMAIL PROTECTED]
 Toys R Us, Inc.

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

 
 This email message is for the sole use of the intended recipient (s) and
 may
 contain confidential and privileged information. Any unauthorized
 review,
 use, disclosure or distribution is prohibited. If you are not the
 intended
 recipient, please contact the sender by reply email and destroy 

Validator

2004-09-30 Thread Vinicius Carvalho
Hi there! I've been using Struts for quite sometime, but haven't used 
the validator yet.
So I followed the receipt provided by Struts in Action, but got no 
success at all.

Here's what I've done
Struts-config is configured for the right plugin
My ActionForm extends ValidatorForm and has no validate() method
Validator-rules.xml:
   validator name=required
  classname=org.apache.struts.validator.FieldChecks
 method=validateRequired
   methodParams=java.lang.Object,
 org.apache.commons.validator.ValidatorAction,
 org.apache.commons.validator.Field,
 org.apache.struts.action.ActionMessages,
 javax.servlet.http.HttpServletRequest
msg=validator.errors.required
javascript
  ![CDATA[
  function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
  var field = form[oRequired[x][0]];
  if (field.type == 'text' ||
  field.type == 'textarea' ||
  field.type == 'file' ||
  field.type == 'select-one' ||
  field.type == 'radio' ||
  field.type == 'password') {
var value = '';
// get field's value
if (field.type == select-one) {
  var si = field.selectedIndex;
  if (si = 0) {
value = field.options[si].value;
  }
} else {
  value = field.value;
}
if (trim(value).length == 0) { {
  if (i == 0) {
focusField = field;
  }
  fields[i++] = oRequired[x][1];
  isValid = false;
}
  }
}
if (fields.length  0) {
  focusField.focus();
  alert(fields.join('\n'));
}
return isValid;
  }
  // Trim whitespace from left and right sides of s.
  function trim(s) {
return s.replace( /^\s*/,  ).replace( /\s*$/,  );
  }
  ]]
/javascript
/validator
validation.xml:
  form name=userForm
field property=nome depends=required
  msg name=obrigatorio key=validator.errors.required/
  arg0 key=prompt.nome/
/field /form 
ApplicationResources.properties

validator.errors.required= O campo {0} é obrigatório
prompt.nome=nome
And my jsp file looks like this:
html:form action=/atualizaDadosUsuarioAction name=userForm 
type=br.com.auge.errors.action.form.UserForm onsubmit=return 
validateRequired(this)
Nome html:text property=nome name=userForm/html:texthtml:errors 
/br
/html:form
html:javascript formName=userForm/

Well, what is happening is that after I submit with no values at all, 
nothing happens, it forwards to the
correct path. And also, the javascript generated isn't inside a 
script/script block. So it's printed
on the page footer.

Where did I miss?
Thanks
Vinicius
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to handle multiploe unknown form fields

2004-09-30 Thread Bill Siggelkow
Frank,
Couldn't you create your html:select elements within logic:iterate? 
You would need to dynamically generate the name attribute using an a 
RTEXPR (or using html-el tags).

Also, LazyActionForm might help here ...
[EMAIL PROTECTED] wrote:
I have an interesting situation, one that has never come up before, and I'm unsure how 
to deal with it...
Imagine you have some records from a database representing various skills (i.e., HTML, 
Javascript, J2EE, etc.).  Each has a SkillID associated with it.
You create a JSP that lists each skill with a drop-down next to it.  The drop-down 
allows the user to select their skill level for each skill.
When the user hits Save, you need to update all the skills for that user.
That's the scenario.  Here's the question... Each drop-down is given the name of the 
SkllID.  But how do you write an ActionForm for that?
Since the database can be expanded to include new skills at any time, it's impractical 
to add getters and setters for each SkillID, and in fact breaks low coupling goals 
anyway.
Is there a standard way of accepting what kind of amounts to an array of inputs from a 
form and getting it into an ActionForm in some way (maybe as an ArrayList or 
something?).
TIA!
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

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

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


Re: How to handle multiploe unknown form fields

2004-09-30 Thread Niall Pemberton
You simply need a property in your ActionForm that returns a collection of
skill beans and used the indexed attribute on the html tags. The
isssue that most people have problems with is when using a Request scope
ActionForm you need to populate your collection with the right number of
skill beans - the way to handle this is some kind of lazy list processing
for that property. Search the archives on indexed properties and lazy list
processing.

In your jsp...

logic:iterate name=skillsForm property=skills id=skills
   html:text name=skills property=skillid indexed=true/
   html:select name=skills property=skillLevel indexed=true
html:option value=1Low/html:option
html:option value=2Medium/html:option
html:option value=3High/html:option
   /html:select
/logic:iterate

The trick is to name the id attribute to the same as the property in the
form which returns the collection, that way Struts will generate something
like:

 input type=text name=skills[x].skillid value=../


The lazy ActionForms I wrote have the lazy list behaviour built in

http://www.niallp.pwp.blueyonder.co.uk/#lazydynabean

Niall


- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 6:19 PM
Subject: How to handle multiploe unknown form fields


 I have an interesting situation, one that has never come up before, and
I'm unsure how to deal with it...

 Imagine you have some records from a database representing various skills
(i.e., HTML, Javascript, J2EE, etc.).  Each has a SkillID associated with
it.

 You create a JSP that lists each skill with a drop-down next to it.  The
drop-down allows the user to select their skill level for each skill.

 When the user hits Save, you need to update all the skills for that user.

 That's the scenario.  Here's the question... Each drop-down is given the
name of the SkllID.  But how do you write an ActionForm for that?

 Since the database can be expanded to include new skills at any time, it's
impractical to add getters and setters for each SkillID, and in fact breaks
low coupling goals anyway.

 Is there a standard way of accepting what kind of amounts to an array of
inputs from a form and getting it into an ActionForm in some way (maybe as
an ArrayList or something?).

 TIA!



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



RE: Validator

2004-09-30 Thread Charles . Gouin-Vallerand
Hi Vinicius,

An easy question, have you put the right attribute in the
struts-config.xml in the actionMapping ?
You need to put the xml attribute validate=true and an input for the page
you want to return if the validation throw an error. An exemple :

action path=/createMPFromCollection
type=plateinv.actions.plate.MPCreateAction
name=mpCollectionForm
parameter=method
validate=true
input=tiles.plate.master.create.option
forward name=createMP
path=tiles.plate.master.create.confirmationMP/
/action

Charles

-Original Message-
From: Vinicius Carvalho [mailto:[EMAIL PROTECTED]
Sent: September 30, 2004 1:43 PM
To: [EMAIL PROTECTED]
Subject: Validator


Hi there! I've been using Struts for quite sometime, but haven't used 
the validator yet.
So I followed the receipt provided by Struts in Action, but got no 
success at all.

Here's what I've done

Struts-config is configured for the right plugin
My ActionForm extends ValidatorForm and has no validate() method

Validator-rules.xml:

validator name=required
   classname=org.apache.struts.validator.FieldChecks
  method=validateRequired
methodParams=java.lang.Object,
  org.apache.commons.validator.ValidatorAction,
  org.apache.commons.validator.Field,
  org.apache.struts.action.ActionMessages,
  javax.servlet.http.HttpServletRequest
 msg=validator.errors.required
javascript
   ![CDATA[
   function validateRequired(form) {
 var isValid = true;
 var focusField = null;
 var i = 0;
 var fields = new Array();
 oRequired = new required();
 for (x in oRequired) {
   var field = form[oRequired[x][0]];

   if (field.type == 'text' ||
   field.type == 'textarea' ||
   field.type == 'file' ||
   field.type == 'select-one' ||
   field.type == 'radio' ||
   field.type == 'password') {

 var value = '';

 // get field's value
 if (field.type == select-one) {
   var si = field.selectedIndex;
   if (si = 0) {
 value = field.options[si].value;
   }
 } else {
   value = field.value;
 }

 if (trim(value).length == 0) { {
   if (i == 0) {
 focusField = field;
   }
   fields[i++] = oRequired[x][1];
   isValid = false;
 }
   }
 }

 if (fields.length  0) {
   focusField.focus();
   alert(fields.join('\n'));
 }

 return isValid;
   }

   // Trim whitespace from left and right sides of s.
   function trim(s) {
 return s.replace( /^\s*/,  ).replace( /\s*$/,  );
   }

   ]]
 /javascript
 /validator


validation.xml:

   form name=userForm
 field property=nome depends=required
   msg name=obrigatorio key=validator.errors.required/
   arg0 key=prompt.nome/
 /field /form 
ApplicationResources.properties

validator.errors.required= O campo {0} é obrigatório
prompt.nome=nome


And my jsp file looks like this:

html:form action=/atualizaDadosUsuarioAction name=userForm 
type=br.com.auge.errors.action.form.UserForm onsubmit=return 
validateRequired(this)
Nome html:text property=nome name=userForm/html:texthtml:errors 
/br
/html:form
html:javascript formName=userForm/


Well, what is happening is that after I submit with no values at all, 
nothing happens, it forwards to the
correct path. And also, the javascript generated isn't inside a 
script/script block. So it's printed
on the page footer.

Where did I miss?

Thanks

Vinicius

-
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 handle multiploe unknown form fields

2004-09-30 Thread fzlists
I understand the JSP side of this eqation as you wrote it, although I should have said 
I was looking for a solution that doesn't use Struts taglibs because I try to avoid 
them at all costs, but that aside...

I'm still unclear however on what the ActionForm does... Using this concept, do I HAVE 
to use the LazyActionForm you wrote?  I'd prefer to only use things that are built-in 
to Struts, and unless I'm missing it in the docs, that's not.

The question I'm getting at is that, like I said, the JSP code you wrote makes sense, 
but what will put the submitted parameters into the collection in the ActionForm when 
the submission happens?  That's the part I don't see.  Thanks for your help!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 1:51 pm, Niall Pemberton said:
 You simply need a property in your ActionForm that returns a collection of
 skill beans and used the indexed attribute on the html tags. The
 isssue that most people have problems with is when using a Request
 scope
 ActionForm you need to populate your collection with the right number of
 skill beans - the way to handle this is some kind of lazy list
 processing
 for that property. Search the archives on indexed properties and lazy list
 processing.
 
 In your jsp...
 
 logic:iterate name=skillsForm property=skills id=skills
html:text name=skills property=skillid indexed=true/
html:select name=skills property=skillLevel indexed=true
 html:option value=1Low/html:option
 html:option value=2Medium/html:option
 html:option value=3High/html:option
/html:select
 /logic:iterate
 
 The trick is to name the id attribute to the same as the property in the
 form which returns the collection, that way Struts will generate something
 like:
 
  input type=text name=skills[x].skillid value=../
 
 
 The lazy ActionForms I wrote have the lazy list behaviour built in
 
 http://www.niallp.pwp.blueyonder.co.uk/#lazydynabean
 
 Niall
 
 
 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 6:19 PM
 Subject: How to handle multiploe unknown form fields
 
 
 I have an interesting situation, one that has never come up before, and
 I'm unsure how to deal with it...

 Imagine you have some records from a database representing various
 skills
 (i.e., HTML, Javascript, J2EE, etc.).  Each has a SkillID associated with
 it.

 You create a JSP that lists each skill with a drop-down next to it.  The
 drop-down allows the user to select their skill level for each skill.

 When the user hits Save, you need to update all the skills for that
 user.

 That's the scenario.  Here's the question... Each drop-down is given the
 name of the SkllID.  But how do you write an ActionForm for that?

 Since the database can be expanded to include new skills at any time,
 it's
 impractical to add getters and setters for each SkillID, and in fact
 breaks
 low coupling goals anyway.

 Is there a standard way of accepting what kind of amounts to an array of
 inputs from a form and getting it into an ActionForm in some way (maybe as
 an ArrayList or something?).

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

Using WildCards

2004-09-30 Thread Jose Alecio Carvalho
 Hi! I'm having some troubles using WildCards. I have
a Action declaration like this:

action path=/*OperationAction 
type=alecio.presentation.web.action.{1}OperationAction

name=OperationForm
validate=true
scope=request
input={1}HomePage
parameter=operation
className=alecio.tech.presentation.web.struts.OperationActionMapping
  !-- initial properties --
set-property property=structureName
value=structure{1}Model/
 !-- forwards --
  forward name=createPage path={1}CreatePage/
  forward name=editPage path={1}EditPage /
/action


The WildCard for this declaration works fine with all
the items, except the one which is into the
set-property: 

set-property property=structureName
value=structure{1}Model/

It doesn't replace the flag. How can i do such a
thing?

thanks!

Alecio





___ 
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! 
http://br.acesso.yahoo.com/

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



Re: How to handle multiploe unknown form fields

2004-09-30 Thread bmf5





Frank,

Will this help?  http://www.reumann.net/struts/nested.do

You didn't say anything about JSTL.  Just today I'm working on populating a
checkbox field in an object that's contained in a list.  Oops.  I just
remembered I'm using html-el too.  I haven't tried it with with plain html.
This is getting it done tho'.

c:forEach items=${workQueueForm.workQueueList} var=workQueue varStatus=
status

   tr 
  td class=Data_AlignMiddle
html-el:checkbox property=
workQueueList[${status.index}].checked /

  /td

btw - how do you guys get code in your email w/o it messing up the
archives?





   
 [EMAIL PROTECTED] 
 om
To 
 09/30/2004 01:54  [EMAIL PROTECTED]  
 PM cc 
   
   Subject 
 Please respond to Re: How to handle multiploe unknown 
   Struts Users   form fields 
   Mailing List   
 [EMAIL PROTECTED] 
  he.org  
   
   
   




I understand the JSP side of this eqation as you wrote it, although I
should have said I was looking for a solution that doesn't use Struts
taglibs because I try to avoid them at all costs, but that aside...

I'm still unclear however on what the ActionForm does... Using this
concept, do I HAVE to use the LazyActionForm you wrote?  I'd prefer to only
use things that are built-in to Struts, and unless I'm missing it in the
docs, that's not.

The question I'm getting at is that, like I said, the JSP code you wrote
makes sense, but what will put the submitted parameters into the collection
in the ActionForm when the submission happens?  That's the part I don't
see.  Thanks for your help!

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 1:51 pm, Niall Pemberton said:
 You simply need a property in your ActionForm that returns a collection
of
 skill beans and used the indexed attribute on the html tags. The
 isssue that most people have problems with is when using a Request
 scope
 ActionForm you need to populate your collection with the right number of
 skill beans - the way to handle this is some kind of lazy list
 processing
 for that property. Search the archives on indexed properties and lazy
list
 processing.

 In your jsp...

 logic:iterate name=skillsForm property=skills id=skills
html:text name=skills property=skillid indexed=true/
html:select name=skills property=skillLevel indexed=true
 html:option value=1Low/html:option
 html:option value=2Medium/html:option
 html:option value=3High/html:option
/html:select
 /logic:iterate

 The trick is to name the id attribute to the same as the property in
the
 form which returns the collection, that way Struts will generate
something
 like:

  input type=text name=skills[x].skillid value=../


 The lazy ActionForms I wrote have the lazy list behaviour built in

 http://www.niallp.pwp.blueyonder.co.uk/#lazydynabean

 Niall


 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, September 30, 2004 6:19 PM
 Subject: How to handle multiploe unknown form fields


 I have an interesting situation, one that has never come up before, and
 I'm unsure how to deal with it...

 Imagine you have some records from a database representing various
 skills
 (i.e., HTML, Javascript, J2EE, etc.).  Each has a SkillID associated with
 it.

 You create a JSP that lists each skill with a drop-down next to it.  The
 drop-down allows the user to select their skill level for each skill.

 When the user hits Save, you need to update all the skills for that
 user.

 That's the scenario.  Here's the question... Each drop-down is given the
 name of the SkllID.  But how do you write an ActionForm for that?

 Since the database can be expanded to include new skills at any time,
 it's
 impractical to add getters and setters for each SkillID, and in fact
 breaks
 low coupling goals anyway.

 Is there a standard way of accepting what kind of amounts to an array of
 inputs from a form and 

Re: Using WildCards

2004-09-30 Thread Don Brown
Unfortunately, set-property is processed at config parsing time,
rather than runtime, so it is not possible to use wildcard replacement
in it.

Don


On Thu, 30 Sep 2004 14:59:17 -0300 (ART), Jose Alecio Carvalho
[EMAIL PROTECTED] wrote:
  Hi! I'm having some troubles using WildCards. I have
 a Action declaration like this:
 
 action path=/*OperationAction
 type=alecio.presentation.web.action.{1}OperationAction
 
 name=OperationForm
 validate=true
 scope=request
 input={1}HomePage
 parameter=operation
 className=alecio.tech.presentation.web.struts.OperationActionMapping
   !-- initial properties --
 set-property property=structureName
 value=structure{1}Model/
  !-- forwards --
   forward name=createPage path={1}CreatePage/
   forward name=editPage path={1}EditPage /
 /action
 
 The WildCard for this declaration works fine with all
 the items, except the one which is into the
 set-property:
 
 set-property property=structureName
 value=structure{1}Model/
 
 It doesn't replace the flag. How can i do such a
 thing?
 
 thanks!
 
 Alecio
 
 
 ___
 Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! 
 http://br.acesso.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: timeouts

2004-09-30 Thread James Mitchell
No, Struts does not control session timeouts



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message - 
From: Lucero, Dennis M [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:26 PM
Subject: timeouts


I am setting  connection timeouts in server.xml  but these settings do
not seem to be working.  Does struts have a timeout function?
 
 
I am he, as you are he, as you are me, and we are all together.
 




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



RE: Struts and Quartz Scheduler

2004-09-30 Thread Wiebe de Jong
Starting Quartz from a servlet is not a good idea, use a Plugin instead.

Reason:

I am running on the JBoss application server, and the threads that Quartz
creates on startup are attached to the app server when using the servlet
method. Everything works fine, but when your webapp is shutdown, the threads
keep going. The threads do not stop until the app server is stopped. So, if
you do a hot deploy (just replace the .ear) of your application, which I do
quite often during development, you'll end up with multiples of your jobs
executing at the same time.

Using plugin:

If you use a Struts plugin, the threads stop when the webapp stops, even
when doing hot deploys. In the plugin, the init() method gets called once
when Struts starts up and the destroy() method gets called once when Struts
shuts down. 

In my code below, I am called jobs implemented as stateless session beans.
Your jobs might be implemented differently.

Code:

Web.xml: 
Nothing here because you are not using a servlet

Struts-config.xml:
Add this line:

  plug-in className=com.mycompany.myapp.QuartzPlugin /

QuartzPlugin.java:

package com.mycompany.myapp;

import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.commons.logging.*;
import org.apache.struts.action.*;
import org.apache.struts.config.*;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.jobs.ee.ejb.EJBInvokerJob;

import java.util.*;

public class QuartzPlugin implements PlugIn {

  private static Log log = LogFactory.getLog(QuartzPlugin.class);

  private String ECOM_GROUP = eComGroup;

Scheduler sched;

  public void init(ActionServlet servlet, ModuleConfig moduleConfig)
throws ServletException {

log.info(Quartz starting);

//  Scheduler sched;
try {
  sched = StdSchedulerFactory.getDefaultScheduler();
  sched.start();
} catch (Exception e) {
  log.info(Quartz Scheduler failed to initialize:  + e.toString());
  throw new ServletException(e);
}

log.info(Initializing jobs...);

addJob(sched, Heartbeat, HeartbeatJob, execute, 0 0/15 * * * ?);
// every 15 minutes
addJob(sched, ExpiredTrial, ExpiredTrialJob, execute, 0 0 20/24 *
* ?); // every day at 8pm

log.debug(Quartz started);  
  }

  private void addJob(Scheduler sched, String jobName, String jndiName,
String methodName, String timing) {
JobDetail jd = new JobDetail(jobName, ECOM_GROUP, EJBInvokerJob.class);
jd.getJobDataMap().put(EJBInvokerJob.EJB_JNDI_NAME_KEY, jndiName);
jd.getJobDataMap().put(EJBInvokerJob.EJB_METHOD_KEY, methodName);
Object[] jdArgs = new Object[0];
jd.getJobDataMap().put(args, jdArgs);
CronTrigger cronTrigger = new CronTrigger(jobName, ECOM_GROUP);   
try {
  cronTrigger.setCronExpression(timing);
  sched.scheduleJob(jd, cronTrigger);
} catch (Exception e) {
  e.printStackTrace();
}
  }
  
  public void destroy() {
log.info(Quartz stopping);

try {
sched.shutdown();
} catch (SchedulerException ex) {
ex.printStackTrace();
}
sched = null;
  }

}


I think I'll put this into my blog.

Wiebe de Jong
http://frontierj.blogspot.com/


-Original Message-
From: Thomas Vogt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 29, 2004 10:08 PM
To: Struts Users Mailing List
Subject: AW: Struts and Quartz Scheduler

You need a class to be executed as Job

public final class BerechnungsJob implements Job
{
 /* (Kein Javadoc)
  * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
  */
 public void execute(JobExecutionContext context) throws
JobExecutionException
 {
...
 }
}

and you need a servlet that looks like this to init the Job Trigger

32  /***
33   * Die Klasse dient als Listener für den Servlet Container um den Timer
im Hintergrund laufen zu lassen.
34   *
36   * @version Version 1.0 27.08.2004
37   */
38  
39  public class TimerServlet implements Servlet
40  {
41  
42  /***
43   * @see javax.servlet.Servlet#init(ServletConfig)
44   */
45  public void init(ServletConfig arg0) throws ServletException
46  {
47  SchedulerFactory schedFact = new
org.quartz.impl.StdSchedulerFactory();
48  JobDetail jobDetail = new JobDetail(Calculation Timer,
Calculation Timer, BerechnungsJob.class);
49  CronTrigger trigger = new CronTrigger(Calculation Timer,
Calculation Timer);
50  
51  try
52  {
53  trigger.setCronExpression(0 0/5 * * * ?);
54  Scheduler sched = schedFact.getScheduler();
55  sched.start();
56  sched.scheduleJob(jobDetail, trigger);
57  }
58  catch (Exception e)
59  {
60  e.printStackTrace();
61  }
62  }
63  
64  /***
65   * @see javax.servlet.Servlet#getServletConfig()
66   */
67  public 

Page refresh results in multiple calls to form bean?

2004-09-30 Thread Tom McCobb
I have a templated page.  In a detail display section (in Detail.jsp), after
an update, I forward back to the main page (call it Master.jsp).  I also
have a search section (Search.jsp) on the page.  I put a log statement in a
getter on the Form Bean behind Search.jsp.  I notice that when I do
something to kick off an update of Detail.jsp and it forwards back to
Master.jsp, the getter in SearchForm gets called not just once (which I
would expect) but three or four times.  Is there some switch I should be
setting to avoid this?  Is it normal, but not a significant performance hit
anyway?

Thanks.

T. McCobb


validator for radio button does not work

2004-09-30 Thread Jayaraman . Dorai
the client side validator for radio button does not work for required
validation.

The validation rules check for field.type==radio, but the field.type is
'undefined' when I tried an alert. But field[0].type returned radio. The
validation_rules.xml has field.type==radio check all over. Has anyone
successfully used this. Since radio buttons usually have one selected as
default, this validation may be overlooked. But my requirement specifies
not to have a default for the radio, but a validation that it is required.

Please let me know if I'm missing anything.
Jayaraman





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



RE: Validator

2004-09-30 Thread Charles . Gouin-Vallerand
Do you have an error in server console when you validate ? I already had a
problem like that and the validation was not complete. Do you use the server
side validation or the client side ? I have never use the client side
validation, so I cannot help you with it.

Charles

-Original Message-
From: Vinicius Carvalho [mailto:[EMAIL PROTECTED]
Sent: September 30, 2004 2:26 PM
To: Struts Users Mailing List
Subject: Re: Validator


[EMAIL PROTECTED] wrote:

Hi Vinicius,
   
   An easy question, have you put the right attribute in the
struts-config.xml in the actionMapping ?
You need to put the xml attribute validate=true and an input for the page
you want to return if the validation throw an error. An exemple :

   action path=/createMPFromCollection
   type=plateinv.actions.plate.MPCreateAction
   name=mpCollectionForm
   parameter=method
   validate=true
   input=tiles.plate.master.create.option
   forward name=createMP
path=tiles.plate.master.create.confirmationMP/
   /action

Charles

-Original Message-
From: Vinicius Carvalho [mailto:[EMAIL PROTECTED]
Sent: September 30, 2004 1:43 PM
To: [EMAIL PROTECTED]
Subject: Validator


Hi there! I've been using Struts for quite sometime, but haven't used 
the validator yet.
So I followed the receipt provided by Struts in Action, but got no 
success at all.

Here's what I've done

Struts-config is configured for the right plugin
My ActionForm extends ValidatorForm and has no validate() method

Validator-rules.xml:

validator name=required
   classname=org.apache.struts.validator.FieldChecks
  method=validateRequired
methodParams=java.lang.Object,
  org.apache.commons.validator.ValidatorAction,
  org.apache.commons.validator.Field,
  org.apache.struts.action.ActionMessages,
  javax.servlet.http.HttpServletRequest
 msg=validator.errors.required
javascript
   ![CDATA[
   function validateRequired(form) {
 var isValid = true;
 var focusField = null;
 var i = 0;
 var fields = new Array();
 oRequired = new required();
 for (x in oRequired) {
   var field = form[oRequired[x][0]];

   if (field.type == 'text' ||
   field.type == 'textarea' ||
   field.type == 'file' ||
   field.type == 'select-one' ||
   field.type == 'radio' ||
   field.type == 'password') {

 var value = '';

 // get field's value
 if (field.type == select-one) {
   var si = field.selectedIndex;
   if (si = 0) {
 value = field.options[si].value;
   }
 } else {
   value = field.value;
 }

 if (trim(value).length == 0) { {
   if (i == 0) {
 focusField = field;
   }
   fields[i++] = oRequired[x][1];
   isValid = false;
 }
   }
 }

 if (fields.length  0) {
   focusField.focus();
   alert(fields.join('\n'));
 }

 return isValid;
   }

   // Trim whitespace from left and right sides of s.
   function trim(s) {
 return s.replace( /^\s*/,  ).replace( /\s*$/,  );
   }

   ]]
 /javascript
 /validator


validation.xml:

   form name=userForm
 field property=nome depends=required
   msg name=obrigatorio key=validator.errors.required/
   arg0 key=prompt.nome/
 /field /form 
ApplicationResources.properties

validator.errors.required= O campo {0} é obrigatório
prompt.nome=nome


And my jsp file looks like this:

html:form action=/atualizaDadosUsuarioAction name=userForm 
type=br.com.auge.errors.action.form.UserForm onsubmit=return 
validateRequired(this)
Nome html:text property=nome name=userForm/html:texthtml:errors 
/br
/html:form
html:javascript formName=userForm/


Well, what is happening is that after I submit with no values at all, 
nothing happens, it forwards to the
correct path. And also, the javascript generated isn't inside a 
script/script block. So it's printed
on the page footer.

Where did I miss?

Thanks

Vinicius

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

Yep, both attributes are set. Any ideas?

Thanks


RE: timeouts

2004-09-30 Thread David Suarez
Web.xml has a timeout value you may want to make sure is not there.  I
believe the webapp takes precedence over the server settings if they are
set.  

Regards...djsuarez

-Original Message-
From: Lucero, Dennis M [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 12:26 PM
To: [EMAIL PROTECTED]
Subject: timeouts

I am setting  connection timeouts in server.xml  but these settings do
not seem to be working.  Does struts have a timeout function?
 
 
I am he, as you are he, as you are me, and we are all together.
 




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



AW: RE: Struts and Quartz Scheduler

2004-09-30 Thread Thomas Vogt
Hmm
never had any of the problems you mentioned with my app and I do WAR HOT
reload quite often. I never experienced the behaviour you mentioned on my
Tomcat 5 but maybe thats different for JBoss.
But since you mentioned it I will change it in my app too, so it is
compatible with JBoss too.

Thanks for the tip
;)
Thomas

- Original-Nachricht 
Von: Struts Users Mailing List [EMAIL PROTECTED]
An: 'Struts Users Mailing List' [EMAIL PROTECTED], 'Thomas Vogt'
[EMAIL PROTECTED]
Betreff: RE: Struts and Quartz Scheduler
Datum: 30/09/04 20:26

 Starting Quartz from a servlet is not a good idea, use a Plugin instead.
 
 Reason:
 
 I am running on the JBoss application server, and the threads that Quartz
 creates on startup are attached to the app server when using the servlet
 method. Everything works fine, but when your webapp is shutdown, the
threads
 keep going. The threads do not stop until the app server is stopped. So,
if
 you do a hot deploy (just replace the .ear) of your application, which I
do
 quite often during development, you'll end up with multiples of your jobs
 executing at the same time.
 
 Using plugin:
 
 If you use a Struts plugin, the threads stop when the webapp stops, even
 when doing hot deploys. In the plugin, the init() method gets called once
 when Struts starts up and the destroy() method gets called once when
Struts
 shuts down. 


 
 In my code below, I am called jobs implemented as stateless session beans.
 Your jobs might be implemented differently.
 
 Code:
 
 Web.xml: 
 Nothing here because you are not using a servlet
 
 Struts-config.xml:
 Add this line:
 
   lt;plug-in className=quot;com.mycompany.myapp.QuartzPluginquot; /gt;
 
 QuartzPlugin.java:
 
 package com.mycompany.myapp;
 
 import javax.servlet.*;
 import javax.servlet.http.*;
 import org.apache.commons.logging.*;
 import org.apache.struts.action.*;
 import org.apache.struts.config.*;
 
 import org.quartz.*;
 import org.quartz.impl.StdSchedulerFactory;
 import org.quartz.jobs.ee.ejb.EJBInvokerJob;
 
 import java.util.*;
 
 public class QuartzPlugin implements PlugIn {
 
   private static Log log = LogFactory.getLog(QuartzPlugin.class);
 
   private String ECOM_GROUP = quot;eComGroupquot;;
 
   Scheduler sched;
 
   public void init(ActionServlet servlet, ModuleConfig moduleConfig)
 throws ServletException {
 
 log.info(quot;Quartz startingquot;);
 
 //Scheduler sched;
 try {
   sched = StdSchedulerFactory.getDefaultScheduler();
   sched.start();
 } catch (Exception e) {
   log.info(quot;Quartz Scheduler failed to initialize: quot; +
e.toString());
   throw new ServletException(e);
 }
 
 log.info(quot;Initializing jobs...quot;);
 
 addJob(sched, quot;Heartbeatquot;, quot;HeartbeatJobquot;,
quot;executequot;, quot;0 0/15 * * * ?quot;);
 // every 15 minutes
 addJob(sched, quot;ExpiredTrialquot;, quot;ExpiredTrialJobquot;,
quot;executequot;, quot;0 0 20/24 *
 * ?quot;); // every day at 8pm
 
 log.debug(quot;Quartz startedquot;);  
   }
 
   private void addJob(Scheduler sched, String jobName, String jndiName,
 String methodName, String timing) {
 JobDetail jd = new JobDetail(jobName, ECOM_GROUP,
EJBInvokerJob.class);
 jd.getJobDataMap().put(EJBInvokerJob.EJB_JNDI_NAME_KEY, jndiName);
 jd.getJobDataMap().put(EJBInvokerJob.EJB_METHOD_KEY, methodName);
 Object[] jdArgs = new Object[0];
 jd.getJobDataMap().put(quot;argsquot;, jdArgs);
 CronTrigger cronTrigger = new CronTrigger(jobName, ECOM_GROUP);   
 try {
   cronTrigger.setCronExpression(timing);
   sched.scheduleJob(jd, cronTrigger);
 } catch (Exception e) {
   e.printStackTrace();
 }
   }
   
   public void destroy() {
 log.info(quot;Quartz stoppingquot;);
 
   try {
   sched.shutdown();
   } catch (SchedulerException ex) {
   ex.printStackTrace();
   }
   sched = null;
   }
 
 }
 
 
 I think I'll put this into my blog.
 
 Wiebe de Jong
 http://frontierj.blogspot.com/
 
 
 -Original Message-
 From: Thomas Vogt [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 29, 2004 10:08 PM
 To: Struts Users Mailing List
 Subject: AW: Struts and Quartz Scheduler
 
 You need a class to be executed as Job
 
 public final class BerechnungsJob implements Job
 {
  /* (Kein Javadoc)
   * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
   */
  public void execute(JobExecutionContext context) throws
 JobExecutionException
  {
 ...
  }
 }
 
 and you need a servlet that looks like this to init the Job Trigger
 
 32  /***
 33   * Die Klasse dient als Listener für den Servlet Container um den
Timer
 im Hintergrund laufen zu lassen.
 34   *
 36   * @version Version 1.0 27.08.2004
 37   */
 38  
 39  public class TimerServlet implements Servlet
 40  {
 41  
 42  /***
 43   * @see 

Re: Validator

2004-09-30 Thread Gabriel França Campolina
Olá Vinicius,

Poste o seu mapeamento de suas action no struts-config, e o mapeamento
dos seus form, para que eu possa analizar? Verifique o log gerado pelo
seu container web(Tomcat, JBoss etc), em geral eles listam a maioria
dos problemas da sua aplicação.

Gabriel F Campolina
Analista desenvolvedor Java
Stefanini IT Solutions - BH
 


On Thu, 30 Sep 2004 14:33:51 -0300, Vinicius Carvalho
[EMAIL PROTECTED] wrote:
 Hi there! I've been using Struts for quite sometime, but haven't used
 the validator yet.
 So I followed the receipt provided by Struts in Action, but got no
 success at all.
 
 Here's what I've done
 
 Struts-config is configured for the right plugin
 My ActionForm extends ValidatorForm and has no validate() method
 
 Validator-rules.xml:
 
validator name=required
   classname=org.apache.struts.validator.FieldChecks
  method=validateRequired
methodParams=java.lang.Object,
  org.apache.commons.validator.ValidatorAction,
  org.apache.commons.validator.Field,
  org.apache.struts.action.ActionMessages,
  javax.servlet.http.HttpServletRequest
 msg=validator.errors.required
 javascript
   ![CDATA[
   function validateRequired(form) {
 var isValid = true;
 var focusField = null;
 var i = 0;
 var fields = new Array();
 oRequired = new required();
 for (x in oRequired) {
   var field = form[oRequired[x][0]];
 
   if (field.type == 'text' ||
   field.type == 'textarea' ||
   field.type == 'file' ||
   field.type == 'select-one' ||
   field.type == 'radio' ||
   field.type == 'password') {
 
 var value = '';
 
 // get field's value
 if (field.type == select-one) {
   var si = field.selectedIndex;
   if (si = 0) {
 value = field.options[si].value;
   }
 } else {
   value = field.value;
 }
 
 if (trim(value).length == 0) { {
   if (i == 0) {
 focusField = field;
   }
   fields[i++] = oRequired[x][1];
   isValid = false;
 }
   }
 }
 
 if (fields.length  0) {
   focusField.focus();
   alert(fields.join('\n'));
 }
 
 return isValid;
   }
 
   // Trim whitespace from left and right sides of s.
   function trim(s) {
 return s.replace( /^\s*/,  ).replace( /\s*$/,  );
   }
 
   ]]
 /javascript
 /validator
 
 validation.xml:
 
   form name=userForm
 field property=nome depends=required
   msg name=obrigatorio key=validator.errors.required/
   arg0 key=prompt.nome/
 /field /form
 ApplicationResources.properties
 
 validator.errors.required= O campo {0} é obrigatório
 prompt.nome=nome
 
 And my jsp file looks like this:
 
 html:form action=/atualizaDadosUsuarioAction name=userForm
 type=br.com.auge.errors.action.form.UserForm onsubmit=return
 validateRequired(this)
 Nome html:text property=nome name=userForm/html:texthtml:errors
 /br
 /html:form
 html:javascript formName=userForm/
 
 Well, what is happening is that after I submit with no values at all,
 nothing happens, it forwards to the
 correct path. And also, the javascript generated isn't inside a
 script/script block. So it's printed
 on the page footer.
 
 Where did I miss?
 
 Thanks
 
 Vinicius
 
 -
 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]



Tiles definition file

2004-09-30 Thread kevin_gutch
Has anyone run across this issue? 

org.apache.jasper.JasperException: Can't get definitions factory from 
context.

I realize the app can not locate the tiles-defs.xml but nit sure why. I 
have never really had this problem before.

My Struts-Config.xml plug-in section looks like


plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames 
value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/
/plug-in
plug-in className=org.apache.struts.tiles.TilesPlugin
set-property property=definitions-config 
value=/WEB-INF/tiles-defs.xml/
set-property property=definitions-debug value=2/
set-property property=definitions-parser-details value=2/
set-property property=definitions-parser-validate 
value=true/
/plug-in 

Thanks,
Kevin

Error Message for Struts Validation

2004-09-30 Thread Caroline Jen
I use the validation.xml to validate the properties in
my form bean.  The validation works; but, the error
messages do not work as I expected.

While I have customized error messages prepared, the
error message displayed in the browser window for my
intentional violation are like:
. null is required
. null is required

I also wonder how to show error messages if there are
more than one validation check for a certain property.
 For example, depends=required,mask.

For example, in my validation.xml, I have:
[CODE]
  form name=editTitleForm
 field
property=document
depends=required
   msg key=request.page/
 /field
 field
property=title
depends=required
   msg key=insert.title/
 /field
  /form
[/CODE]

In my web.xml, I have:
[CODE]
  init-param
param-nameapplication/param-name
param-valueresources.application/param-value
  /init-param
[/CODE]

and the application.properties file is in the
C:\jakarta-tomcat-5.0.27\webapps\AppName\WEB-INF\classes\resources
directory.

In the application.properties, I have:

[CODE]
request.page=The requested page is not provided.
insert.tile=The title of the requested page must not
be left blank.
[/CODE]



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



RE: Struts and Quartz Scheduler

2004-09-30 Thread Barnett, Brian W.
Thanks Wiebe. I saw your name on a post or two in the Quartz forum and was
hoping you'd respond to this here. I really appreciate it!

Brian Barnett

-Original Message-
From: Wiebe de Jong [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 12:28 PM
To: 'Struts Users Mailing List'; 'Thomas Vogt'
Subject: RE: Struts and Quartz Scheduler

Starting Quartz from a servlet is not a good idea, use a Plugin instead.

Reason:

I am running on the JBoss application server, and the threads that Quartz
creates on startup are attached to the app server when using the servlet
method. Everything works fine, but when your webapp is shutdown, the threads
keep going. The threads do not stop until the app server is stopped. So, if
you do a hot deploy (just replace the .ear) of your application, which I do
quite often during development, you'll end up with multiples of your jobs
executing at the same time.

Using plugin:

If you use a Struts plugin, the threads stop when the webapp stops, even
when doing hot deploys. In the plugin, the init() method gets called once
when Struts starts up and the destroy() method gets called once when Struts
shuts down. 

In my code below, I am called jobs implemented as stateless session beans.
Your jobs might be implemented differently.

Code:

Web.xml: 
Nothing here because you are not using a servlet

Struts-config.xml:
Add this line:

  plug-in className=com.mycompany.myapp.QuartzPlugin /

QuartzPlugin.java:

package com.mycompany.myapp;

import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.commons.logging.*;
import org.apache.struts.action.*;
import org.apache.struts.config.*;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.jobs.ee.ejb.EJBInvokerJob;

import java.util.*;

public class QuartzPlugin implements PlugIn {

  private static Log log = LogFactory.getLog(QuartzPlugin.class);

  private String ECOM_GROUP = eComGroup;

Scheduler sched;

  public void init(ActionServlet servlet, ModuleConfig moduleConfig)
throws ServletException {

log.info(Quartz starting);

//  Scheduler sched;
try {
  sched = StdSchedulerFactory.getDefaultScheduler();
  sched.start();
} catch (Exception e) {
  log.info(Quartz Scheduler failed to initialize:  + e.toString());
  throw new ServletException(e);
}

log.info(Initializing jobs...);

addJob(sched, Heartbeat, HeartbeatJob, execute, 0 0/15 * * * ?);
// every 15 minutes
addJob(sched, ExpiredTrial, ExpiredTrialJob, execute, 0 0 20/24 *
* ?); // every day at 8pm

log.debug(Quartz started);  
  }

  private void addJob(Scheduler sched, String jobName, String jndiName,
String methodName, String timing) {
JobDetail jd = new JobDetail(jobName, ECOM_GROUP, EJBInvokerJob.class);
jd.getJobDataMap().put(EJBInvokerJob.EJB_JNDI_NAME_KEY, jndiName);
jd.getJobDataMap().put(EJBInvokerJob.EJB_METHOD_KEY, methodName);
Object[] jdArgs = new Object[0];
jd.getJobDataMap().put(args, jdArgs);
CronTrigger cronTrigger = new CronTrigger(jobName, ECOM_GROUP);   
try {
  cronTrigger.setCronExpression(timing);
  sched.scheduleJob(jd, cronTrigger);
} catch (Exception e) {
  e.printStackTrace();
}
  }
  
  public void destroy() {
log.info(Quartz stopping);

try {
sched.shutdown();
} catch (SchedulerException ex) {
ex.printStackTrace();
}
sched = null;
  }

}


I think I'll put this into my blog.

Wiebe de Jong
http://frontierj.blogspot.com/


-Original Message-
From: Thomas Vogt [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 29, 2004 10:08 PM
To: Struts Users Mailing List
Subject: AW: Struts and Quartz Scheduler

You need a class to be executed as Job

public final class BerechnungsJob implements Job
{
 /* (Kein Javadoc)
  * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
  */
 public void execute(JobExecutionContext context) throws
JobExecutionException
 {
...
 }
}

and you need a servlet that looks like this to init the Job Trigger

32  /***
33   * Die Klasse dient als Listener für den Servlet Container um den Timer
im Hintergrund laufen zu lassen.
34   *
36   * @version Version 1.0 27.08.2004
37   */
38  
39  public class TimerServlet implements Servlet
40  {
41  
42  /***
43   * @see javax.servlet.Servlet#init(ServletConfig)
44   */
45  public void init(ServletConfig arg0) throws ServletException
46  {
47  SchedulerFactory schedFact = new
org.quartz.impl.StdSchedulerFactory();
48  JobDetail jobDetail = new JobDetail(Calculation Timer,
Calculation Timer, BerechnungsJob.class);
49  CronTrigger trigger = new CronTrigger(Calculation Timer,
Calculation Timer);
50  
51  try
52  {
53  trigger.setCronExpression(0 0/5 * * * ?);
54  

RE: RE: Struts and Quartz Scheduler

2004-09-30 Thread Wiebe de Jong
If you've not had any problems, that is good. Tomcat is probably taking care
of the threads for you and stopping them. Using the plugin is still better
because instead of relying on the app server to do your cleanup, you can
take charge of it yourself.

Wiebe

-Original Message-
From: Thomas Vogt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 11:56 AM
To: Struts Users Mailing List
Subject: AW: RE: Struts and Quartz Scheduler

Hmm
never had any of the problems you mentioned with my app and I do WAR HOT
reload quite often. I never experienced the behaviour you mentioned on my
Tomcat 5 but maybe thats different for JBoss.
But since you mentioned it I will change it in my app too, so it is
compatible with JBoss too.

Thanks for the tip
;)
Thomas

- Original-Nachricht 
Von: Struts Users Mailing List [EMAIL PROTECTED]
An: 'Struts Users Mailing List' [EMAIL PROTECTED], 'Thomas Vogt'
[EMAIL PROTECTED]
Betreff: RE: Struts and Quartz Scheduler
Datum: 30/09/04 20:26

 Starting Quartz from a servlet is not a good idea, use a Plugin instead.
 
 Reason:
 
 I am running on the JBoss application server, and the threads that Quartz
 creates on startup are attached to the app server when using the servlet
 method. Everything works fine, but when your webapp is shutdown, the
threads
 keep going. The threads do not stop until the app server is stopped. So,
if
 you do a hot deploy (just replace the .ear) of your application, which I
do
 quite often during development, you'll end up with multiples of your jobs
 executing at the same time.
 
 Using plugin:
 
 If you use a Struts plugin, the threads stop when the webapp stops, even
 when doing hot deploys. In the plugin, the init() method gets called once
 when Struts starts up and the destroy() method gets called once when
Struts
 shuts down. 


 
 In my code below, I am called jobs implemented as stateless session beans.
 Your jobs might be implemented differently.
 
 Code:
 
 Web.xml: 
 Nothing here because you are not using a servlet
 
 Struts-config.xml:
 Add this line:
 
   lt;plug-in className=quot;com.mycompany.myapp.QuartzPluginquot; /gt;
 
 QuartzPlugin.java:
 
 package com.mycompany.myapp;
 
 import javax.servlet.*;
 import javax.servlet.http.*;
 import org.apache.commons.logging.*;
 import org.apache.struts.action.*;
 import org.apache.struts.config.*;
 
 import org.quartz.*;
 import org.quartz.impl.StdSchedulerFactory;
 import org.quartz.jobs.ee.ejb.EJBInvokerJob;
 
 import java.util.*;
 
 public class QuartzPlugin implements PlugIn {
 
   private static Log log = LogFactory.getLog(QuartzPlugin.class);
 
   private String ECOM_GROUP = quot;eComGroupquot;;
 
   Scheduler sched;
 
   public void init(ActionServlet servlet, ModuleConfig moduleConfig)
 throws ServletException {
 
 log.info(quot;Quartz startingquot;);
 
 //Scheduler sched;
 try {
   sched = StdSchedulerFactory.getDefaultScheduler();
   sched.start();
 } catch (Exception e) {
   log.info(quot;Quartz Scheduler failed to initialize: quot; +
e.toString());
   throw new ServletException(e);
 }
 
 log.info(quot;Initializing jobs...quot;);
 
 addJob(sched, quot;Heartbeatquot;, quot;HeartbeatJobquot;,
quot;executequot;, quot;0 0/15 * * * ?quot;);
 // every 15 minutes
 addJob(sched, quot;ExpiredTrialquot;, quot;ExpiredTrialJobquot;,
quot;executequot;, quot;0 0 20/24 *
 * ?quot;); // every day at 8pm
 
 log.debug(quot;Quartz startedquot;);  
   }
 
   private void addJob(Scheduler sched, String jobName, String jndiName,
 String methodName, String timing) {
 JobDetail jd = new JobDetail(jobName, ECOM_GROUP,
EJBInvokerJob.class);
 jd.getJobDataMap().put(EJBInvokerJob.EJB_JNDI_NAME_KEY, jndiName);
 jd.getJobDataMap().put(EJBInvokerJob.EJB_METHOD_KEY, methodName);
 Object[] jdArgs = new Object[0];
 jd.getJobDataMap().put(quot;argsquot;, jdArgs);
 CronTrigger cronTrigger = new CronTrigger(jobName, ECOM_GROUP);   
 try {
   cronTrigger.setCronExpression(timing);
   sched.scheduleJob(jd, cronTrigger);
 } catch (Exception e) {
   e.printStackTrace();
 }
   }
   
   public void destroy() {
 log.info(quot;Quartz stoppingquot;);
 
   try {
   sched.shutdown();
   } catch (SchedulerException ex) {
   ex.printStackTrace();
   }
   sched = null;
   }
 
 }
 
 
 I think I'll put this into my blog.
 
 Wiebe de Jong
 http://frontierj.blogspot.com/
 
 
 -Original Message-
 From: Thomas Vogt [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 29, 2004 10:08 PM
 To: Struts Users Mailing List
 Subject: AW: Struts and Quartz Scheduler
 
 You need a class to be executed as Job
 
 public final class BerechnungsJob implements Job
 {
  /* (Kein Javadoc)
   * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
   */
  public void 

RE: How to handle multiploe unknown form fields

2004-09-30 Thread David Suarez
I didn't realize that Struts could actually pass a pre-filled ArrayList.
That's pretty cool.The way that I've done index properties in Struts
call this method in my version:

Myproperty(int index, String value);

In that method, you can recreate whatever you want however you prefer.
This is a good reference for you to use --
http://struts.apache.org/faqs/indexedprops.html

You also can use regular struts html tags to create the indexed values
for you by using the indexed=true property instead of hand-writing out
the name values as in the example below.  I use indexed properties to
recreate lists as well as objects in lists by tricking struts into doing
the right thing so the below will work.  It may just be that I have not
explained it clearly if it doesn't work for you.

Hope it helps you.

Regards...djsuarez

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 2:35 PM
To: [EMAIL PROTECTED]
Subject: Re: How to handle multiploe unknown form fields

In fact it did help because it answered some question for me.  I spent
the last hour searching for the RIGHT answer... This looked like it, but
for whatever reason it would never work for me when I tried to do the
exact same thing in my own project.  So, I went ahead and hacked
together my own solution...

In my test JSP, I have the following:

form name=test method=post action=test.mtx
  input type=text name=skills[0] value=val0
  input type=text name=skills[1] value=val1
  input type=text name=skills[2] value=val2
  input type=submit name=submit value=submit
/form

Then in my ActionForm, I have:

private ArrayList skills = new ArrayList();
public ArrayList getSkills() {
  this.skills.add(new String());
  return this.skills;
}
public void setSkills(ArrayList skills) {
  this.skills = skills;
}
public ArrayList getSkillsClean() {
  for (Iterator it = this.skills.iterator(); it.hasNext();) {
String s = (String)it.next();
if (s.trim().equalsIgnoreCase()) {
  it.remove();
}
  }
  return this.skills;
}

Struts knows that it's an indexed property and knows how to populate the
ActionForm.  The problem I found is that you either have to (a) have an
initial capacity for the ArrayList and more importantly you must
initialize all the elements because the getSkills() method is called for
each element that is added.  So, instead, I add an element in
getSkills() myself.  The problem is, if you then later call getSkills()
from the Action, as one would expect to do, you'll always have an empty
element at the end (or more, if you happen to call the method more than
once).  No big deal, but I decided I didn't like it, so I added the
getSkillsClean() method, which removes the empty elements.

I don't think I'm doing this the right way, and indeed the link you sent
shows a more elegant solution, but as I said it wouldn't work for me
when I tried, and I like things that work (I'm odd that way!), and this
has that virtue, so I'm happy.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 2:01 pm, [EMAIL PROTECTED] said:
 
 
 
 
 
 Frank,
 
 Will this help?  http://www.reumann.net/struts/nested.do
 
 You didn't say anything about JSTL.  Just today I'm working on
populating
 a
 checkbox field in an object that's contained in a list.  Oops.  I just
 remembered I'm using html-el too.  I haven't tried it with with plain
 html.
 This is getting it done tho'.
 
 c:forEach items=${workQueueForm.workQueueList} var=workQueue
 varStatus=
 status
 
tr 
   td class=Data_AlignMiddle
 html-el:checkbox property=
 workQueueList[${status.index}].checked /
 
   /td
 
 btw - how do you guys get code in your email w/o it messing up the
 archives?
 
 
 
 
 
 
  [EMAIL PROTECTED]
  om

To
  09/30/2004 01:54  [EMAIL PROTECTED]
  PM
cc
 

Subject
  Please respond to Re: How to handle multiploe
unknown
Struts Users   form fields
Mailing List
  [EMAIL PROTECTED]
   he.org
 
 
 
 
 
 
 
 I understand the JSP side of this eqation as you wrote it, although I
 should have said I was looking for a solution that doesn't use Struts
 taglibs because I try to avoid them at all costs, but that aside...
 
 I'm still unclear however on what the ActionForm does... Using this
 concept, do I HAVE to use the LazyActionForm you wrote?  I'd prefer to
 only
 use things that are built-in to Struts, and unless I'm missing it in
the
 docs, that's not.
 
 The question I'm getting at is that, like I said, the JSP code you
wrote
 makes sense, but what will put the submitted parameters into the
 collection
 in the ActionForm when the submission happens?  That's the part I
don't
 see.  Thanks for your help!
 
 --
 Frank W. Zammetti
 Founder and Chief Software 

Re: Validator

2004-09-30 Thread Daniel H. F. e Silva
Hi Gabriel,

  When posting to the struts-users list, please, don't use any language other than 
english.
It is unpolite as just a few dudes here understand portuguese. 
  If you and all other Struts dudes (hey, i'm brazilian too) need help with Struts, 
join the
funkiest irc channel ever: #funkycodemonkey at irc.darkmyst.org.

Cheers,
 Daniel Silva.



--- Gabriel França Campolina [EMAIL PROTECTED] wrote:

 Olá Vinicius,
 
 Poste o seu mapeamento de suas action no struts-config, e o mapeamento
 dos seus form, para que eu possa analizar? Verifique o log gerado pelo
 seu container web(Tomcat, JBoss etc), em geral eles listam a maioria
 dos problemas da sua aplicação.
 
 Gabriel F Campolina
 Analista desenvolvedor Java
 Stefanini IT Solutions - BH
  
 
 
 On Thu, 30 Sep 2004 14:33:51 -0300, Vinicius Carvalho
 [EMAIL PROTECTED] wrote:
  Hi there! I've been using Struts for quite sometime, but haven't used
  the validator yet.
  So I followed the receipt provided by Struts in Action, but got no
  success at all.
  
  Here's what I've done
  
  Struts-config is configured for the right plugin
  My ActionForm extends ValidatorForm and has no validate() method
  
  Validator-rules.xml:
  
 validator name=required
classname=org.apache.struts.validator.FieldChecks
   method=validateRequired
 methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   javax.servlet.http.HttpServletRequest
  msg=validator.errors.required
  javascript
![CDATA[
function validateRequired(form) {
  var isValid = true;
  var focusField = null;
  var i = 0;
  var fields = new Array();
  oRequired = new required();
  for (x in oRequired) {
var field = form[oRequired[x][0]];
  
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {
  
  var value = '';
  
  // get field's value
  if (field.type == select-one) {
var si = field.selectedIndex;
if (si = 0) {
  value = field.options[si].value;
}
  } else {
value = field.value;
  }
  
  if (trim(value).length == 0) { {
if (i == 0) {
  focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
  }
}
  }
  
  if (fields.length  0) {
focusField.focus();
alert(fields.join('\n'));
  }
  
  return isValid;
}
  
// Trim whitespace from left and right sides of s.
function trim(s) {
  return s.replace( /^\s*/,  ).replace( /\s*$/,  );
}
  
]]
  /javascript
  /validator
  
  validation.xml:
  
form name=userForm
  field property=nome depends=required
msg name=obrigatorio key=validator.errors.required/
arg0 key=prompt.nome/
  /field /form
  ApplicationResources.properties
  
  validator.errors.required= O campo {0} é obrigatório
  prompt.nome=nome
  
  And my jsp file looks like this:
  
  html:form action=/atualizaDadosUsuarioAction name=userForm
  type=br.com.auge.errors.action.form.UserForm onsubmit=return
  validateRequired(this)
  Nome html:text property=nome name=userForm/html:texthtml:errors
  /br
  /html:form
  html:javascript formName=userForm/
  
  Well, what is happening is that after I submit with no values at all,
  nothing happens, it forwards to the
  correct path. And also, the javascript generated isn't inside a
  script/script block. So it's printed
  on the page footer.
  
  Where did I miss?
  
  Thanks
  
  Vinicius
  
  -
  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]



RE: timeouts

2004-09-30 Thread Lucero, Dennis M
Ugh , not session timeouts but connection timeouts.

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 30, 2004 12:17 PM
To: Struts Users Mailing List
Subject: Re: timeouts

No, Struts does not control session timeouts



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message - 
From: Lucero, Dennis M [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 1:26 PM
Subject: timeouts


I am setting  connection timeouts in server.xml  but these settings do
not seem to be working.  Does struts have a timeout function?
 
 
I am he, as you are he, as you are me, and we are all together.
 




-
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: Deploying struts

2004-09-30 Thread Adam Hardy
Hi there,
you should put it in the WEB-INF/lib directory. However the 
struts-documentation should run straight out of the box. I suspect you 
have a configuration failure somewhere.

On 09/29/2004 08:39 PM Sanghamitra Roy wrote:
I have  Tomcat 3.3.1. I have downloaded the struts 1.2.2 and unzipped to the directory C:\struts. 
I have copied over the struts-examples.war files in the directory C:\struts\jakarta-struts-1.2.2\dist\webapps to the $TOMCAT_HOME\webapps directory as well as unjarred them to 
$TOMCAT_HOME\webapps\struts-examples. 
I have downloaded sax2r2.jar, unjarred it and added sax.jar to the classpath. Have also copied sax.jar to the $TOMCAT_HOME\webapps\struts-examples\WEB-INF directory.
I can run the struts-documentation fine but when I try to run the struts-examples I get the following error
Error: 500Location: /struts-examples/welcome.doInternal Servlet Error:

java.lang.NoClassDefFoundError: org/xml/sax/SAXExceptionat 
java.lang.Class.newInstance0(Native Method)  at 
java.lang.Class.newInstance(Class.java:232)  at 
org.apache.tomcat.facade.ServletHandler.getServlet(ServletHandler.java:346)  at 
org.apache.tomcat.facade.ServletHandler.preInit(ServletHandler.java:439) at 
org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java:228)at 
org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:472) at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)   
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)   at 
org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
 at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)   
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)  
 at java.lang.Thread.run(Thread.java:479)
Please can someone help me run the examples?
Thanks,
WA.
 
 
 
 
 


-
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Setting values of nested collection

2004-09-30 Thread Adam Hardy
Hi Danielle,
are you sure you instantiated the appropriate hierarchy for struts to 
save the form properties into on submit? You can build it yourself, keep 
it in the session or use LazyBeans (not sure about the last one - might 
be called LazyNested or similar).

Adam
On 09/30/2004 07:33 AM Danielle Boukovska wrote:
Hi all
I have a problem with setting the values on a hierarchy of nested
properties.
I have an ActionForm which has a property A of type HashMap. A is keyed 
on
Strings, and each value of A is a Collection (ArrayList). This 
collection
contains objects of type B.
I am trying to iterate through the keys A, and for each key, iterate 
through
the corresponding value (which is an ArrayList of B objects), i.e. I am
trying to do 2 levels of iteration. The I want to display a property of 
B
and let the user change it. I am able to display the properties of 
object B
on the screen. However, for some reason the nested:text tag doesn't 
work -
the textbox is there, but the input does not populate the form.
The following is what I am trying to do.
nested:iterate id=idForA property=A
nested:iterate name=idForA property=value  !--this should access
collection of B objects --
nested:text property=foo!--allow user to enter a
property of B --
/nested 
/nested
/nested
The problem is that when I enter a new value for foo, nothing happens; 
the
value of the nested property is not set. Is it possible to iterate through a HashMap, and let the user update its values?
I am quite new to Struts, and have spent a lot of time trying to get 
this to
work, but no luck. Any help will be appreciated!
Thanks
Danielle

--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [NEWBIE] Local forward with html:link?

2004-09-30 Thread Adam Hardy
You can take 2 approaches.
You can split the page into tiles, one tile contains the form input 
elements and is nested inside the other tile which contains the form and 
the buttons. Then you re-use the first tile and swop the second tile 
depending on your mapping.

Alternatively you can have a dispatch action. This would be the action 
of the submit, and it would direct execution within struts to your 
desired method within your action.

HTH
Adam
On 09/29/2004 04:02 PM fjalvingh wrote:
I have no issue with the action: it indeed has no knowledge about the
actual views being used which is OK. It means I'm able to re-use
actions if I want to.
The JSP pages however seem to know way to much about navigation. They
know this because they directly refer to an action path. This seems to
make it impossible to re-use the same JSP page in a different context.
As an example take a JSP page that is used to display a product. I
should be able to use this page from a flow where all products are
shown, and from a flow where products are searched, and from a flow
where products are edited. The JSP page has a number of predefined
exits like previous, next, edit, back. The presentations for
these exits should be visible only for contexts where they have
meaning (where they are mapped to some action).
To make this page reusable I need to be able to connect each exit to
a different action depending on the context that the page is used in.
I would have expected that I could wire these entries using the
action spec the page returns to. As I now start to understand this is
possible but by hand- by making a special controller OR a new base
class for Actions which uses a parameter to dispatch to a specified
forward. But I still need to hard connect a JSP page to a controller
as the target and this makes re-use of the page hardly possible. Am I
right in this?

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


Forms and Building Generic logic to control focus

2004-09-30 Thread Sifuentes, Ben
Example of retrieving the configuration of the form.

OutStanding questions are:

1.) Is the order of the array returned from findFormPropertyConfigs()
call the order defined in the form-property tag of the
struts-config.xml file?

2.) From the server side. If one wished to determined if the fieldname
was required. What would one do to determine this? So that one might
call formBean.setFocus(fieldName) from the action class.

 

// code taken from DynaActionFormClass

DynaActionForm formBean = (DynaActionForm) form;

FormBeanConfig config =

ModuleUtils.getInstance().getModuleConfig(request).findFormBeanConfig(m
yFormName);

FormPropertyConfig props[] = config.findFormPropertyConfigs();

for (int i = 0; i  props.length; i++) {

if (fieldName.equals(props[i].getName())) {

formBean.set(props[i].getName(), props[i].initial());

break;

}

}


Any help would be appreciated.

Thanks



Re: Error Message for Struts Validation

2004-09-30 Thread Matt Bathje
I've never used the msg attribute myself, but I think when you do, you 
need to specify the key, and a name attribute for which validation the 
message applies to. So in your case it would be:

msg name=required key=request.page /
You may also need to specify a bundle and resource attribute, but I 
don't think so in your case.

The error message you are seeing (null is required) is from the default 
error message. When you use the default error message, you need to 
specify replacement values for the error message template. If you look 
in your application.properties, you should have a bunch of errors. 
lines, for each standard validator. For example, you should have a line 
like:

errors.required={0} is required.
for the required validator. The {0} is what needs a replacement. To 
define it in your validator, you use:

arg0 key=request.page /
OR (for struts 1.2.x)
arg key=requst.page position=0 /
In these cases though, request.page should be defined in 
application.properties as:

request.page=Page
then, when the error prints, it will print as Page is required.
For me at least, this is a lot more handy than using msg, because you 
can use the same label to print out the prompt and the error message.

Hopefully I explained this well enough...
Matt

Caroline Jen wrote:
I use the validation.xml to validate the properties in
my form bean.  The validation works; but, the error
messages do not work as I expected.
While I have customized error messages prepared, the
error message displayed in the browser window for my
intentional violation are like:
. null is required
. null is required
I also wonder how to show error messages if there are
more than one validation check for a certain property.
 For example, depends=required,mask.
For example, in my validation.xml, I have:
[CODE]
  form name=editTitleForm
 field
property=document
depends=required
   msg key=request.page/
 /field
 field
property=title
depends=required
   msg key=insert.title/
 /field
  /form
[/CODE]
In my web.xml, I have:
[CODE]
  init-param
param-nameapplication/param-name
param-valueresources.application/param-value
  /init-param
[/CODE]
and the application.properties file is in the
C:\jakarta-tomcat-5.0.27\webapps\AppName\WEB-INF\classes\resources
directory.
In the application.properties, I have:
[CODE]
request.page=The requested page is not provided.
insert.tile=The title of the requested page must not
be left blank.
[/CODE]

___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.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: How to handle multiploe unknown form fields

2004-09-30 Thread Niall Pemberton
Rather than answer you here, I've set up a wiki page showing three different
options for lazy list type behaviour

  http://wiki.apache.org/struts/StrutsCatalogLazyList

I understand you wanting to only use released stuff - actually if you look
at LazyValidatorForm, theres not much too it - most of what it uses is
either already in Struts (it extends BeanValidatorForm) and Commons
BeanUtils (LazyDynaBean) - creating your own lazy ActionForm wouldn't take
much. In fact you can even use a LazyDynaBean directly in the
struts-config.xml as your ActionForm in Struts 1.2.4


Niall


- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 6:54 PM
Subject: Re: How to handle multiploe unknown form fields


 I understand the JSP side of this eqation as you wrote it, although I
should have said I was looking for a solution that doesn't use Struts
taglibs because I try to avoid them at all costs, but that aside...

 I'm still unclear however on what the ActionForm does... Using this
concept, do I HAVE to use the LazyActionForm you wrote?  I'd prefer to only
use things that are built-in to Struts, and unless I'm missing it in the
docs, that's not.

 The question I'm getting at is that, like I said, the JSP code you wrote
makes sense, but what will put the submitted parameters into the collection
in the ActionForm when the submission happens?  That's the part I don't see.
Thanks for your help!

 -- 
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com

 On Thu, September 30, 2004 1:51 pm, Niall Pemberton said:
  You simply need a property in your ActionForm that returns a collection
of
  skill beans and used the indexed attribute on the html tags. The
  isssue that most people have problems with is when using a Request
  scope
  ActionForm you need to populate your collection with the right number of
  skill beans - the way to handle this is some kind of lazy list
  processing
  for that property. Search the archives on indexed properties and lazy
list
  processing.
 
  In your jsp...
 
  logic:iterate name=skillsForm property=skills id=skills
 html:text name=skills property=skillid indexed=true/
 html:select name=skills property=skillLevel indexed=true
  html:option value=1Low/html:option
  html:option value=2Medium/html:option
  html:option value=3High/html:option
 /html:select
  /logic:iterate
 
  The trick is to name the id attribute to the same as the property in
the
  form which returns the collection, that way Struts will generate
something
  like:
 
   input type=text name=skills[x].skillid value=../
 
 
  The lazy ActionForms I wrote have the lazy list behaviour built in
 
  http://www.niallp.pwp.blueyonder.co.uk/#lazydynabean
 
  Niall
 
 
  - Original Message -
  From: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Thursday, September 30, 2004 6:19 PM
  Subject: How to handle multiploe unknown form fields
 
 
  I have an interesting situation, one that has never come up before, and
  I'm unsure how to deal with it...
 
  Imagine you have some records from a database representing various
  skills
  (i.e., HTML, Javascript, J2EE, etc.).  Each has a SkillID associated
with
  it.
 
  You create a JSP that lists each skill with a drop-down next to it.
The
  drop-down allows the user to select their skill level for each skill.
 
  When the user hits Save, you need to update all the skills for that
  user.
 
  That's the scenario.  Here's the question... Each drop-down is given
the
  name of the SkllID.  But how do you write an ActionForm for that?
 
  Since the database can be expanded to include new skills at any time,
  it's
  impractical to add getters and setters for each SkillID, and in fact
  breaks
  low coupling goals anyway.
 
  Is there a standard way of accepting what kind of amounts to an array
of
  inputs from a form and getting it into an ActionForm in some way (maybe
as
  an ArrayList or something?).
 
  TIA!
 
 
 
  -
  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]



  1   2   >