This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OGNL string manipulation

 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have set a property roles as below

This is displaying properly as


So my string contains S01,R01,G01,T01
How do i search the string for specific values like S01 or T01

The following code is not working


How to search strings withing strings .. rather in java terms (how get indexOf function)

Regards,
Vanlal
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

there is no conatains method that ognl uses...to perform selection.

roles is a collection or what??

Regards..
Raza
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

there is no conatains method that ognl uses...to perform selection.
roles is a collection or what??


It is a string
I do not know how to search a pattern in the string ...


Regards,
Vanlal
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you can use..




I think it will work.
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raza Mohd wrote:Here you can use..




I think it will work.


This will not work . This will compare a string only ...
My String is "S01,R01,G01,T01"
How do i search a pattern in this string ??


 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either you will have to use...Jstl function tags..that facilitates to manipulate String.

Or Either you need to get a List in place of String n use Selection projection on List Objects.

Hope that would help..

Thanks n Regards.

Raza
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if there is problem let me know..

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic