RE: ClassCastException coming from DynaValidatorForm.validate()-> bug or a feature?

2003-12-21 Thread Steve Armstrong
Hi,

Validator has support for validating multi-page forms via the use of an
optional "page" attribute, associated with a field element, that can be set
to an integer.  From the Validator portion of the user guide:

All validation for any field on a page less than or equal to the current
page is performed server side. All validation for any field on a page equal
to the current page is generated for the client side Javascript. A
multi-part form expects the page attribute to be set



Since your form already defines a page property, and a non-integer one at
that, I can see how things might get screwed up.

Cheers,
-Steve

-Original Message-
From: Janice [mailto:[EMAIL PROTECTED]
Sent: Friday, December 19, 2003 2:25 PM
To: [EMAIL PROTECTED]
Subject: re: ClassCastException coming from
DynaValidatorForm.validate()-> bug or a feature?


I went to the source to try to find out what was causing this problem, and I
started to suspect that:



was the problem... sure enough, when I changed the name to "thePage",
instead of "page", it worked.

Would this be a bug or just a feature that I missed the documentation for?

Janice


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



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



RE: Validator Framework & Value Object ActionForm

2003-11-21 Thread Steve Armstrong
Hi,

I assume that you would just validate on the nested form property named
"contactValue.email".

Cheers,
-Steve

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 4:38 AM
To: [EMAIL PROTECTED]
Subject: Validator Framework & Value Object ActionForm


Hi all,

I have the following action form:

/*
 * Created on Nov 19, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package nl.informatiefabriek.addressbook.form;

import nl.informatiefabriek.addressbook.value.ContactValue;

import org.apache.struts.action.ActionForm;

/**
 * @author harm
 *
 * @struts.form name = "contactForm"
 */
public class ContactForm extends ActionForm {
private ContactValue contactValue = new ContactValue();

/**
 * @return Returns the contactValue.
 */
public ContactValue getContactValue() {
return contactValue;
}

/**
 * @param contactValue The contactValue to set.
 */
public void setContactValue(ContactValue contactValue) {
this.contactValue = contactValue;
}

}

As you can see my Action Form only stores a ValueObject (Data Transfer
Object) which is send to the EJB tier in my application.
My ValueObject contains a property 'email'.:


 public java.lang.String getEmail()
   {
  return this.email;
   }

   public void setEmail( java.lang.String email )
   {
  this.email = email;
  emailHasBeenSet = true;

   }


I would like to use the Validator Framework to validate the emailaddress
stored in the ValueObject.

I'm not sure on how to do this, because the email property is stored in
the Value Object and not in the ActionForm object.

Can somebody provide me a hint on how to validate this using the Validator
Framework?

Thanks,

Harm de Laat
Informatiefabriek
The Netherlands


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



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



RE: Accessing a static final constant from Class in JSP

2003-11-18 Thread Steve Armstrong
Well, you can use a JSP expression which strictly speaking isn't a
scriptlet.  So, after you do your import, you can use constants like



Cheers,
-Steve

-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 10:48 AM
To: [EMAIL PROTECTED]
Subject: RE: Accessing a static final constant from Class in JSP


I don't think there is one, but maybe somone will educate me. ;-)

Why not put this in ApplicationResources and then use the 
tag?

Larry

>>> [EMAIL PROTECTED] 11/18/03 8:31 AM >>>

which tag do u use to access the constants from the class as I don't
want to use JSP Scriplets???

Thanks,
S!

>>> [EMAIL PROTECTED] 11/17/03 05:41PM >>>
Import the class in your jsp, then you can directly access it.

<%@ page import="GSOPConstants"%>

-Original Message-
From: Srinivas Kusunam [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 2:17 PM
To: [EMAIL PROTECTED]
Subject: Accessing a static final constant from Class in JSP


Hi,
 I have a class called ProjConstants.java which is a static class
with
some static final constants here is the sample

public class GSOPConstants{
  public static final String LINK_EDIT = "linkEdit";
}

   How can I access this "LINK_EDIT"  constant from JSP
without
using scriplets???

   Any help appreciated.

Regards,
S!



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



RE: Reasons for using Struts

2003-09-28 Thread Steve Armstrong
Hi,

This is a good place to start:

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsBenefits

Cheers,
-Steve

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 27, 2003 12:53 AM
To: [EMAIL PROTECTED]
Subject: Reasons for using Struts


What are the reasons for using Struts?
That is what are the Reasons for which Struts would be a more suitable
choice than say plain JSP/Servlet?

Thanks,

Martin


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



RE: html_image property value not submitted

2003-09-27 Thread Steve Armstrong
The "value" attribute of an HTML 'input type="image"' tag (i.e., what the
Struts  tag is generating) is apparently ignored by all (most?)
browsers.  See:

http://www.blooberry.com/indexdot/html/tagpages/i/inputimage.htm

One solution is to have a hidden variable in your HTML form associated with
your form bean (let's use the bean property name "action") and then use
JavaScript to set this property appropriately on submit.  Something like,





In the action associated with your form, you can then consult the "action"
property of your form bean to determine the type of image button that has
been selected.

Cheers,
-Steve

-Original Message-
From: Norbert Spemm [mailto:[EMAIL PROTECTED]
Sent: Friday, September 26, 2003 9:25 PM
To: [EMAIL PROTECTED]
Subject: html_image property value not submitted


Hi,

I wanted to replace the buttons on my form with images.

Before I had a working application with this tag in the jsp:



now I tried with



The problem with the image-version is, that my action now doesn't
receive a value for the parameter "SubmittedAction" anymore. Instead I
only get the parameters SubmittedAction.x and SubmittedAction.y which
are of no use for me.

What am I doing wrong? I'm using Struts 1.1


-
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 tell invalid session vs session timed out

2003-09-27 Thread Steve Armstrong
Hi,

I use the cookie approach outlined here:

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

There is also another thread involving this issue starting here:

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

Cheers,
-Steve

-Original Message-
From: Warren Chen [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 7:06 PM
To: Struts Users Mailing List
Subject: how to tell invalid session vs session timed out


Hi All,

Is there any tool in Struts that can tell if an
invalid session is caused by timeout or simply no
session were ever created?

(In my app, the loginAction creates a session and put
some stuff into the session, in each subsequent
request I'll check if session is valid, if not, send
user back to login page - in order to send more
meaningful message to user, I want to tell if invalid
session is caused by timeout out or simply the user
never logged in) 

Thanks a lot!

Warren

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.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: Bean tag help

2003-08-14 Thread Steve Armstrong
Howdy,

There are a number of things that are incorrect in your example:

1. Concerning your definition:



You can set the value of your scripting variable "processName" from a bean,
a property of a bean, or a "hard-coded" value.  I believe you are trying to
set your scripting variable from the "processName" property of a bean named
"filesForm" (i.e., filesForm.getProcessName()).  However, you also specify a
value attribute which probably overrides this (I'd have to look at the
source code for the tag to see how it is actually resolving this ambiguity)
which would set your scripting variable "processName" to the String
"filesForm".  This is probably not what you want.

2.  I believe that as soon as you use the value attribute, the scripting
variable will automatically be set to java.lang.String and your value for
the type attribute is promptly ignored.  Once again, I'd have to look at the
source for the tag to be 100% sure.  Anyway, you have to set the type
attribute correctly if you're getting the value from a bean or the property
of a bean, otherwise the type is java.lang.Object by default.  So, if your
getter for processName returns a String, specify that the type of the define
is java.lang.String.

3. There is no need to create a scripting variable as above to be able to do
.  This is saying that you want to
create an HTML form input tag of type hidden with the value of the named
property associated with the form bean that is associated with your action.
I assume that "filesForm" is the bean associated with your action, and it
has a property named "processName".  If this is a request scope form bean,
and the value of "processName" isn't editable (i.e., it isn't used in a text
field on your form), and you want its original value to be set in your form
bean when the form is submitted, then the html:hidden tag is all you need.
Your bean:define is trying to set a scripting variable with the same name
(and value) as your form bean property and has nothing to do with the task
you're trying to accomplish (I believe).

Cheers,
-Steve

-Original Message-
From: Vance Heredia [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 8:33 PM
To: 'Struts Users Mailing List'
Subject: RE: Bean tag help



Hm

Why do I need a bean name and type in struts-conifg.

The JSP I'm running is a basic page all it does is user the bean tag eg:



<%@ page language="java" import="java.net.URLEncoder"
contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>



body bgcolor="white" background="/images/PaperTexture.gif">






  
  
  
  



It always dies on the first bean saying it had a ClassCastEsception when
trying to locate the Start tag

I'm not clear asd to why you need to use a bean name and type??

Examples would be good


Vance Heredia


> -Original Message-
> From: Rohit Aeron [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 7 August 2003 6:36 PM
> To: Struts Users Mailing List
> Subject: RE: Bean tag help
>
>
>
> Just cross check that you are importing
> 1. taglib
> 2. bean
> 3. correctly specified bean name & type in struts-config.
>
> Regards
> Rohit
>
>
>
> > Hey People
> >
> > Ay ideas on how to fix my bean proble?
> >
> > Every time I try to uyse the  >
> > java.lang.ClassCastException
> > at
> org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:766)
> > at
> > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:481)
> > at org.apache.jsp.files_jsp._jspService(files_jsp.java:149)
> >
> >
> > The Java code looks like
> >
> >   _jspx_th_html_form_0.setParent(_jspx_th_html_html_0);
> >   _jspx_th_html_form_0.setMethod("POST");
> >   _jspx_th_html_form_0.setAction("/files");
> >   149->  int _jspx_eval_html_form_0 =
> _jspx_th_html_form_0.doStartTag();
> >   if (_jspx_eval_html_form_0 !=
> > javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
> > do {
> >   out.write("\r\n  ");
> >   /*   bean:define  */
> >   java.lang.Object processName = null;
> >   org.apache.struts.taglib.bean.DefineTag
> > _jspx_th_bean_define_0 = (org.apache.struts.taglib.bean.DefineTag)
> >
> _jspx_tagPool_bean_define_property_name_id.get(org.apache.struts.tagli
> > b.bean
> > .DefineTag.class);
> >
> >
> > I havent worked a lot on struts and beans so I'm not too
> sure how to
> > fix it
> >
> > Cheers
> >
> > Vance
> >
> > 
> > Vance Heredia
> > 
> >
> >
> __
> > This email, including attachments, is intended only for the
> addressee
> > and may be con

RE: Bean tag help

2003-08-09 Thread Steve Armstrong
I really don't know how to explain things any more clearly.  I suggest you
buy a Struts book, and check out the documentation for the tag libraries on
the Struts web site.  Your bean:define tags make absolutely no sense.
Please read the following:

http://jakarta.apache.org/struts/userGuide/struts-bean.html#define

In particular:

The corresponding value to which this new attribute (and scripting variable)
is set are specified via use of exactly *one* of the following approaches
(trying to use more than one will result in a JspException being thrown):

Specify a name attribute (plus optional property and scope attributes) - The
created attribute and scripting variable will be of the type of the
retrieved JavaBean property, unless it is a Java primitive type, in which
case it will be wrapped in the appropriate wrapper class (i.e. int is
wrapped by java.lang.Integer).

Specify a value attribute - The created attribute and scripting variable
will be of type java.lang.String, set to the value of this attribute.

Specify nested body content - The created attribute and scripting variable
will be of type java.lang.String, set to the value of the nested body
content.

--

Your bean:define tags are performing both 1 and 2 and hence, according to
the doc, a JspException should be thrown.  As I also mentioned, they seem to
make no semantic sense for the context you provided in your e-mail.  Why are
you creating scripting variables via bean:define?  What is the purpose of
this step?

-Steve

-Original Message-
From: Vance Heredia [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 12:01 AM
To: 'Struts Users Mailing List'
Subject: RE: Bean tag help



Huh  Sorry but you've lost me completely ...

Maybe I should have explained that I've never programmed struts before and
that I've been assigned to fix up the work of a person who has left the
project, and while I've understood, overcome and finished most of the
concepts and problems this particular one completely stumps me.

I should also point out that all exmples of http://www.lonelyplanet.com/
http://mobile.lonelyplanet.com/
http://wap.lonelyplanet.com/


> -----Original Message-
> From: Steve Armstrong [mailto:[EMAIL PROTECTED]
> Sent: Friday, 8 August 2003 1:01 PM
> To: Struts Users Mailing List
> Subject: RE: Bean tag help
>
>
> Howdy,
>
> There are a number of things that are incorrect in your example:
>
> 1. Concerning your definition:
>
>  property="processName" value = "filesForm" type="java.lang.Object" />
>
> You can set the value of your scripting variable
> "processName" from a bean, a property of a bean, or a
> "hard-coded" value.  I believe you are trying to set your
> scripting variable from the "processName" property of a bean
> named "filesForm" (i.e., filesForm.getProcessName()).
> However, you also specify a value attribute which probably
> overrides this (I'd have to look at the source code for the
> tag to see how it is actually resolving this ambiguity) which
> would set your scripting variable "processName" to the String
> "filesForm".  This is probably not what you want.
>
> 2.  I believe that as soon as you use the value attribute,
> the scripting variable will automatically be set to
> java.lang.String and your value for the type attribute is
> promptly ignored.  Once again, I'd have to look at the source
> for the tag to be 100% sure.  Anyway, you have to set the
> type attribute correctly if you're getting the value from a
> bean or the property of a bean, otherwise the type is
> java.lang.Object by default.  So, if your getter for
> processName returns a String, specify that the type of the
> define is java.lang.String.
>
> 3. There is no need to create a scripting variable as above
> to be able to do .  This
> is saying that you want to create an HTML form input tag of
> type hidden with the value of the named property associated
> with the form bean that is associated with your action. I
> assume that "filesForm" is the bean associated with your
> action, and it has a property named "processName".  If this
> is a request scope form bean, and the value of "processName"
> isn't editable (i.e., it isn't used in a text field on your
> form), and you want its original value to be set in your form
> bean when the form is submitted, then the html:hidden tag is
> all you need. Your bean:define is trying to set a scripting
> variable with the same name (and value) as your form bean
> property and has nothing to do with the task you're trying to
> accomplish (I believe).
>
> Cheers,
> -Steve
>
> -Original Message-
> F

RE: how to pass a jsp variable to a javascript function

2003-08-07 Thread Steve Armstrong
Howdy,

There are definitely a number of funky things in your code example.  I'm not
exactly sure what you're trying to do since your onchange attribute is
calling a JavaScript function called "projectChange" which I don't see
anywhere, but here are a couple of things to look out for:

1.  I don't believe you can use a JSP expression inside some JavaScript
code, but someone can certainly correct me if I'm wrong.  What I have done
in the past is use a  tag, so you should be able to do something
like:




  var y = ;


if you *really* want to do that.

2. However, your question was "how do I pass a JSP variable to a Javascript
function" and it looks like this is what you are attempting to do with the
next part of your code:



For this to work correctly, your JSP expression needs to be the entire value
for the onchange attribute (i.e., you can't embed a JSP expression into the
middle of an attribute value).  Thus, assuming you have a JavaScript
function named "projectChange" defined, and you really want to pass in a
JavaScript variable to this function as opposed to say, the Integer value
itself, then you should be able to say something like:



3. But, rather than setting a JavaScript variable inside a nested:iterate
and then trying to pass this variable into "projectChange" it would seem to
be much simpler to simply pass in the value itself.  In other words,
something like:


  

I haven't tested the above, but if I haven't missed any syntactic sugar, it
should work.

Cheers,
-Steve

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 5:30 PM
To: Struts Users Mailing List
Subject: Re: how to pass a jsp variable to a javascript function


I don't have javascript errors, the problem is  <%=tmpIndex%> can't be
translated into 0,1,2,.
in javascript,  only the String"<%=tmpIndex%>".




Adam Hardy <[EMAIL PROTECTED]>
08/07/03 04:32 PM
Please respond to "Struts Users Mailing List"


To: Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:Re: how to pass a jsp variable to a javascript
function


Hi Julie,
what do you get as a result of that iterate? It looks correct. Do you
have javascript errors?

Adam
[EMAIL PROTECTED] wrote:
> Hi All,
>
> Can anyone suggest how to pass a jsp variable to a javascript function
> correctly? It is in a nested:iterate block that has an
indexId="tmpIndex".
>  what I would like to do is to have the 'y<%=tmpIndex%>' variable pass
> into my JavaScript function.It seems like the server side <%=tmpIndex%>
> variable can not be translated into the client side script function.
>
>
> Here is my code:
>
> 
> 
> 
> var y<%=tmpIndex%>=<%=tmpIndex%>;
> 
> 
> 
> 
> 
>
> any suggestions?
>
>
> Very Appreciated.
>
> Julie
>
> = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = =
> This transmittal and any attachments may contain confidential,
privileged or sensitive information and is solely for the use of the
intended recipient. If you are not intended recipient, you are hereby
notified that you have received this transmittal and any such attachments
in error and any review, dissemination, distribution or copying thereof is
strictly prohibited. If you have received this transmittal and any
attachments in error please notify the sender and immediately destroy the
message and all its attachments. Any opinions herein expressed may be
those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the
"Bank"). The Bank accepts no responsibility for the accuracy or
completeness of any information herein contained.
> = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = =
>
>


-
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: risk of upgrading?

2003-08-04 Thread Steve Armstrong
Hi,

A little out of date, but some worthwhile things to consider:

Struts 1.1: Should I Upgrade?

http://www.theserverside.com//resources/article.jsp?l=Struts1_1

Cheers,
-Steve

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 6:06 PM
To: Struts Users Mailing List
Subject: risk of upgrading?


Can someone with a bit of in-depth Struts experience comment on the risks of
upgrading a project from Struts 1.0 to Struts 1.1? Should my project work
without any modifications? Are there any issues I need to be aware of
(changes in behavior and the like)?

thx
andy


-
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: [OT] My Struts webapp and hosting

2003-04-05 Thread Steve Armstrong
Quick plug for inexpensive Java web app hosting:

http://www.kgbinternet.com/

Cheers,
-Steve

-Original Message-
From: Guido [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 7:19 AM
To: [EMAIL PROTECTED]
Subject: [OT] My Struts webapp and hosting

...
Now the application is in my PC with Tomcat because I have not found any
very cheep_ Struts hosting.


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



RE: [Q] how to Sort on JSP without calling server side?

2003-03-10 Thread Steve Armstrong
Hi,

By JSP side I assume you mean client side which means JavaScript.  Here is
one possibility if you're displaying your list of beans (well,their
properties)in a table:

http://www.mattkruse.com/javascript/sorttable/

Cheers,
-Steve

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 6:06 PM
To: [EMAIL PROTECTED]
Subject: [Q] how to Sort on JSP without calling server side?


Hello,

I'm passing a List to JSP that has list of beans.
How I may implement Sorting on JSP side only?

any examples would be very helpful.

tnx

Best Regards.
Michael.


-
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: Mixing currencies and locales

2003-02-24 Thread Steve Armstrong
Hi,

Can java.util.Currency in JDK 1.4 help you out here, perhaps in combination
with java.text.NumberFormat.getCurrencyInstance()?

Cheers,
-Steve

-Original Message-
From: James Childers [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 12:19 PM
To: 'Struts Users Mailing List' (E-mail)
Subject: Mixing currencies and locales


Here's a puzzler:

We need to be able to mix displaying different languages and different
currencies. For example: A user comes in with a locale of es_MX, but they
wish to view the price of their results in Yen. We have the I18N
functionality in place, but I haven't seen a way to handle this kind of
mapping. This would, of course, need to be applicable to non-western
character sets, as well.

One way that I have considered doing this is with simple resource keys, viz:

[in resources_es_MX.properties]
currency.jp=\u00A5{0}.{0}

and repeat this for each langauge/country combination. This would be
incredibly tedious, however. If there is a library or API available I would
certainly prefer to use that route.

-= J

-
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: ActionError - does not expand the {0} placeholder

2003-02-23 Thread Steve Armstrong
Hi,

No guarantee, but try doubling your single quote.  The
java.text.FormatMessage Javadoc associated with JDK 1.3 says:

In strings, single quotes can be used to quote the "{" (curly brace) if
necessary. A real single quote is represented by ''.

Cheers,
-Steve

-Original Message-
From: w i l l i a m b o y d [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 22, 2003 10:00 PM
To: Struts Users Mailing List
Subject: Help: ActionError -  does not expand the {0}
placeholder


hello all,

developing on w98 with tomcat 3.2.24, mysql 3.23.36, struts 1.0.2, jdk
1.3.1., servlet 2.2. will be deploying on basically similar setup; but
deployment os is xp.

i got a jsp page that has a choice box that allows multiple choices. i set a
validation rule in my action form's validate method, that disallows users
from selecting more options than permitted by my limit. if a user goes over
the limit the form doesn't get submitted. the validation rule is checked
just fine; struts creates an error for it and adds it to the errors
collection. but the error message that is displayed on the input page does
not contain the parameterized message as expected. instead, it shows the
complete, unformatted message, exactly (minus an apostrophe) as it appears
in the resource bundle! does anybody know what i'm overlooking? is this a
bug in 1.0.2?

here is what gets displayed (verbatim) on the input page after the
validation error is created:

  Sorry! Youve selected too many choices for {0}.  (what happened to my
apostrophe in "You've" ?)

here is the appropriate line from my resource bundle:

  error.prefs.limit=Sorry! You've selected too many choices for {0}.

here is a snip from my form's validate method:
  ...
  ActionErrors errors = new ActionErrors();
  ...
  if ( isTooManyPrefs ) {
 ActionError prefMusicError = new ActionError( "error.prefs.limit",
"Preferred Music" );
  errors.add( "prefMusic", prefMusicError );

   }
  ...

here are the results of me looping through prefMusicError.getValues() inside
validate:

  error.prefs.limit's replacement value # 0: Preferred Music
  error.prefs.limit's replacement value # 1: null
  error.prefs.limit's replacement value # 2: null
  error.prefs.limit's replacement value # 3: null


here is a snip from the input page that generates the validation error and
to which struts reports the error:

  ...
   
  ...

what's going on here? why doesn't struts format the message to include the
replacement value. it's obviously there! at least *i* can get at it from the
object array that i get from ActionError.getValues()! please, help! thanks
in advance.

will



-
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: nested:iterate and indexId problems

2002-05-24 Thread Steve Armstrong

Thanks very much for the speedy response!

When I said that  worked, I had an "id" attribute in that
particular scenario so perhaps that's why everything was okie-dokie.
Another work around I found was to do the following:

subsitute:




with:





One more intermediate step, but no biggie.  As to why it works, I'll leave
that mystery up to you bright fellows :-)

Cheers,
-Steve

-Original Message-
From: Arron Bates [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 2:28 AM
To: Struts Users Mailing List
Subject: Re: nested:iterate and indexId problems


Just had a play, and there's a bug in the tag's extra info class around
the indexId.
Until then, set an "id" attribute also, and it should work.

Seems though the extension is troubled by its super class, and it's
looking like a fix is required there also. Either way, I'll sort it out
tonight (few hours from now), so you can download NeXt again tomorrow,
and it'll be sweet. Actually, from looking at the code, it's a surprise
that common  tags aren't suffering from the same issue.


Arron.

Steve Armstrong wrote:

>Hi,
>
>I'm using Struts 1.0.2 with the NeXt package targeted for that particular
>load.  I'm having a problem evaluating the page scope Integer bean that
>should be created via the indexId attribute.
>
>Inside an , I have something like the following for handling odd
>and even rows of a table differently:
>
>
>
>
>
>
>
>
>
>
>
>The above is from memory so please excuse any minor syntax errors.  When
the
> line is processed, an error is generated indicating that
>"loop" (our page scope Integer bean set by the nested:iterate tag) is not a
>valid variable.  However, if I replace  with plain
> everything works fine.
>
>Am I running into some sort of scoping issue when I use ?
>
>Any help would be much appreciated.
>
>Thanks,
>-Steve



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




nested:iterate and indexId problems

2002-05-23 Thread Steve Armstrong

Hi,

I'm using Struts 1.0.2 with the NeXt package targeted for that particular
load.  I'm having a problem evaluating the page scope Integer bean that
should be created via the indexId attribute.

Inside an , I have something like the following for handling odd
and even rows of a table differently:











The above is from memory so please excuse any minor syntax errors.  When the
 line is processed, an error is generated indicating that
"loop" (our page scope Integer bean set by the nested:iterate tag) is not a
valid variable.  However, if I replace  with plain
 everything works fine.

Am I running into some sort of scoping issue when I use ?

Any help would be much appreciated.

Thanks,
-Steve


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: BeanUtil BUG (this is actually correct behaviour)

2002-02-18 Thread Steve Armstrong

Fernando Esteban Barril Otero [mailto:[EMAIL PROTECTED]] writes:

I think that is the normal behavior for JavaBean properties.
When you have a setter/getter for a property starting with
more than one upper char, the property name must have exactly
the same name (without the "normal" convention).

-

Correct.  The following is from the JavaBeans spec:

8.8 Capitalization of inferred names

When we use design patterns to infer a property name, we need to decide what
rules
to follow for capitalizing the inferred name. If we extract the name from
the middle of a normal mixedCase style Java name then the name will, by
default, begin with a capital letter.

Java programmers are accustomed to having normal identifiers start with
lower case letters.
Vigorous reviewer input has convinced us that we should follow this same
conventional rule
for property names.

Thus when we extract a property name from the middle of an existing Java
name, we normally
convert the first character to lower case. However to support the occasional
use of all upper-case names, we check if the first two characters of the
name are both upper case and if so leave it alone. So for example,

"FooBah" becomes "fooBah"
"Z" becomes "z"
"URL" becomes "URL"

- Original Message -
From: "emmanuel.boudrant" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, February 18, 2002 11:32 AM
Subject: BeanUtil BUG


>
> Hello,
>
> I've got a FormBean with property like this:
>
> private String nIdentifiant=null;
>
> public String getNIdentifiant(...
>
> public void setNIdentifiant(...
>
>
>
> private String nmClient=null;
>
> public String getNmClient(...
>
> public void setNmClient(...
>
>
>
> My action throw an exception ; no getter for property nIdentifiant
>
> And when I make a BeanUtil.describe(myForm); I've got this output:
>
> [NIdentifiant=null ; nmClient = null ... ]
>
> NIdentifiant must be nIdentifiant !
>
>
>
> I'm under Struts1.0
>
>
>
> thank
>
> Emmanuel


--
To unsubscribe, e-mail:   
For additional commands, e-mail: