Hi All,
I am trying some sample examples from marty halls "more
servlets and
java server pages book.."
So I think the code is 100% correct..
but still I am not able to see the desired result.
The code is as follows..SetSharedInfo.java
package myServlets;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class SetSharedInfo extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException
{
HttpSession session = request.getSession(true);
session.setAttribute("sessionTest","Session Entry one");
ServletContext context = getServletContext();
context.setAttribute("servletContextTest","Servlet context entry one");
Cookie c1=new Cookie("cookieTest1","Cookie One");
c1.setMaxAge(3600);
response.addCookie(c1);
Cookie c2 = new Cookie("cookieTest2","Cookie two");
c2.setMaxAge(3600);
c2.setPath("/");
response.addCookie(c2);
String url = request.getContextPath()+"/servlet/myServlets.ShowSharedInfo";
url = response.encodeRedirectURL(url);
response.sendRedirect(url);
}
}//--class
when I try to access this servlet i get the following error..
The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
javax.servlet.ServletException:
Cannot allocate servlet instance for path /myDevelopment/servlet/myServlets.SetSharedInfo Root cause:
java.lang.NoClassDefFoundError: myServlets/SetSharedInfo (wrong name: mySerlets/SetSharedInfo) where shoul I look for the wrong name "mySerlets/SetSharedInfo"
I have checked the directory name and they are spelled correctly.
thanks in advance..
Trupti