Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

about javascript  RSS feed

 
Archana Katakam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


is it gud approach to write logic in the javascript (getting db connection,query etc) in jsp in frameworks like struts spring.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37242
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Archana,
It isn't a good idea to have logic in the JSP at all. Read about MVC which is a pattern that both Spring and Struts follow.

JavaScript is used in the front end (browser) so you couldn't have database connectivity code there anyway. Unless it was HTML 5 referring to a "database" in the browser itself. I don't think that is what you are asking about though.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!