Solved

Invoke Method in Servlet

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

823 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