i have done the basic example on jsp from HeadFirst servlets and Jsp.
The code of basic jsp is
Counter.java class//
public class Counter { private static int count; public static int getCount() { count++; return count; } };
and the Jsp page saved as BasicCounter.jsp <html> <body> <center>the page count is <%= Counter.getCount()%> </center> </body> </html> and web.xml file <web-app> </web-app>
my doubt is iam getting the error as org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 4 in the jsp file: /src/BasicCounter.jsp Counter cannot be resolved 1: <html> 2: <body> 3: <center>the page count is 4: <%= Counter.getCount()%> 5: </center> 6: </body> 7: </html>
please help me to slove it
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
You need to PackageYourBeans. It used to be possible to keep them in the default package, but no longer.