Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP MVC  RSS feed

 
nick theodoropoulos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose i have a web application. For the model layer i use ejb 3.0 , and i have also written some named queries. For the controller layer i use servlets , whose results i forward to jsp pages. For the view layer i use jsp pages. For my intro page , i would like to have a jsp page that uses som named queries automatically ( when i open the page , these queries have been executed , without me having to send a form). How can i achieve that without ruining my architecture , or which is the proper way ?
(my named queries could be top 10 songs, top books etc). Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Easy way: have an index.jsp that redirects to a servlet that initiates the actions you request. Never put non-view components in the JSP itself.

More correct way: redefine the "welcome file" in your deployment descriptor to be the servlet that kicks off the actions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!