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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s the difference between applets and standalone program?

979


What is a numeric string?

961


What is arrays fill in java?

947


Can memory leak in java?

983


What method is used to specify a container's layout in java programming?

1046


Describe the process as to how substring() methodology mechanisms in java.

1044


In java, how we can disallow serialization of variables?

936


Which is better singleton or static class?

919


Why isn’t there operator overloading?

1012


What is the return type of the main method?

984


What are annotations in java?

1036


Is integer a class?

1014


What data structures are used to perform recursion?

990


What is linkedlist in java?

931


Which is bigger double or float?

910