the following is encountered
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 10 in the jsp file: /result.jsp
arraylist cannot be resolved to a type
10: arraylist result= request.getAttribute("styles");
11: for(int i=0;i<=1;i++)
12: out.println("<br>try tea:"+result[i]);
Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.
Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
Also, it is not clear to me what the servlet code has to do with your JSP issues.
the servlet is passing an array to jsp
well thats all stuff is being used in a complete tomcat application
this is required
user clicks on a color in html page and a request is sent to servlet which uses java code for decision on tea brand and finally jsp is there to print the result to happy user and jsp page is not executing so suggest a valid jsp code which will work
Now that I can see your code, it makes little sense. Your servlet emits an HTML page and then also forwards to a JSP? What's the point of that? You can only return one response per request. Do you want to return the HTMl generated by the servlet, or do you want to return the HTML generated by the JSP? It makes no sense to do both.
And in the same way that a JSP shouldn't contain Java code, a servlet shouldn't emit HTML. Each the servlet and the JSP has their own job. The servlet should process data and prepare it for the JSP, which should only concentrate on creating the view (HTML page) and do so without embedded Java code.