• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to call a function in a servlet..  RSS feed

 
rejieve alexander
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone tell me in how to call a function in a servlet thro' a jsp page..
 
Michael Arnett
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you explain a bit more of what you are trying to do? One way to do it would be to add some inline java code (a scriptlet) into your jsp and make the call there. For example,
<%
String myString = myServlet.myFunction();
%>
Hope this is helpful...
-MLA
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This kind of breaks the MVC paradigm.

One way to do this is to send in the function you want to call in the query string. Retrieve the value from the query string, and use this value to call the function.
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
R.A
could you pour some more info on what exactly u wanna do...??
good luck
malhar
 
rejieve alexander
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
Well it's like this,
i want to chk for a user's login thro' a servlet which connects to the database , and then pass a String array back to the jsp page from the servlet.So which is the best possible way to pass a String[] back to the jsp...
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!