Have you tested if browseRequest.getTags() returns the values you expect?
Does that work?
If yes, give us an example of what it returns.
If no, please inform us, and we will move your post to the JSP forum.
(by the way, you are using a very dangerous mechanism to run queries. A user can corrupt your database by putting a cunningly forged piece of sql in your text box.
What would happen if a user enters "TAG1%'; delete from customers; delete from vendors; select * from dual where x = 'X"
I'm not really sure on your logic of what you are trying to do.
In my opinion this method should return a List<String> tags which you can then use as you wish in your other query. Why have you decided to return comma seperated results?
Yes, perhaps the input should come in seperated by commas, but I think when it comes to writing the query surely you should be implementing it by splitting the string on the commas and looking for matches.
Perhaps we should step back a touch and you should explain exactly what you are trying to achieve, how does the user interact with the system, what actions do they need to do and what are they expected to get in return?