Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

out.println in jsp?

843840Dec 12 2007 — edited Dec 12 2007
Can out.println be used in JSP? I got the following error:
I have googled that out.println cannot be used in a method declaration, which is what i've done. So what do i do from there?
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\build\generated\src\org\apache\jsp\menu_005ftest_jsp.java:39: cannot find symbol
symbol  : variable out
location: class org.apache.jsp.menu_005ftest_jsp
                        out.println("<li><a href=" + strMenuLink + ">" + strMenuName + "</a>");
                        ^
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\build\generated\src\org\apache\jsp\menu_005ftest_jsp.java:40: cannot find symbol
symbol  : variable out
location: class org.apache.jsp.menu_005ftest_jsp
                        out.println("<ul>");
                        ^
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\build\generated\src\org\apache\jsp\menu_005ftest_jsp.java:42: cannot find symbol
symbol  : variable out
location: class org.apache.jsp.menu_005ftest_jsp
                        out.println("</ul>");
                        ^
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\build\generated\src\org\apache\jsp\menu_005ftest_jsp.java:44: cannot find symbol
symbol  : variable out
location: class org.apache.jsp.menu_005ftest_jsp
                        out.println("<li><a href=" + strMenuLink + ">" + strMenuName + "</a></li>");
                        ^
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\build\generated\src\org\apache\jsp\menu_005ftest_jsp.java:113: out is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
                    PrintWriter out = response.getWriter();
                                ^
5 errors
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\nbproject\build-impl.xml:364: The following error occurred while executing this line:
C:\Documents and Settings\USER\Desktop\FOS_Menu\FOS_Menu\nbproject\build-impl.xml:149: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
At first i didnt declare a PrintWriter but then after i first got the error, i just threw it in. But it seems that even that part has an error too. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2008
Added on Dec 12 2007
9 comments
822 views