reset password
Author Message
jpatel43
Posts: 11
Posted 23:51 Jun 28, 2015 |

Hi,

Model class: 

public class NameNdJobs {
String name;
ArrayList<String> jobsApplied;

 

}

How do I get all values from jobsApplied on jsp page and compare with one string variable?

I have tried inner loop concept. It doesn't work for me. I can't see any output on jsp. So, there might be problem with loop or comparison with string variable and jobsApplied values.What is the jstl loop structure for variable with list of values.?

Thanks.

neilchoksi
Posts: 29
Posted 00:00 Jun 29, 2015 |
Well you want to get value from jsp to servlet and then compare it with some string value? And then again display it to some other jsp ?
jpatel43
Posts: 11
Posted 00:45 Jun 29, 2015 |

Nope. I want values from ArrayList. 

Eg. For single value: 

ArrayList<Jobs> entries = new ArrayList<Jobs>();

Then,on JSP page:

<c:forEach items="${entries}" var="entries" >
        ${entries.variable}
</c:forEach>

where, usually we have variable as a string value or int value.

But, I have defined ArrayList string variable there in model instead of just string variable.

jpatel43
Posts: 11
Posted 00:51 Jun 29, 2015 |

Got the solution. Thanks for reply NEILCHOKSI.