Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how can i cal servlet from jsp page?how can i pass
variablesfrom the jsp that servlet can access?



how can i cal servlet from jsp page?how can i pass variablesfrom the jsp that servlet can access?..

Answer / ranjani

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 ?    11 Yes 1 No

Post New Answer

More Core Java Interview Questions

Difference between throw and throws?

0 Answers  


Can we write class inside a class in java?

0 Answers  


What are the uses of final, finally and finalize in java?

2 Answers   Agiline, FINO PayTech, HCL,


Is string a data type in java?

0 Answers  


What is the difference between pageContext and page implicit objects in jsp?

9 Answers   Gspann Technologies, Merrill Lynch, Polaris,


What are the major drawbacks of external iteration?

0 Answers  


What is binary tree in java?

0 Answers  


Implementations of set interface?

0 Answers  


What are inbuilt functions in java?

0 Answers  


How big is a pointer?

0 Answers  


What are the names of Component subclasses that support painting?

1 Answers  


what is the use of finalize()Method please explain with an example

3 Answers  


Categories