hear is my code
<HTML>
<HEAD><TITLE>Hello</TITLE></HEAD>
<BODY>
<H1>
Hello, <%= getName(request) %>
</H1>
</BODY>
</HTML>
<SCRIPT RUNAT="server">
String DEFAULT_NAME = "World";
String getName(HttpServletRequest req) {
String name = req.getParameter("name");
if (name == null)
return DEFAULT_NAME;
else
return name;
}
</SCRIPT>
i got this error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 4 in the jsp file: /jsp/bobby/hello3.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Software Foundation\Tomcat 4.1\work\Standalone\localhost\examples\jsp\bobby\hello3_jsp.java:42: cannot find symbol
symbol : method getName(javax.servlet.http.HttpServletRequest)
location: class org.apache.jsp.hello3_jsp
out.print( getName(request) );
^
1 error
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:248)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:343)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)