Solved

jsp and servlet question (should be simple)

Posted on 2006-11-18
3
200 Views
Last Modified: 2010-04-01
I'm new to using JSP so this question should be simple.  I have a servlet already created that runs a process and generates a message, and i have an html page already created.  

What i want to do is simply display the message in the html.  My question is how would i get the message from the servlet to the jsp page?
Would i just store the message in the session variable in the servlet and pull it out from the session in the jsp page, and if so how can this be done?
0
Comment
Question by:tbboyett
  • 2
3 Comments
 
LVL 10

Expert Comment

by:jaggernat
ID: 17973287
0
 
LVL 5

Author Comment

by:tbboyett
ID: 17973361
Hey jaggernat thanks for the response.

I understand how to use the Printwriter in a servlet but i'm trying to determine if there is an easy way to pass information from a servlet to a JSP page.  My reason for doing this is because the html page is rather complicated and i would prefer not to generate it in the servlet since it is already created.

is there an easy way to pass the information from servlet to jsp?
0
 
LVL 10

Accepted Solution

by:
jaggernat earned 300 total points
ID: 17973585
put the informaiton in session (in servlet)  and retrieve it in the jsp.
you would use

session.setAttribute("objname",obj)   in servlet

and

session.getAttribute("objname");   in the jsp
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
loop through list of objects 14 186
reflection example 3 79
gZip compression filter 2 91
maven project jars 7 46
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
In  today’s increasingly digital world, managed service providers (MSPs) fight for their customers’ attention, looking for ways to make them stay and purchase more services. One way to encourage that behavior is to develop a dependable brand of prod…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

10 Experts available now in Live!

Get 1:1 Help Now