This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes about javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "about javascript" Watch "about javascript" New topic
Author

about javascript

Archana Katakam
Greenhorn

Joined: Aug 21, 2013
Posts: 7


is it gud approach to write logic in the javascript (getting db connection,query etc) in jsp in frameworks like struts spring.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30067
    
149

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: about javascript
 
Similar Threads
mistake in for loop
passing a list of parameter from the command line
Dependent Drop-down Combo boxes
javascript and include files?
regular expression which doesnt alllow *