Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Data type in JSTL

 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to check whether the object has numeric value or String value in JSTL. I looked at functions tag library but i dont see any one.
Any help is appreciated.

regards
sudha
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not readily possible. Why do you need to do this? It's a red flag that you are trying to do something in the JSP that should have been handled in the controller.
[ May 08, 2008: Message edited by: Bear Bibeault ]
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for info ..I am not clear how to check the value in the controller ..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well some details as to what you are doing might help.
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
String sample;
The sample can have "abcd" or "1234".

if it has character data like abcd then i need to do operation 1
else if it has numeric data like 1234 i need to do operation 2.

I want to check whether the string has numeric data or character. I am not clear how to do that.

Any help is appreciated.
Sudha
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What will be the differing operations that you will trigger? Again, you are making us pull teeth to find out what you are doing.

if the reason for the test is to process the data differently, that should take place in controller. If the reason is to effect different view options, you can test in the controller and set an easily-referenced flag the the JSP can use to trigger different view options.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!