?
Solved

Invoke Method in Servlet

Posted on 2006-11-13
2
Medium Priority
?
397 Views
Last Modified: 2006-11-27
I am implementing MVC model, so I separate the business login from the presentation. I don't want to write code in the JSP page to retrieve data from the database, But invoke method in the Servlet. Can I call method in the JSP page from the Servlet without invoking cadoPost or doGet?
0
Comment
Question by:Sh_Rashed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Expert Comment

by:Manish
ID: 17936259
Basically get all the values from db, store it in viewBean and forward it to jsp and locate bean in jsp(use useBean tag)  and show it.
0
 
LVL 12

Accepted Solution

by:
enachemc earned 375 total points
ID: 17963506
the JSP code you write will be called automatically from doGet and doPost. You can make methods and global variables (to the generated servlet class) in your JSP

instead of <% %> use <%! %>
This will instruct the JSP parser to put all the content of <%! %> at the class level of the servlet.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question