Here is how you would call a servlet when a user clicks on the menu:
(Assuming that the menu is made of CSS and HTML, and the menu item is an anchor html tag <a>)
<html>
<head>
<script type='text/javascript'>
function invokeServlet()
{
// form a URL with the servlet name to be invoked
var URL = 'http://hostname/servlet/servletName';
// This line will inkove a servlet and reload your page
location.href = URL;
}
</script>
</head>
<body>
<a href='#' onclick='invokeServlet()'>Click here to invoke servlet</a>
</html>
|