Results 1 to 11 of 11
Thread: using servelts and Jsp
- 10-16-2009, 07:35 AM #1
Member
- Join Date
- Oct 2009
- Posts
- 5
- Rep Power
- 0
- 10-16-2009, 08:28 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You submit the JSP to that servlet and in the servlet you call that function.
What have you done so far?
- 10-16-2009, 09:01 AM #3
Member
- Join Date
- Oct 2009
- Posts
- 5
- Rep Power
- 0
r035198x
can u give sample code to write method in servlet and call in jsp.I was just able to call the servlet with just basic output "hello" .
I used the following code in jsp
<%
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/abc");
dispatcher.include(request,response);
%>
- 10-16-2009, 09:07 AM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Don't write Java code in JSPs. What do you want the method to do? Like I said you don't actually call the method from the JSP, instead you submit the JSP to a servlet. The servlet then calls the method and could store the results(if any) as an attribute which that JSP or other JSPs can access.
- 10-16-2009, 10:36 AM #5
Member
- Join Date
- Oct 2009
- Posts
- 5
- Rep Power
- 0
I want to write just a small function in servlet.I have to send a parameter from jsp like "name " then it should return "Hello Name".
- 10-16-2009, 10:59 AM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
I have a special gift. When I post responses on some threads in forums, I can see them but other people cannot. I have always known there was something special about me.
- 10-16-2009, 11:04 AM #7
Member
- Join Date
- Oct 2009
- Posts
- 5
- Rep Power
- 0
why are u feeling so .I am new java learner that is the reason I cannot follow your replies easily
- 10-16-2009, 11:06 AM #8
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
- 10-16-2009, 11:09 AM #9
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Find a JSP and servlets tutorials and read it first then.
Sun's JavaEE tutorial is pretty comprehensive.
- 10-16-2009, 11:19 AM #10
Member
- Join Date
- Oct 2009
- Posts
- 5
- Rep Power
- 0
ok sure ,but now I require that functionality, please tell me if it is possible or not, if it is then please give a sample code.
Any function in servlet calling it in jsp.
plzzzzzzzzzzz
- 10-16-2009, 11:28 AM #11
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks