• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use join in JSTL function?  RSS feed

 
Prashant Soood
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JSTL so my teacher taught me that i should use JSTL like this:

In JSP page: firstly set the setter of a entity in bean and then set it in session,request etc. and gvet values using foreach loop as follow :



He told me in java bean class make a function and tell it to return list.Here is Java bean class named student_details:

Now my first question is this approach right to use JSTL.Secondly I have 2 problems using this approach if I use join in the above SQL query How i will be able to add two objects of two classes in a arraylist and iterate it over through foreach tag because using this apprach i am able to set values of a single class only.Thirdly when i use this query how i will be able to pass parameters to a JSTL function:



Here start is the variable whose value will vary after every time i visit this function.So how would i be able to use above query.

P.S. i was using scriplet before and i was able to deal these issues with scriplet easily.
 
Mauro Trevigno
Ranch Hand
Posts: 99
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. JSTL provides tags for almost every task that need to work over JSP.
2. I recommend to create a view over your DB and point to your view.
3. Yes, you will be able.

P.S: You was able to deal these issues easily with scriplets because you was used to , but its easier when you used to JSTL.

Regards,
-M
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!