Make a note that Application is working fine in english language and only issue is with the french language.
Please find code in all the components
1. JSP
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<html:form method="post" action="CouponDepositTypeMenu" >
<head>
<title>Menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"">
<link href="<%=contextRoot%>/webapp/css/style.css" rel="stylesheet" type="text/css">
<link href="<%=contextRoot%>/webapp/css/tablestyle.css" rel="stylesheet" type="text/css">
</head>
<td id="approve"><html:submit property="button" styleClass="ppm_btn" style="width:180px" styleId="hsia">
<bean:message key="login.hnipendingforApprove"/>
</html:submit></td>
<td id="approve"><html:submit property="button" styleClass="ppm_btn" style="width:180px" styleId="hsia">
<bean:message key="login.hniRejectedFromCBG"/>
</html:submit></td>
</html:form>
Note: here we are not using any hidden variables.
2.
public class CouponDepositTypeMenuAction extends PPMLookupDispatchAction
{
public ActionForward hnipendingforApprove(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
final
String STR_CLASS_NAME = "CouponDepositTypeMenuAction";
final String STR_METHOD_NAME = "hnipendingforApprove";
String strSeqId = "";
String forwardName = "hniPending";//by harsha on 9 may 2011
System.out.println("enetered into approve action");
HttpSession session = request.getSession();
LoginForm loginForm = (LoginForm) session.getAttribute("LoginForm");
String username = loginForm.getUsername();
System.out.println("user name -->" + username);
if(null != session.getAttribute("reqidlist")){
session.removeAttribute("reqidlist");
}
String button=(String)request.getParameter("button");
//System.out.println("which button::::::::::::::::naveen"+button);
String strBU = (String)session.getAttribute("strBU");
int roleId = DBAccess.getRoleId(username);
HniConfigForm ebswlformObj = new HniConfigForm();
List reqIdList = null;
List bpIdList = new ArrayList();
int Status=0;
if(roleId == 13){
if("Pending For ReqID Approval".equals(button)){
//System.out.println("33333333"+Status);
Status=3;
}
else if("Pending For UAT".equals(button)){
//System.out.println("55555555"+Status);
Status=5;
}else if("Pending For Production".equals(button)){
//System.out.println("777777777777"+Status);
Status=7;
forwardName="hniPendingProd";// by harsha on 9 may 2011
}// AUTO COCC12075 start
else if("Tarid-ReqId Release".equals(button)){
System.out.println("----->TARID<-------->REQID<-------"+Status);
Status=11;
forwardName="hniPendingProd";
}// AUTO COCC12075 end
reqIdList = HniEntityReleaseBusiness.getHniReqIdListForCbd(roleId,Status);
}else if(roleId == 120){
if("Pending For ReqID Approval".equals(button)){
//System.out.println("33333333"+Status);
Status=2;
}
else if("Pending For UAT".equals(button)){
//System.out.println("55555555"+Status);
Status=6;
}
reqIdList = HniEntityReleaseBusiness.getHniReqIdListForCbd(roleId,Status);
}
else
{
reqIdList = HniEntityReleaseBusiness.getHniReqIdList(roleId,strBU);
}
ebswlformObj.setReqIdList(reqIdList);
ebswlformObj.setBpIdList(bpIdList);
ebswlformObj.setStrUserName(username);
ebswlformObj.setStrRoleId(loginForm.getRoleid());
session.setAttribute("reqidlist", reqIdList);
session.setAttribute("bpIdList", bpIdList);
session.setAttribute("HniConfigForm", ebswlformObj);
return mapping.findForward(forwardName);
}
protected Map getKeyMethodMap(){
Map map = new HashMap();
map.put("deposit.button.couponDepositType","depsoitType");
map.put("deposit.button.PostPaid","postPaid");
map.put("deposit.button.couponPackageHeader","packageType");
map.put("rules.button.ppmrules","rules");
map.put("login.userManager","userManager");
map.put("login.field","fieldSales");
map.put("login.urs","urs");
map.put("login.brs","brs");
map.put("login.postpaid","postpaid");
map.put("button.ChangePassword","ChangePassword");
map.put("login.EBSWireline","EBSWireline");
map.put("login.hniebswl","HniEbsWLine");
map.put("login.hniebsws","HniEbsWLess");
map.put("login.approve","approve");
map.put("login.reinstate","reinstate");
map.put("login.reports","reports");
map.put("login.outputreports","outputreports");
map.put("login.draftdata","draftdata");
map.put("login.hniebsvdata","hniebsvdata");
map.put("login.hsia","hsia");
map.put("login.advancedreports","advancedreports");//COCC11278
map.put("button.Offerability","Offerability");//COFI11391
map.put("login.hniwl","HniWLine");
map.put("login.hniws","HniWLess");
map.put("login.hnivdata","hniVdata");
map.put("login.hnihsia","hniHsia");
map.put("hni.upload","uploadDocument");
map.put("login.hniConfScreen","hniConfScreen");
map.put("login.hnipendingforApprove","hnipendingforApprove");
map.put("login.hniReqIDforApprove","hnipendingforApprove");
// ADDED BY RAMARAO FOR HNI
map.put("login.hniRejectedFromCBG","hniRejectedListFromCBG");
map.put("login.hniUATRejectedFromCBG","hniRejectedListFromCBG");
// ADDED BY NAVEEN FOR HNI CONFIGURATION
map.put("login.hniReqIDforConfiguration", "hniPendingForConfiguration");
// ADDED BY NAVEEN 7-3-2011
map.put("login.hniReqIDforApproveUAT","hnipendingforApprove");
map.put("login.hniReqIDforApprovePROD","hnipendingforApprove");
map.put("login.pendingtaridReqIdList","hnipendingforApprove");
map.put("login.pendingtaridList","getPendingTarID");
return map;
}
}|
3.
public class PPMRequestProcessor extends org.apache.struts.tiles.TilesRequestProcessor
{
private static final String className="PPMRequestProcessor";
protected ActionForward
processActionPerform(HttpServletRequest request,
HttpServletResponse response,
Action action,
ActionForm form,
ActionMapping mapping)
throws IOException, ServletException
{
String methodName="processActionPerform";
try
{
LogTracer.writeTracerLog(className, methodName, "Start:::");
long start = System.currentTimeMillis();
ActionForward forward = super.processActionPerform( request, response,action,form,mapping);
long end = System.currentTimeMillis();
LogTracer.writeTracerLog(className, methodName, "Action Path:::"+mapping.getPath());
LogTracer.writeTracerLog(className, methodName, "Action Class:::"+action.getClass().getName());
LogTracer.writeTracerLog(className, methodName, "Action MethodName:"+request.getAttribute("getMethodName"));
LogTracer.writeTracerLog(className, methodName, "Action Input Page:::"+mapping.getInput());
if(forward != null)
{
LogTracer.writeTracerLog(className, methodName, "Forward Path:::"+forward.getName());
LogTracer.writeTracerLog(className, methodName, "Forward JSP Name:::"+forward.getPath());
}
else
{
processException(request, response,new Exception("Unable to find forward JSP"), form, mapping);
}
LogTracer.writeTracerLog(className, methodName, "End:::Time taken for Action::::"+((end-start)/60)+"ms");
return forward;
} catch (Exception e) {
return (processException(request, response,e, form, mapping));
}
}
protected ActionForward processException(HttpServletRequest request,
HttpServletResponse response, Exception exception, ActionForm form,
ActionMapping mapping) throws IOException, ServletException {
String methodName = "processException";
try
{
LogTracer.writeTracerLog(className, methodName, "Exception Path:::"+mapping.getPath());
LogTracer.writeTracerLog(className, methodName, "exception.getMessage()::::::::"+exception.getMessage());
ActionForward forward = super.processException(request, response, exception, form, mapping);
forward.setName("exception");
forward.setPath("/webapp/pages/exception.jsp"+exception.getMessage());
return forward;
} catch (Exception e) {
ActionForward forward = new ActionForward();
forward.setName("exception");
forward.setPath("/webapp/pages/exception.jsp?msg="+e.getMessage());
return forward;
}
}
public static void main(String[] args)
{
long l = System.currentTimeMillis();
System.out.println("s");
String s = "";
for (int i = 0; i < 10000; i++)
{
int k=i;
s = s+"ramu";
}
long e = System.currentTimeMillis();
System.out.println("End:::Time taken for Action::::"+((e-l)/60));
}
}
4.
public class PPMLookupDispatchAction extends LookupDispatchAction{
private static final String className = "PPMLookupDispatchAction";
protected Map getKeyMethodMap()
{
String methodName = "getKeyMethodMap";
return null;
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
String methodName = "execute";
//LogTracer.writeTracerLog(className, methodName, "***ACTION PATH::::"+mapping.getPath());
//LogTracer.writeTracerLog(className, methodName, "***ACTION PATH::::"+mapping.getType());
return super.execute( mapping, form, request, response);
}
protected String getMethodName(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response, String parameter)
throws Exception
{
String methodName = "getMethodName";
response.setContentType("charset=UTF-8");
System.out.println("request.contentType : " + request.getContentType() );
String name = super.getMethodName(mapping,form,request,response, parameter);
LogTracer.writeTracerLog(className, methodName, "**********ACTION METHOD NAME::::"+name);
request.setAttribute("getMethodName", name);
return name;
}
}
5.
struts-config.xml setting
<controller processorClass="com.tcs.telecom.struts.action.PPMRequestProcessor"/>
<action path="/CouponDepositTypeMenu" parameter="button" scope="session" type="com.tcs.telecom.ppm.actions.CouponDepositTypeMenuAction" name="packageDepositMenuForm" input="/webapp/pages/coupon.jsp">
<forward name="deposit" path="/webapp/pages/couponDepositType.jsp" />
<forward name="package" path="/webapp/pages/couponPackageDetails.jsp"/>
<forward name="postpaid" path="/webapp/pages/cr.jsp" />
<forward name="rules" path="/webapp/pages/Rule.jsp" />
<forward name="returntomenu" path="/webapp/pages/Menu.jsp"/>
<forward name="usermanagement" path="/webapp/pages/UserManagement.jsp"/>
<forward name="salesmain" path="/webapp/pages/salesmain.jsp"/>
<forward name="brsmain" path="/webapp/pages/brsmain.jsp"/>
<forward name="changePassword" path="/webapp/pages/ChangePassword.jsp"/>
<forward name="approveURS" path="/webapp/pages/ApproveURS.jsp"/>
<forward name="hniebsws" path="/webapp/pages/hniEbsWS.jsp"/>
<forward name="hniebswl" path="/webapp/pages/hniEbsWL.jsp"/>
<forward name="approve" path="/webapp/pages/approve.jsp"/>
<forward name="reports" path="/webapp/pages/reports.jsp"/>
<forward name="outputreports" path="/webapp/pages/OutputReports.jsp"/>
<forward name="reinstate" path="/webapp/pages/ReInstate.jsp"/>
<forward name="hniebsvdata" path="/webapp/pages/hniEbsVdata.jsp"/>
<forward name="advancedreports" path="/webapp/pages/advancedreports.jsp"/>
<forward name="hniebshsia" path="/webapp/pages/hniEbsHsia.jsp"/>
<forward name="draftdata" path="/webapp/pages/Draftinfo.jsp"/>
<forward name="nodraftdetails" path="/webapp/pages/Nodraftinfo.jsp"/>
<forward name="offerability" path="/webapp/pages/segmentation.jsp"/>
<forward name="hnivdata" path="/webapp/pages/hniVdata.jsp"/>
<forward name="hnihsia" path="/webapp/pages/hniHsia.jsp"/>
<forward name="hniws" path="/webapp/pages/hniWS.jsp"/>
<forward name="hniwl" path="/webapp/pages/hniWL.jsp"/>
<forward name="uploadDocument" path="/webapp/pages/uploadDocument.jsp"/>
<forward name="newMenu" path="/webapp/pages/newMenu.jsp"/>
<forward name="hniPending" path="/webapp/pages/hnipendingforapprove.jsp"/>
<!-- added by ramarao for HNI on 26Nov2010 -->
<forward name="hniReject" path="/webapp/pages/hniReject/hniRejectedListforapprove.jsp"/>
<!-- added by naveen -->
<forward name="hniConfigure" path="/webapp/pages/hniPPMpackages/hniRejectedListforConfigure.jsp"/>
<forward name="pendingTarid" path="/webapp/pages/hniPendingTarIDList.jsp"/>
<!-- end -->
<forward name="newMenuGSM" path="/webapp/pages/newMenuGSM.jsp"/>
<!-- added by harsha for HNI on 09May2011 -->
<forward name="hniPendingProd" path="/webapp/pages/hnipendingforprod.jsp"/>
</action>
<form-bean name="packageDepositMenuForm" type="com.tcs.telecom.ppm.form.CouponDepositMenuForm"/>
Here we are getting the exception in
PPMLookupDispatchAction.java @
String name = super.getMethodName(mapping,form,request,response, parameter); line
Actual exception is:
Action[/CouponDepositTypeMenu] missing resource 'En attendant Préparation Pour la BRS' in key method map
Please let us know do you need any other information.