aspose file tools*
The moose likes Struts and the fly likes OGNL string manipulation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "OGNL string manipulation" Watch "OGNL string manipulation" New topic
Author

OGNL string manipulation

vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
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

Joined: Jan 20, 2010
Posts: 247

hi

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

roles is a collection or what??

Regards..
Raza


Good luck!!
A small leak can sink a Gigantic ship.>
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170

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

Joined: Jan 20, 2010
Posts: 247

Here you can use..




I think it will work.
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
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

Joined: Jan 20, 2010
Posts: 247

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

Joined: Jan 20, 2010
Posts: 247

if there is problem let me know..

Thanks.
 
 
subject: OGNL string manipulation