Please help

I keep getting this error message after compiling the following SimpleList.java

C:\jakarta-tomcat-5.0.28\webapps\Ch04\WEB-INF\classes\Ch04>javac SimpleList.java


SimpleList.java:21: cannot resolve symbol
symbol  : class Questions
location: class Ch04.SimpleList
Questions questions = new Questions();
^
SimpleList.java:21: cannot resolve symbol
symbol  : class Questions
location: class Ch04.SimpleList
Questions questions = new Questions();
^
2 errors

And this is the program:

package Ch04;


import java.util.*;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;



public class SimpleList extends SimpleTagSupport {
private String topic;


public void setTopic(String s ) {
topic = s;
}


public String getTopic() {
return topic;
}


public void doTag() throws JspException {
Questions questions = new Questions();
questions.setTopic(getTopic());


// Get List of questions, TreeMap will sort them by key
Map qmap = new TreeMap(questions.getQuestions());
Iterator faqs = qmap.values().iterator();
int count = 1;


while (faqs.hasNext()) {


try {
//Store the parameter for invoke()
getJspContext().setAttribute("qid", topic + "_" + count);
getJspContext().setAttribute("question", faqs.next());
count++;


//Process the body
getJspBody().invoke(null);



} catch (IOException e) {
throw new JspException("Exception processing body");
}
}


}
}

Can anybody sees the problem?

Thank you

Ditony :(

apparantly it can not find the class Question. If you have the class in another package try importing it.

apparantly it can not find the class Question. If you have the class in another package try importing it.

Hi Sam1:

Thank you for your replied....I gave back on this JSP problem, I have tried every possible way and still I have had problems with this JSP chapter.....

Anyway I skipped the last JSP pages and I am continuing with the Servlet Chapter....

On thing I found out about the authors, this is the worse book I have ever read and they are not clear in what they write.....

Also I have a small problem with the first servlet example and I am using Sun Application Developer and Tomcat 5.0.28 and this is what I am getting when I enter the URL - http://localhost:8080/Ch05/login.html

Login
Please enter your username and password
"/Ch05/Login" method="POST">

_________________
_________________

_________________
_________________

_________
Submit
_________

The error here is that this line is always there: "/Ch05/Login" method="POST">

Thank you anyway


Ditony

apparantly it can not find the class Question. If you have the class in another package try importing it.

Hi: Sam1

Now is working the first Servlet example....the problem is that in the html.login in the <form action="/Ch05/Login" method=POST> the POST had a double quotes(" "), so I remove them now is working fine in the Sun Application Server Deploytool and also in Tomcat 5.0.28....


Later

the double quotes are supposed to be there.
ALL attributes in html and xml files should always be quoted.

the double quotes are supposed to be there.
ALL attributes in html and xml files should always be quoted.

Thank you Sam1, I just enclosed the double quotes (" ") back into method="POST" and works fine....But It has been working fine without the double quotes (" ")...isn't that weird? .............uhuuuuhuh

later

the double quotes are supposed to be there.
ALL attributes in html and xml files should always be quoted.

Thank you jwenting, I just enclosed the double quotes (" ") back into method="POST" and works fine....But It has been working fine without the double quotes (" ")...isn't that weird? .............uhuuuuhuh

later

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.