This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Meteor in Action and have Stephan Hochhaus & Manuel Schoebel on-line!
See this thread for details.
The moose likes Servlets and the fly likes Connection between servlet and jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Meteor in Action this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Connection between servlet and jsp" Watch "Connection between servlet and jsp" New topic

Connection between servlet and jsp

divya dhage

Joined: Aug 07, 2010
Posts: 2
Hi.. I am new to JAVA... I created one servlet page as controller and one JSP page for view.. now i want to connect these two pages.. how do i do it? please help me..

thanks in advance
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Welcome to JavaRanch! You want to connect JSP from servlet for viewing purposes? If so, Use RequestDispatcher.

|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62464

Use the forward() facility of the request dispatcher. That way, any scoped values that you place on the request (using setAttribute()) will be available within the JSP.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
divya dhage

Joined: Aug 07, 2010
Posts: 2
Thank You.....
I agree. Here's the link:
subject: Connection between servlet and jsp