| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|
#4 (permalink) |
|
Member
Join Date: Mar 2008
Posts: 32
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: JSP and Servlets Question?
Hi Radhika,
U can pass parameters from jsp to servlet or servlet to jsp using hidden fields concept. For example, Sample.jsp --------- Sample.java(servlet file) ----------------------- String msg=request.getParameter("msg"); out.println(msg); This is the one way of passing value from jsp to servlet. If it is wrong please correct me. Regards, R.P.Karunakaran. Last edited by writetokaruna@yahoo.com; 24-03-08 at 06:16 PM. Reason: Jsp code is not displaying |
|
|
|
|
|
#5 (permalink) |
|
Member
Join Date: Mar 2008
Posts: 32
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: JSP and Servlets Question?
Hi Radhika,
U can pass parameters from jsp to servlet or servlet to jsp using hidden fields concept. For example, Sample.jsp <%! String msg="Hi"; %>> --------- Sample.java(servlet file) ----------------------- String msg=request.getParameter("msg"); out.println(msg); This is the one way of passing value from jsp to servlet. If it is wrong please correct me. Regards, R.P.Karunakaran. |
|
|
|
|
|
#7 (permalink) |
|
Junior Member
Join Date: Apr 2008
Age: 29
Posts: 2
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: JSP and Servlets Question?
JSP to servlet communication is possible in different ways
1. we can use redirect 2. RequestDispatcher 3. ServletConfig.getServletConfig ... By implemeting all these methods JSp can communicate with Servlet |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|