Can anyone tell me why the above code doesn't work and give me the following error and the bottom code does.
Thanks
///////////////////////////////////
NOT WORKING CODE
///////////////////////////////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%! String sal = request.getParameter("username" %>
<%= sal%><br/>
</body>
</html>
///////////////////////////////////
THE ERROR RETURNED:
///////////////////////////////////
jrunx.compiler.DefaultCFE: Compiler errors:
Found 1 semantic error compiling "C:/JRun4/servers/scwaLab/default-ear/default-war/WEB-INF/jsp/jrun__test2ejsp9.java":
63. String sal = request.getParameter("username"
<----->
*** Error: "request" is either a misplaced package name or a non-existent entity.
at jrunx.compiler.JavaCompiler.compile(JavaCompiler.java:138)
at jrunx.compiler.JavaCompiler.compile(JavaCompiler.java:97)
at jrun.jsp.Translator.compilePage(Translator.java:176)
at jrun.jsp.Translator.translate(Translator.java:254)
at jrun.jsp.Translator.translate(Translator.java:101)
at jrun.jsp.JSPEngine.translateJSP(JSPEngine.java:693)
at jrun.jsp.JSPServlet.translate(JSPServlet.java:125)
at jrun.jsp.JSPServlet.service(JSPServlet.java:113)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
javax.servlet.ServletException: Translator.CompilationFailedExceptionCompiler errors:
Found 1 semantic error compiling "C:/JRun4/servers/scwaLab/default-ear/default-war/WEB-INF/jsp/jrun__test2ejsp9.java":
63. String sal = request.getParameter("username"
<----->
*** Error: "request" is either a misplaced package name or a non-existent entity.
at jrun.jsp.Translator.compilePage(Translator.java:187)
at jrun.jsp.Translator.translate(Translator.java:254)
at jrun.jsp.Translator.translate(Translator.java:101)
at jrun.jsp.JSPEngine.translateJSP(JSPEngine.java:693)
at jrun.jsp.JSPServlet.translate(JSPServlet.java:125)
at jrun.jsp.JSPServlet.service(JSPServlet.java:113)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
///////////////////////////////////
WORKING CODE
///////////////////////////////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<% String sal = request.getParameter("username" %>
<%= sal%><br/>
</body>
</html>
Thanks
///////////////////////////////////
NOT WORKING CODE
///////////////////////////////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%! String sal = request.getParameter("username" %>
<%= sal%><br/>
</body>
</html>
///////////////////////////////////
THE ERROR RETURNED:
///////////////////////////////////
jrunx.compiler.DefaultCFE: Compiler errors:
Found 1 semantic error compiling "C:/JRun4/servers/scwaLab/default-ear/default-war/WEB-INF/jsp/jrun__test2ejsp9.java":
63. String sal = request.getParameter("username"
<----->
*** Error: "request" is either a misplaced package name or a non-existent entity.
at jrunx.compiler.JavaCompiler.compile(JavaCompiler.java:138)
at jrunx.compiler.JavaCompiler.compile(JavaCompiler.java:97)
at jrun.jsp.Translator.compilePage(Translator.java:176)
at jrun.jsp.Translator.translate(Translator.java:254)
at jrun.jsp.Translator.translate(Translator.java:101)
at jrun.jsp.JSPEngine.translateJSP(JSPEngine.java:693)
at jrun.jsp.JSPServlet.translate(JSPServlet.java:125)
at jrun.jsp.JSPServlet.service(JSPServlet.java:113)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
javax.servlet.ServletException: Translator.CompilationFailedExceptionCompiler errors:
Found 1 semantic error compiling "C:/JRun4/servers/scwaLab/default-ear/default-war/WEB-INF/jsp/jrun__test2ejsp9.java":
63. String sal = request.getParameter("username"
<----->
*** Error: "request" is either a misplaced package name or a non-existent entity.
at jrun.jsp.Translator.compilePage(Translator.java:187)
at jrun.jsp.Translator.translate(Translator.java:254)
at jrun.jsp.Translator.translate(Translator.java:101)
at jrun.jsp.JSPEngine.translateJSP(JSPEngine.java:693)
at jrun.jsp.JSPServlet.translate(JSPServlet.java:125)
at jrun.jsp.JSPServlet.service(JSPServlet.java:113)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
///////////////////////////////////
WORKING CODE
///////////////////////////////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<% String sal = request.getParameter("username" %>
<%= sal%><br/>
</body>
</html>