The number formatting in Taglib occurs initially through parsing.

the character sequence that indicates a Double is any sequence of numbers
with a decimal point.  otherwise if it's an integer it's created as a Long.
If it fails trying to cast the input as a Long or Double then it's a
String.

so you should be able to con your conditional processing base on that info.

this is from FormatNumberSupport in the taglib codebase

      if (input instanceof String) {
          try {
            if (((String) input).indexOf('.') != -1) {
                input = Double.valueOf((String) input);
            } else {
                input = Long.valueOf((String) input);
            }
          } catch (NumberFormatException nfe) {
            throw new JspException(
                    Resources.getMessage("FORMAT_NUMBER_PARSE_ERROR",
input),
                nfe);
          }
      }

HTH,

Savan Thongvanh
Berkley Technology Services
515.278.7725


|---------+---------------------------->
|         |           "Robert Taylor"  |
|         |           <[EMAIL PROTECTED]|
|         |           ta.com>          |
|         |                            |
|         |           10/24/2003 01:27 |
|         |           PM               |
|         |           Please respond to|
|         |           "Tag Libraries   |
|         |           Users List"      |
|         |                            |
|---------+---------------------------->
  
>----------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                            |
  |       To:       "Tag Libraries Users List" <[EMAIL PROTECTED]>                     
              |
  |       cc:                                                                          
                            |
  |       Subject:  RE: Determine a values type                                        
                            |
  
>----------------------------------------------------------------------------------------------------------------|




Savan, thanks for responding.
What if the value is "not.A.Double.Or.Long".
My point is, the value could be any character sequence.
If the character sequence indicates its a Long I want
to process one path, if not, I want to process another.


robert

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 24, 2003 2:05 PM
> To: Tag Libraries Users List
> Subject: Re: Determine a values type
>
>
>
>
>
>
>
> Taglib works primarily with 3 types.  Double, Long, and String.  if it's
> got a "." then it's a Double. If not it's Long.
>
>
> Savan Thongvanh
> Berkley Technology Services
>
>
>
> |---------+---------------------------->
> |         |           "Robert Taylor"  |
> |         |           <[EMAIL PROTECTED]|
> |         |           ta.com>          |
> |         |                            |
> |         |           10/24/2003 12:27 |
> |         |           PM               |
> |         |           Please respond to|
> |         |           "Tag Libraries   |
> |         |           Users List"      |
> |         |                            |
> |---------+---------------------------->
>
> >-----------------------------------------------------------------
> -----------------------------------------------|
>   |
>                                                  |
>   |       To:       <[EMAIL PROTECTED]>
>                                                  |
>   |       cc:
>                                                  |
>   |       Subject:  Determine a values type
>                                                  |
>
> >-----------------------------------------------------------------
> -----------------------------------------------|
>
>
>
>
> Is there a way to determine a values type?
> I basically need to know if a value is an integer.
>
> For example, the following throws an exception if the value
> "userId" cannot
> be coerced:
>
> <c:if test="{param.userId > 0}">
>
> </c:if>
>
> robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain
> private, privileged and confidential information belonging to the sender.
> The information therein is solely for the use of the addressee.  If your
> receipt of this transmission has occurred as the result of an
> error, please
> immediately notify us so we can arrange for the return of the documents.
> In such circumstances, you are advised that you may not disclose, copy,
> distribute or take any other action in reliance on the information
> transmitted.
>
>
>
> ---------------------------------------------------------------------
> 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]




CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain
private, privileged and confidential information belonging to the sender.
The information therein is solely for the use of the addressee.  If your
receipt of this transmission has occurred as the result of an error, please
immediately notify us so we can arrange for the return of the documents.
In such circumstances, you are advised that you may not disclose, copy,
distribute or take any other action in reliance on the information
transmitted.



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

Reply via email to