ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
how can i cal servlet from jsp page?how can i pass
variablesfrom the jsp that servlet can access?
 Question Submitted By :: Gopalraop
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access?
Answer
# 1
By using JSP forward attriputes within the html tag we can 
just forward our page to servlet.or by using 
response.sendRedirect()method we can call servlet page.
for example
-----------
<jsp:forward page="/relativepath/YourServlet" /> or 
response.sendRedirect("http://path/YourServlet"). 

We can also pass the parameters in the same way to the 
servlet
for example
-----------
<jsp:forward page=/relativepath/YourServlet>
<jsp:param name="name1" value="value1" />
<jsp:param name="name2" value="value2" />
</jsp:forward>
You may also pass parameters to your servlet by specifying 
response.sendRedirect("http://path/YourServlet?
param1=val1"). 

 
Is This Answer Correct ?    0 Yes 0 No
Ranjani
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What do you mean by Remote procedure call?  2
What is the difference between a Window and a Frame?  1
Without creating a new object, How you can retrieve a String or other object?  1
What is the difference between static and non-static variables?  2
write java code to print second max number in the array Huawei4
When does the compiler supply a default constructor for a class? TCS7
What are Encapsulation, Polymorphism and Inheritance?  1
they asked class A{} class B{} class c{} all the three class saved as a single file,there is no main method in the file and anothe class M.java class m { psvm(String args[]) { // here the parent class can access } } DNS1
What is Interface? BMC5
How to print nodes of a Binary tree? TCS1
Hey buddy.. can you please tell me about the use of marker interface? And is there any link between marker interface and factory methods? Thanks in advance.  2
Why would you desing a J2EE application so user data is entered by way of a JSP page and managed by an underlying Java Beans class? Adobe2
What is Servlet?  6
What is the minimum and maximum length of an identifier? TCS6
What are init(), start() methods and whey they are called?  2
what is the difference between cd & dvd ? Satyam4
What is encapsulation? Elaborate with example? BMC1
what is mean by method signature? Satyam4
What is the life cycle of an Applet ?  1
What is the differenc between Enemuration interface and iterator interface according to accessing?  4
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com