954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to send data frim servlet to JSP?

Im developing one application here i need to pass the data from servlet to JSP .How can i pass it ? i tried by request.setAttribute() but it printing as null in JSP page . how can i solve this problem?

manjukdvg
Newbie Poster
3 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

A bean? A session context object? an application context object? etc, etc, etc.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

try this,

create some session object,
for example;
you need to send the value of variable name;
session.setAttribute("name",variable name);
and get in on jsp using;
String name=(String)session.getAttribute("name");
or
for same thing you can also try this:
response.sendRedirect("JspName.jsp?name="+variablename);
get values on your jsp page using;
String name=request.getParameter("name");

punit.it
Newbie Poster
3 posts since Sep 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: