problem with package in servlet
package coreservlets; ******* it is compiled will **********
import javax.servlet.*;
import javax.servlet.http.*;
public class servletu
{
public static String DOCTYPE="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">";
public static String hwt(String t)
{
return(DOCTYPE + "\n" +
"<HTML>\n" +
"<HEAD><TITLE>" + t + "</TITLE></HEAD>\n");
}
}
package coreservlets; ***** it is showing errors***********
import java.io.*;
import javax.servlet.*;
import coreservlets.*;
import javax.servlet.http.*;
public class hellow2 extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException ,IOException
{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
servletu a=new servletu();
out.println(servletu.hwt("hello chakri")+"<body>hi chakri</body></html>");
}
}
the errors i got
hellow2.java:12: cannot resolve symbol
symbol : class servletu
location: class coreservlets.hellow2
servletu a=new servletu();
^
hellow2.java:12: cannot resolve symbol
symbol : class servletu
location: class coreservlets.hellow2
servletu a=new servletu();
^
hellow2.java:13: cannot resolve symbol
symbol : variable servletu
location: class coreservlets.hellow2
out.println(servletu.hwt("hello chakri")+"<body>hi chakri</body>
</html>");
^
3 errors
Press any key to continue . .

