File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ABS() in JSF

 
jeff rusty
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • 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 <trutputlabel> (text-align:right or left). I tried the inlinestyle but it is working.


Any help in this is highly appreciated.


Thanks,
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic