• Post Reply Bookmark Topic Watch Topic
  • New Topic

"cannot resolve symbol" when passing JspWriter to my class  RSS feed

 
Lucas Mach
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm making a webpage using JSP and I'd like to be able to print to the
webbrowser in my class. Below is what i think is the relevant part of
my class. I believe I have included the right packages and I believe
everything else is correct but for some reason I get an error when I
try to compile my class. Anyone know what coudl be the problem?

The error message i get when i try to compile the class is:

my class:


I'm kind of a java newbie (even more so to JSP), but I could have sworn
I was including the right packages...Am I reading the Java API wrong?

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/JspWriter.html

--Lucas
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not importing JspWriter. But, in my opinion, you shouldn't be doing things this way at all. If you have something to emit to the output, return it as a String value to the JSP page rather than passing something as volatile as the writer around.
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to import javax.servlet.jsp.JspWriter..
but again you are using JSP right???
 
Lucas Mach
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Niki Nono:
you need to import javax.servlet.jsp.JspWriter..
but again you are using JSP right???


we are using JSP, but what I'm trying to do is print something to the web browser from within a method in my class. I'm currently trying to debug a problem in my method and I think that simply being able to add an out.println would make debugging a lot easier...

When I try to import javax.servlet.jsp.JspWriter i get:

DbClass.java:4: package javax.servlet.jsp does not exist
import javax.servlet.jsp.JspWriter;
^
DbClass.java:8: cannot resolve symbol
symbol : class JspWriter
location: class bkwrmspackage.DbClass
public static int verifyUser(String username, String password,
JspWriter out) {
^
2 errors

How is this possible if I have no problem using the out JspWriter in my
JSP pages?

is JspWriter possibly in some other class as well?
[ April 19, 2005: Message edited by: Lucas Mach ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!