Hi all ,
I need to transfer data from jsp to servlet..
am accessing db from servlet .. I need to tranfer those db content to my jsp page how can I achieve that .
thanks in advance
anand01 0 Junior Poster
Recommended Answers
Jump to PostHow do you redirect from the servlet to the jsp?
Jump to Postresponce .sendRedirect("user.jsp");
For single values that approach could work. You can use this:
String value1 = "aaaa"; String value2 = "bbbbb"; responce.sendRedirect("user.jsp?param1="+value1+"¶m2="+value2);
At the jsp you can use this:
String param1 = request.getParameter("param1"); String param2 = request.getParameter("param2");
When sending data like …
Jump to Postlist is an objct. So put into the request (request.setAttribute) like my second example
Jump to PostThreads merged. Please don't start additional threads for a single question.
All 16 Replies
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
anand01 0 Junior Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
javaAddict 900 Nearly a Senior Poster Team Colleague Featured Poster
anand01 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.