Hi Experts I have 2 servlets :
LongOn.class
Form1.class
First one is for login in (user name and pwd), once is logged in It should call to other servlet that shows a simple form, well I want to pass the user name gotten from the first servlet to the second servlet, cause I have to save the user name in a database table (its part of the information of the form)
1.How can I set the parameter username in the first Servlet
2.How can I get the parameters username in the second Servlet
3. I use the following syntax in the Post Method to call the second servlet from the first servlet
ServletContext sc =getServletContext();
RequestDispatcher rd=sc.getRequestDispatcher
("Form1.cl
ass");
try
{
rd.forward(req,res);
}
catch(IOException e)
{
System.out.println (e.getMessage());
}
but it shows an error message " java.lang.IllegalArgumentE
xception '/' missing" , well so I put that character and then it showed other error message " /Form1.class resource is not available "
Well both servlets are located in the same directory (C:\jakarta-tomcat-5.0.28\
webapps\RO
OT\WEB-INF
\classes)
Thanks
Start Free Trial