• Post Reply Bookmark Topic Watch Topic
  • New Topic

Datasource

 
J Craig
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello is there any restriction in where you can access your datasource?
I mean does it have to be from servlet or jsp or can any class access it?
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any class can access a datasource. You can create a Java bean that encapsulates your business logic, and then the servlet (or JSP) can access that bean.

In fact, I believe that the preferred architecture is to use JSPs mainly for doing UI stuff, with either no or minimal Java logic. The servlet then acts as a traffic cop, creating the appropriate beans based on the request, and calling the appropriate JSP for displaying the results.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!