Solved

Invoke Method in Servlet

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Is possible to make a jsp script work with oracle wallet? 7 106
maven set up 2 206
struts hibernate integration example 28 157
eclipse luna javeEE perspecive missing 5 122
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

738 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