Magazine
 
Struts 1.1

mapping.findForward(“save”);
}
}

MappingDispatch_Action.java

package roseindia.net;
import java.io.*;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import
org.apache.struts.actions.MappingDispatchAction;
import org.apache.struts.action.ActionForm;
import
org.apache.struts.action.ActionForward;
import
org.apache.struts.action.ActionMapping;
public class MappingDispatch_Action extends
MappingDispatchAction {
public ActionForward add(ActionMapping
mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
Exception{
System.out.println(“You are in add
function.”);
return
mapping.findForward(“add”);
}
public ActionForward edit(ActionMapping
mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
Exception{
System.out.println(“You are in edit
function.”);
return
mapping.findForward(“edit”);
}
public ActionForward search(ActionMapping
mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
Exception{
System.out.println(“You are in search
function”);
return mapping.findForward(“search”);
}
public ActionForward save(ActionMapping

mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
Exception{
System.out.println(“You are in save
function”);
return mapping.findForward(“save”);
}
}

MappingDispatchAction.jsp

<%@ taglib uri=”/WEB-INF/struts-bean.tld”
prefix=”bean”%>
<%@ taglib uri=”/WEB-INF/struts-html.tld”
prefix=”html”%>
<html:html locale=”true”>
<HEAD>
<BODY>
<p><html:link page=”/
MappingDispatchAction.do?parameter=add”>Call
Add Section</html:link></p>
<p><html:link page=”/
MappingDispatchAction.do?parameter=edit”>Call
Edit Section</html:link></p>
<p><html:link page=”/
MappingDispatchAction.do?parameter=search”>Call
Search Section</html:link></p>
<p><html:link page=”/
MappingDispatchAction.do?parameter=save”>Call
Save Section</html:link></p>
</html:html>

MappingDispatchActionSave.jsp

<html>
<head>
<title>Success Message</title>
</head>
<body>
<p align=”center”><font size=”5"
color=”#000080">Welcome to save Page</
font></p>
</body>
</html>

index.jsp

<%@ taglib uri=”/tags/struts-html”
prefix=”html” %>
<html:html locale=”true”>
<head>

Mar 2008 | Java Jazz Up |26
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59,

Download PDF