| | |
please help!!!!
![]() |
•
•
Join Date: Dec 2005
Posts: 5
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Dec 2005
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by sam1
apparantly it can not find the class Question. If you have the class in another package try importing it.
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
•
•
Join Date: Dec 2005
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by sam1
apparantly it can not find the class Question. If you have the class in another package try importing it.
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
•
•
Join Date: Dec 2005
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by jwenting
the double quotes are supposed to be there.
ALL attributes in html and xml files should always be quoted.
later
•
•
Join Date: Dec 2005
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by jwenting
the double quotes are supposed to be there.
ALL attributes in html and xml files should always be quoted.
later
![]() |
Other Threads in the JSP Forum
- Previous Thread: netbean
- Next Thread: displaying gif image
Views: 2582 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for JSP
action apache array books boonex call combobox comma connection controller csv database debugging devlopment dropdownlist dynamicpagetitles examples excel exception foreach form forward frames function generating glassfish ie8 image2database imagestoring imagetodatabase installer integer internet jasper java javaee javascript jsp jsppagetitles mime-rfc multiple mysql netbeans network non-standard-mime objects online open parameters passing ping project quickguide read redirect request.getparameter resorces response resultset seperated service servlet session sessions social source sql ssl standard-mime system textbox tomcat unique update values video view voting web whileloop write






