Aim: 6.implement The "Hello World!" Program Using JSP Struts Framework Procedure: Step 1
Aim: 6.implement The "Hello World!" Program Using JSP Struts Framework Procedure: Step 1
PROCEDURE:
Step 1:
create a directory (work in e:\) and copy struts.jar,servelet-appi.jar into work d directory.Then set
the classpath as
set classpath=struts.jar;servlet-api.jar;
then copy the ActionOne.class file to webapps/ts/WEB-INF/classes
ActionOne.java:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class ActionOne extends Action
{
publicActionForwardexecute(ActionMappingmapping,ActionFormform,HttpServletRequest
request,HttpServletResponse response)throws Exception
{
System.out.println("---Action executed----");
PrintWriter pw=response.getWriter();
pw.println("HELLO WORLD!");
return null;
}
}
Step 3:
Struts-Config.xml file
Web.xml