can some one help me figure this out or tell me what i am doing wrong ???
this is my code down below and the problem is at line 88
I am using Struts
basically what i have done is created an action class and a DAO which inserts the data into the tables I could fill up the data fields without the servlet but once i created the servlet i get that error
this is my web.xml file
And this is what i get when i try to deploy it
SEVERE: Servlet.service() for servlet [candrep] in context with path [/project] threw exception [Servlet execution threw an exception] with root cause
java.lang.Error: Unresolved compilation problem:
Unreachable catch block for ClassNotFoundException. This exception is never thrown from the try statement body
Piyush Mangal wrote:ClassNotFoundException is a checked exception and your code is not throwing it anywhere explicitly. So compiler is telling you that this code will never be executed, Please remove that try and catch block as it is not required.
i removed the try and catch block but this is what i get when i try to deploy
Your FirstName is :null
Your Last Name is :null Your Contact Number is :null Your Contact Number is :null Your Contact Number is :null Your Email is :null Your Current Industry :null Your Current Industry :null Your Preferred Industry is :null Your Current Industry :null
and further more it inserts the querry into the database table
Insert Query formed: INSERT INTO candreppage4.posts(FirstName,LastName,Gender,Qualification,Email,ContactNumber,Industry,WorkExperience,PreferredIndustry,EmploymentStatus) VALUES('null','null','null','null','null','null','null','null','null','null')
well when i deploy it does not show me the required jsp and after i removed the try and catch block that's the result i got and it inserted a querry into the table
And why do you think it should show you a required jsp? Where are you forwarding to a JSP page in your servlet? Where are you checking for null values in your servlet?