Hi again
I am trying since 2 days to get rid of the ClassNotFoundException and implemented the advice which i got from a couple of people in this site but that dint solve my problem.
I have struts.jar placed in lib dir and not in classpath.
I am able to run successfully the examples which i get with
struts documentation. does this mean that my classpath is set correctly and something is going wrong with the code in my application.
Following is the code of the appl which i am trying to run.
following is the partial code of web.xml
<web-app>
<display-name>Struts Blank Application</display-name>
<!-- Standard Action
Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
following is the code of struts-config.xml
<struts-config>
<action-mappings>
<action path="/register"
type="coreappl.LoginAction">
<forward name="success"
path="/result.jsp"/>
</action>
</action-mappings>
</struts-config>
following is the code of LoginAction.java
package coreappl;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class LoginAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
return(mapping.findForward("success"));
}
}
following is the code of Login.jsp
<!DOCTYPE ...>
<HTML>
<HEAD><TITLE>New Account Registration</TITLE></HEAD>
<BODY BGCOLOR="#FDF5E6">
<CENTER>
<H1>New Account Registration</H1>
<FORM ACTION="register.do" METHOD="POST">
Email address: <INPUT TYPE="TEXT" NAME="email"><BR>
<INPUT TYPE="SUBMIT" VALUE="Sign Me Up!">
</FORM>
</CENTER>
</BODY></HTML>
following is the code of result.jsp
<html>
<head> </head>
<body>
<h1> Login Successful </h1>
</body>
</html>
I get the following error in
tomcat No action instance for path /register could be created
java.lang.ClassNotFoundException: coreappl.LoginAction