Solved

Invoke Method in Servlet

Posted on 2006-11-13
2
391 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
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 125 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now