
I could not find my mistake. Here is my code. Thanks in advance.
<body>
<%
String pack_id = request.getParameter("pack_id");
String pack_name = request.getParameter("pack_name");
String pack_day = request.getParameter("pack_day");
String pack_price = request.getParameter("pack_price");
String pack_max = request.getParameter("pack_max");
String pack_act = request.getParameter("pack_act");
//String pack_meal = request.getParameter("pack_meal");
String meal="";
String pack_meal[]=request.getParameterValues("pack_meal");
for(int i=0;i<pack_meal.length;i++){
meal+= pack_meal[i]+" ";
}
String act="";
String act_name[]=request.getParameterValues("act_name");
for(int i=0;i<act_name.length;i++){
act+= act_name[i]+" ";
}
%>
<%
String addPackage = "INSERT INTO ACTIVITY VALUES('"+pack_id+"','"+pack_name+"','"+pack_day+"','"+meal+"','"+act+"','"+pack_price+"','"+pack_max+"')";
Statement statement = conn.createStatement();
statement.executeUpdate(addPackage);
%>
<script language="javascript">
alert("Successfully Inserted!");
//response.sendRedirect("Student/homeStudent.jsp");
window.location.href = "adminCreatePackage.jsp";
</script>
}
}
</body>
</html>

I had also faced the same problem. I got the solution to solve this problem.
Root of this problem is: I had added the servlet-api.jar and jsp-api.jar in my application lib directory. If Apache-tomcat is used to run application then its not necessary to add this jar files in our lib directory.
Goto build Path -> add external jars from tomcat-lib dir. Instead of adding(copying) it in lib dir of application.
This will resolve the problem.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.