Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection between servlet and jsp

 
divya dhage
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Divya
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch! You want to connect JSP from servlet for viewing purposes? If so, Use RequestDispatcher.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64711
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
divya dhage
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic