aspose file tools*
The moose likes JSF and the fly likes ABS() in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "ABS() in JSF" Watch "ABS() in JSF" New topic
Author

ABS() in JSF

jeff rusty
Ranch Hand

Joined: Nov 07, 2006
Posts: 109
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 <trutputlabel> (text-align:right or left). I tried the inlinestyle but it is working.


Any help in this is highly appreciated.


Thanks,
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41829
    
  63
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)}


Ping & DNS - my free Android networking tools app
jeff rusty
Ranch Hand

Joined: Nov 07, 2006
Posts: 109
thank you Ulf Dittmer.
I am using JSF. Will this solution ork for me... Any way i will try and let you know..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ABS() in JSF