• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ABS() in JSF

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

I have couple of questions in JSF

1. How to call Math.ABS() while displaying a number value in JSF? i am using Myfaces with trinidad.

2. how to align text when using <tr:outputlabel> (text-align:right or left). I tried the inlinestyle but it is working.


Any help in this is highly appreciated.


Thanks,
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could define a TLD file "myFunctions.tld" containing this:

<function>
<name>abs</name>
<function-class>java.lang.Math</function-class>
<function-signature>double abs (double)</function-signature>
</function>

and then write this in your JSP:

<%@ taglib prefix="math" uri="/WEB-INF/myFunctions.tld" %>

${math:abs(myDoubleVariable)}

 
jeff rusty
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Ulf Dittmer.
I am using JSF. Will this solution ork for me... Any way i will try and let you know..
 
reply
    Bookmark Topic Watch Topic
  • New Topic