Hello!
After reading your question, I think it has some issues. I cannot think what is your purpose of using Scriptlet code in this page. You cannot use "request.getParameter()" method, before the form is submitted. There is no way to use html values in scriptlet. But, you can use scriptlet values in HTML tags. For your code, I would suggest to move the scriptlet code to server side. Then, it gonna be ok. Here's my sample code for you...^^
In index.jsp,
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="servletUrl" method="get">
<input type=text name="urltext"> Listed menu:
<select name="menuitems" onChange="selectChanged(this);">
<option>select...</option>
<option value="Products">Products</option>
<option value="Solutions">Solutions</option>
<option value="Views">Views</option>
<option value="Services">Services</option>
<option value="About">About</option>
<option value="Support">Support</option>
</select>
<br />
<br />
<input type="submit" name="btn" value="submit">
</form>
</body>
</html>
In java class,
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try{
GetMenuData gm = new GetMenuData();
String str = gm.displayData(request.getParameter("menuitems"));
System.out.println(str);
}catch (Exception exp) {
System.out.println(exp.getMessage());
}
}