wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Please help" Watch "Please help" New topic
Author

Please help

PALANI KUMART
Greenhorn

Joined: Oct 22, 2003
Posts: 28
I have solved all the previous problems. Now I'm back to square one again. i am trying to create a calendar in my Tomcat Engine using Eclipse IDE. Yesterday everything was dandy. Bujt suddnely they are not working The error i get during compliation is :-
E:\eclipse\workspace\Test1\work\org\apache\jsp\Auct_jsp.java:10: cannot resolve symbol
symbol : class Calendar
location: class org.apache.jsp.Auct_jsp
Calendar cal = Calendar.getInstance();
^
E:\eclipse\workspace\Test1\work\org\apache\jsp\Auct_jsp.java:10: cannot resolve symbol
symbol : variable Calendar
location: class org.apache.jsp.Auct_jsp
Calendar cal = Calendar.getInstance();
^
E:\eclipse\workspace\Test1\work\org\apache\jsp\Auct_jsp.java:11: cannot resolve symbol
symbol : class DateFormatSymbols
location: class org.apache.jsp.Auct_jsp
String[] monthNames = (new DateFormatSymbols()).getMonths();
^
E:\eclipse\workspace\Test1\work\org\apache\jsp\Auct_jsp.java:49: cannot resolve symbol
symbol : variable Calendar
location: class org.apache.jsp.Auct_jsp
out.print(monthNames[cal.get(Calendar.MONTH)]);
^
4 errors
So the compiler is not able to understand the Calendar Interface.
? But HelloWorld is working fine. Please someone help. It will be annoying to see one person putting so many questions but I'm really desperate please help.
Kumar
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
Calendar is not in the java.lang package, so you'll need to tell the compiler where to find it with an import statement.
DateFormatSymbols is also not in the java.lang package, and it's not in same package as Calendar, so you will require another import statement to tell the compiler where that one is.
read about the jsp page tag (hint: it has an import attribute)
PALANI KUMART
Greenhorn

Joined: Oct 22, 2003
Posts: 28
Sorry Ray,
I should have made everything clear in my question. I do have a page directive
<!@ page import = "java.util.*, java.text.DateFormat, java.text.DateFormatSymbols"%>
Thas is what bugs me. all this worked fine last night. That is why I wanted to make sure whether the compiler is understanding all the classes ?
Thanks for the input
Kumar
PALANI KUMART
Greenhorn

Joined: Oct 22, 2003
Posts: 28
Originally posted by Ray Stojonic:
Calendar is not in the java.lang package, so you'll need to tell the compiler where to find it with an import statement.
DateFormatSymbols is also not in the java.lang package, and it's not in same package as Calendar, so you will require another import statement to tell the compiler where that one is.
read about the jsp page tag (hint: it has an import attribute)

Sorry Ray,
I should have made everything clear in my question. I do have a page directive
<!@ page import = "java.util.*, java.text.DateFormat, java.text.DateFormatSymbols"%>
Thas is what bugs me. all this worked fine last night. That is why I wanted to make sure whether the compiler is understanding all the classes ?
Thanks for the input
Kumar
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
Well now, that is interesting, isn't it?
I thought you meant the HelloWorld jsp was working last night, and now this one isn't...
I'm away from my main programming pc, hmmm, does HelloWorld use anything from outside the lang package?
Oooh, if that's a direct paste from your code the <!@ should be <%@
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
Good thing you included that. Anyway, as a sidenote, when I write a bug in JSP, I've found it helpful to comment out the obviously offensive code and peruse the generated html. In this case, Tomcat not knowing what to do with it, the page tag would have been written to the screen, or at least in the html source, making it obvious that there's a problem with it.
I've not found the generated java, located in
%tcathome%/work/standalone/localhost/<appname> to be much help, your results may differ.
PALANI KUMART
Greenhorn

Joined: Oct 22, 2003
Posts: 28
Hi Ray,
Not sure what went wrong. I renamed the file. Removed the old one stopped and started the Server. (By the way each time i do that the time taken to start is increasing!!!). Now it works Thank you very much for your input.
Kumar
PALANI KUMART
Greenhorn

Joined: Oct 22, 2003
Posts: 28
Hi Ray,
Not sure what went wrong. I renamed the file. Removed the old one stopped and started the Server. (By the way each time i do that the time taken to start is increasing!!!). Now it works Thank you very much for your input.
Kumar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help