• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL SQL Query, assigning a session variable in the Query syntax  RSS feed

 
Robert Insanovation White
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my JSP I need to retrieve some data from MySQL. I need to assign a "email" variable to the "WHERE" clause. The variable is retrieved from the session attribute.

So far, I have this code:



It doesn't work. Please, suggest me an idea.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest performing the database access in the model layer rather than the presentation layer.
 
Robert Insanovation White
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I appreciate your suggestion, it strives for a better code design.

Still, I found the solution:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!