By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,862 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,862 IT Pros & Developers. It's quick & easy.

cannot find symbol

P: 1
Thanks to Gannon11 and ro351988- Moderator.
I give below the complete Java file and pls help me to rectify the errors.

package com.wrox.proj2ee.ch10.app;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.wrox.proj2ee.ch12.*// The requesthandlers interface in this package.
public class ShowRecordRequesthandler implements RequestHandler
{
private DataStore dataStore;

public ShowRecordRequestHandler()
{
dataStore = new DataStore();
}
public String handleRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException
{
String name = request.getParameter("name");
if (name == null)
{
return "enterName.jsp";
}
else
{
DataBean dataBean = dataStore.getInfo(name);
if (dataBean == null)
{
return "sorryNotFound.jsp";
}
else
{
request.setAttribute("dataBean", dataBean);
return "showInfo.jsp";
}

}
}
}
I am getting the following errors:


C:\Program Files\Java\jdk1.5.0_11\bin>ShowRecordRequesthandle r.java

C:\Program Files\Java\jdk1.5.0_11\bin>javac ShowRecordRequesthandler.java
ShowRecordRequesthandler.java:6: cannot find symbol
symbol : class ch10
location: package com.wrox.proj2ee
import com.wrox.proj2ee.ch10;
^
ShowRecordRequesthandler.java:7: cannot find symbol
symbol: class RequestHandler
public class ShowRecordRequesthandler implements RequestHandler
^
ShowRecordRequesthandler.java:9: cannot find symbol
symbol : class DataStore
location: class com.wrox.proj2ee.ch10.app.ShowRecordRequesthandler
private DataStore dataStore;
^
ShowRecordRequesthandler.java:13: cannot find symbol
symbol : class DataStore
location: class com.wrox.proj2ee.ch10.app.ShowRecordRequesthandler
dataStore = new DataStore();
^
ShowRecordRequesthandler.java:24: cannot find symbol
symbol : class DataBean
location: class com.wrox.proj2ee.ch10.app.ShowRecordRequesthandler
DataBean dataBean = dataStore.getInfo(name);
^
5 errors

C:\Program Files\Java\jdk1.5.0_11\bin>
Feb 14 '07 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
Thanks to Gannon11 and ro351988- Moderator.
I give below the complete Java file and pls help me to rectify the errors.

package com.wrox.proj2ee.ch10.app;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.wrox.proj2ee.ch12.*// The requesthandlers interface in this package.
public class ShowRecordRequesthandler implements RequestHandler
{
private DataStore dataStore;

public ShowRecordRequestHandler()
{
dataStore = new DataStore();
}
public String handleRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException
{
String name = request.getParameter("name");
if (name == null)
{
return "enterName.jsp";
}
else
{
DataBean dataBean = dataStore.getInfo(name);
if (dataBean == null)
{
return "sorryNotFound.jsp";
}
else
{
request.setAttribute("dataBean", dataBean);
return "showInfo.jsp";
}

}
}
}
I am getting the following errors:


C:\Program Files\Java\jdk1.5.0_11\bin>ShowRecordRequesthandle r.java

C:\Program Files\Java\jdk1.5.0_11\bin>javac ShowRecordRequesthandler.java
ShowRecordRequesthandler.java:6: cannot find symbol
symbol : class ch10
location: package com.wrox.proj2ee
import com.wrox.proj2ee.ch10;
^
ShowRecordRequesthandler.java:7: cannot find symbol
symbol: class RequestHandler
public class ShowRecordRequesthandler implements RequestHandler
^
ShowRecordRequesthandler.java:9: cannot find symbol
symbol : class DataStore
location: class com.wrox.proj2ee.ch10.app.ShowRecordRequesthandler
private DataStore dataStore;
^
ShowRecordRequesthandler.java:13: cannot find symbol
symbol : class DataStore
location: class com.wrox.proj2ee.ch10.app.ShowRecordRequesthandler
dataStore = new DataStore();
^
ShowRecordRequesthandler.java:24: cannot find symbol
symbol : class DataBean
location: class com.wrox.proj2ee.ch10.app.ShowRecordRequesthandler
DataBean dataBean = dataStore.getInfo(name);
^
5 errors

C:\Program Files\Java\jdk1.5.0_11\bin>
Well the classes are not being found.
try using
Expand|Select|Wrap|Line Numbers
  1.  import com.wrox.proj2ee.*;
instead
Feb 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.