• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DynaValidatorActionForm not working

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Struts and using Struts 1.3
I have done few things with DynaValidatorActionForm, it worked quite perfectly but when I got with this my usecase of "EDIT" DynaValidatorActionForm is not working as I guessed.

My Usecase for "Edit" goes like this:
1. The Click on Edit link populates the value on DynaValidatorActionForm and then values are displayed on JSP Page.
2. Then submitting the form with changed values will update to database.

But when the edit action is submitted after making changes on the values, the values get updated to the database but the validation that should be doing by DynaValidatorActionForm is not working at this point. Email, null field, numeric field and any other validation is not going on. I am exhausted trying all my ideas leaving no guesses behind.

Please help me out; as during addition, the same DynaValidatorActionForm is working well and doing all the validations properly but during edit, the validation is not working.

I am new to Forums, I apologize if I failed to post my problem at correct category.

Thanking for appreciations.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best course of action in this case is to study the differences between the working and non-working code. If you're still stuck, post the relevant portions of your struts-config.xml file, JSP, and Action classes and we'll help you debug it.
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the edit action different action than the normal "save" action? If it is then are you sure they both use the same form name? Or if they are supposed to use different forms then are you sure that you have configured the xml validations to the edit form too (or just for the "save" form).

I have not coded Struts 1 applications in a long time (use Struts 2 nowadays) but I remember having those kind of problems when the "save" and "edit" validations gave different results.
 
sushmi shrestha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all thanks to you both.

I am using same for both addition and edit and have used same action class for both action only a parameter passed during the submission differentiate between those two actions.

My struts-config.xml file content:
-----------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<form-beans>
<form-bean name="loginForm" type="com.f1soft.das.struts.form.LoginForm" />
<form-bean name="employeeEditForm" type="org.apache.struts.validator.DynaValidatorActionForm" >
<form-property name="firstName" type="java.lang.String" initial=""></form-property>
<form-property name="lastName" type="java.lang.String" ></form-property>
<form-property name="address" type="java.lang.String" ></form-property>
<form-property name="email" type="java.lang.String" ></form-property>
<form-property name="phone" type="java.lang.String"></form-property>
<form-property name="mobile" type="java.lang.String"></form-property>
<form-property name="dobDay" type="java.lang.String"></form-property>
<form-property name="dobMonth" type="java.lang.String"></form-property>
<form-property name="dobYear" type="java.lang.String"></form-property>
<form-property name="hireDay" type="java.lang.String"></form-property>
<form-property name="hireMonth" type="java.lang.String"></form-property>
<form-property name="hireYear" type="java.lang.String"></form-property>
<form-property name="post" type="java.lang.String"></form-property>
<form-property name="empId" type="java.lang.String"></form-property>
<form-property name="privilege" type="java.lang.String"></form-property>
<form-property name="recordStatus" type="java.lang.String"></form-property>
</form-bean>

</form-beans>

<global-forwards>
<forward
name="welcome"
path="/default.do"
redirect="true" />

<!-- global forward for test. Need to be removed later -->
<forward name="test"
path="/searchPage.do"
redirect="true" />
</global-forwards>

<action-mappings>

<action path="/searchFirstName"
include="/WEB-INF/jsp/admin/searchFirstName.jsp" />
<action path="/default"
forward="/WEB-INF/jsp/index.jsp" unknown="true"/>
<action path="/searchPage"
forward="/WEB-INF/jsp/admin/search.jsp" />
<action path="/login"
type="com.f1soft.das.struts.action.LoginAction"
name="loginForm"
input="/WEB-INF/jsp/index.jsp"
scope="request"
validate="true">
<forward name="admin" path="/WEB-INF/jsp/admin/navigation.jsp" />
<forward name="employee" path="/WEB-INF/jsp/employee/navigation.jsp" />
<forward name="failure" path="/WEB-INF/jsp/index.jsp?status=failure" />
</action>

<action path="/homePage"
forward="/WEB-INF/jsp/admin/navigation.jsp" />

<action path="/employeeManagementPage"
parameter="/WEB-INF/jsp/admin/employeeManagement.jsp"
type="org.apache.struts.actions.ForwardAction" />
<actionpath="/leaveApprovalPage"
parameter="/WEB-INF/jsp/admin/leaveApproval.jsp"
type="org.apache.struts.actions.ForwardAction" />
<action path="/reportPage"
parameter="/WEB-INF/jsp/admin/report.jsp"
type="org.apache.struts.actions.ForwardAction" />
<action path="/employeeAdditionPage"
parameter="/WEB-INF/jsp/admin/employeeAdd.jsp"
type="org.apache.struts.actions.ForwardAction" />
<!-- <action path="/employeeEditPage"
parameter="/WEB-INF/jsp/admin/employeeEdit.jsp"
type="org.apache.struts.actions.ForwardAction" />-->
<action
attribute="employeeEditForm"
input="/WEB-INF/jsp/admin/employeeAdd.jsp"
name="employeeEditForm"
parameter="do"
path="/employeeEdit"
scope="request"
type="com.f1soft.das.struts.action.ShowEmployeeAction"
cancellable="true"
validate="true">
<forward name="op-error" path="/WEB-INF/jsp/admin/employeeAdd.jsp" />
<forward name="op-success" path="/WEB-INF/jsp/admin/next.jsp" />
<forward name="mainpage" path="/WEB-INF/jsp/admin/employeeManagement.jsp" />
<forward name="invalid" path="/index.jsp"></forward>
</action>
<action
path="/searchedEmployeeEdit"
attribute="employeeEditForm"
input="/WEB-INF/jsp/admin/employeeEdit.jsp"
name="employeeEditForm"
parameter="do"
scope="request"
validate="true"
cancellable="true"
type="com.f1soft.das.struts.action.EmployeeEditAction" >
<!-- forward names for EmployeeEditAction.showEmployee() -->
<forward name="edit-success" path="/WEB-INF/jsp/admin/employeeEdit.jsp" />
<forward name="gotoPage" path="/WEB-INF/jsp/admin/employeeEdit.jsp" />
<forward name="back" path="/WEB-INF/jsp/admin/search.jsp" />
<!-- forward names for EmployeeEditAction.saveEmployee() for flag=edit-->
<forward name="op-error" path="/WEB-INF/jsp/admin/employeeEdit.jsp" />
<forward name="op-success" path="/WEB-INF/jsp/admin/editSuccess.jsp" />
<forward name="mainpage" path="/WEB-INF/jsp/admin/search.jsp" />
<forward name="invalid" path="/index.jsp"></forward>
</action>
</action-mappings>

<message-resources parameter="com.f1soft.das.struts.ApplicationResources" />

<!-- validator plugins configuration -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>

My Action class : EmployeeEditAction.java
------------------------------------------

package com.f1soft.das.struts.action;

import java.util.Calendar;
import java.util.Date;
import java.util.Hashtable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import org.apache.struts.util.MessageResources;
import org.apache.struts.validator.DynaValidatorActionForm;

import com.f1soft.das.bl.EmployeeManager;
import com.f1soft.das.bl.LoginValidation;
import com.f1soft.das.misc.DateConvertor;
import com.f1soft.das.test.TestAdditionUpdate;
import com.f1soft.das.util.Employee;

public class EmployeeEditAction extends DispatchAction {
/*EmployeeManager handles the database transactions related to employee*/
EmployeeManager em = new EmployeeManager();

/*
* method to populate the searched information on employeeEdit.jsp
*/
public ActionForward showEmployee(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaValidatorActionForm df= (DynaValidatorActionForm)form;
System.err.println("@EMployeeEditAction.java::REF-006:SearchKey is "+request.getParameter("searchKey"));
System.out.println("@EMployeeEditAction.java::REF-001:Show employee function!!!");

/*if(isCancelled(request)){
System.out.println("@EMployeeEditAction.java::REF-005:Cancel action clicked!!!");
return mapping.findForward("back");
}*/

//search the employee with the id in hashtable "userTable"
String search = request.getParameter("searchKey");
Employee searchedEmp=new LoginValidation().getUserTable().get(search);

//set the values to form
df.set("empId", searchedEmp.getEmpId());
df.set("firstName", searchedEmp.getFirstName());
df.set("lastName", searchedEmp.getLastName());
df.set("address", searchedEmp.getAddress());
df.set("email", searchedEmp.getEmail());
df.set("phone", searchedEmp.getPhone());
df.set("mobile", searchedEmp.getMobile());
df.set("post", searchedEmp.getPost());
df.set("privilege", Integer.toString(searchedEmp.getPrivilege()));

Calendar dob = Calendar.getInstance();
dob.setTime(searchedEmp.getDob());

df.set("dobDay", Integer.toString(dob.get(Calendar.DATE)));
df.set("dobMonth", Integer.toString(dob.get(Calendar.MONTH)));
df.set("dobYear", Integer.toString(dob.get(Calendar.YEAR)));

Calendar hire = Calendar.getInstance();
hire.setTime(searchedEmp.getHireDate());
df.set("hireDay", Integer.toString(hire.get(Calendar.DATE)));
df.set("hireMonth", Integer.toString(hire.get(Calendar.MONTH)));
df.set("hireYear", Integer.toString(hire.get(Calendar.YEAR)));

String rs = searchedEmp.getRecordStatus().toString();
System.out.println("@EmployeeEditAction-EEA-013::record status fetched");
df.set("recordStatus", rs);
System.out.println(" --RecordStatus:::"+searchedEmp.getRecordStatus());
System.out.println(" --RecordStatus-STRING:::"+searchedEmp.getRecordStatus().toString());
return mapping.findForward("gotoPage");
}

/*
* method to save/update the employee information.
*/
public ActionForward saveEmployee(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {

DynaValidatorActionForm employeeEditForm = (DynaValidatorActionForm) form;
String forwardString = "";

//attribute to catch the edit action requested.
String actionRequested=request.getParameter("flag");
//to catch the exception when the request parameter flag is other than edit
if(!actionRequested.equalsIgnoreCase("edit") && !actionRequested.equalsIgnoreCase("save")){
return mapping.findForward("invalid");
}


if(employeeEditForm.get("phone").toString().trim().equalsIgnoreCase("")){
System.out.println("@EmployeeEditAction.java REF-014:: PHONE IS NULL");
}

if(isCancelled(request)){
System.out.println("@EMployeeEditAction.java::REF-007:Cancel action clicked!!!");
return mapping.findForward("mainpage");
}

/*
* Addition of New Employee Information
* This part is for addition of new employee information
*/
if (actionRequested.equalsIgnoreCase("save")){
System.out.println("@EMployeeEditAction.java REF-009::\n --NEW EMPLOYEE BEING ADDED");
/***
* this part need to be modified during integration
* this line to be deleted as the userTable variable is static
* and is available under login module integration
*/
Hashtable<String, Employee> users = new LoginValidation().getUserTable();

/**
* check if empId matches with the existing.
*/
if(users.get(employeeEditForm.getString("empId"))!= null){
System.err.println("@EmployeeEditAction.java REF-003::User exists.. Please try with another id");
request.setAttribute("errMsg", "User Exists! Please try with another id");
forwardString="op-error";
}

/*
* check if email matches with the existing
*/
if (em.isEmailExist(employeeEditForm.getString("email"))){
System.err.print("@EmployeeEditAction::Someone has already registered with the email add");
request.setAttribute("errDuplicate", "Someone has already registered with the email add");
forwardString="op-error";
}


/* to capture both of the above errors at a time*/
if(forwardString.equalsIgnoreCase("op-error")){
return mapping.findForward(forwardString);
}
} //end of section Addition of New Employee Information
else if(actionRequested.equals("edit")){
/*check email add if it matches with any other existing email id registered*/
System.out.println("@EMployeeEditAction.java REF-008::\n --EMPLOYEE UPDATE GOING ON");

}

/*
* the default password is obtained from the resource file.
* so messageResources is required.
*/
MessageResources messageResources = getResources(request);

System.out.println("@ EmployeeEditAction:::Employee Name is:: "+employeeEditForm.get("firstName"));
//conversion to date
int dobYear=Integer.parseInt(employeeEditForm.getString("dobYear"));
int dobMonth= Integer.parseInt(employeeEditForm.getString("dobMonth"));
int dobDay=Integer.parseInt(employeeEditForm.getString("dobDay"));
int hireYear = Integer.parseInt(employeeEditForm.getString("hireYear"));
int hireMonth = Integer.parseInt(employeeEditForm.getString("hireMonth"));
int hireDay = Integer.parseInt(employeeEditForm.getString("hireDay"));
Date dob = new DateConvertor().createDate(dobYear, dobMonth, dobDay);
Date hireDate = new DateConvertor().createDate(hireYear, hireMonth, hireDay);

//transfer form data to hibernate dto
Employee employee = new Employee();
employee.setFirstName(employeeEditForm.getString("firstName"));
employee.setLastName(employeeEditForm.getString("lastName"));
employee.setAddress(employeeEditForm.getString("address"));
employee.setPhone(employeeEditForm.getString("phone"));
employee.setEmail(employeeEditForm.getString("email"));
employee.setMobile(employeeEditForm.getString("mobile"));
employee.setEmpId(employeeEditForm.getString("empId"));
employee.setDob(dob);
employee.setHireDate(hireDate);
employee.setPost(employeeEditForm.getString("post"));
employee.setPrivilege(Integer.parseInt(employeeEditForm.getString("privilege")));
employee.setPassword(messageResources.getMessage("app.defaultPassword"));

if(actionRequested.equalsIgnoreCase("save")){
//for new Employee
//employee.setPassword(messageResources.getMessage("app.defaultPassword"));--commented for checking
employee.setRecordStatus(true);
}else if(actionRequested.equalsIgnoreCase("edit")){
//for existing employee during edit
//employee.setPassword(""); --commented for checking
System.out.println("@EmployeeEditAction:::EEA-011::recordStatus="+employeeEditForm.getString("recordStatus"));
System.out.println("@EmployeeEditAction:::EEA-012::recordStatus="+Boolean.parseBoolean(employeeEditForm.getString("recordStatus")));
employee.setRecordStatus(Boolean.parseBoolean(employeeEditForm.getString("recordStatus")));
}
System.out.println("@EmployeeEditAction::REF-010::Employee Data:::"+employee.toString());
//insert into db
em.saveEmployee(employee);

/*Test whether updated or not
* -- need to removed later
* */
new TestAdditionUpdate().showNewUser(employee.getEmpId());
System.out.println("@EmployeeEditAction REF-002 :::Save Successful");
return mapping.findForward("op-success");
}
}


My JSP Page: employeeEdit.jsp
------------------------------

<%@ page language="java" pageEncoding="ISO-8859-1"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="header.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />

<title>Edit Employee Record</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body><br>
This is employee Edit page
<html:errors/><br/>
<html:form action="/searchedEmployeeEdit">
<table>
<tr>
<td colspan="2">Employee Information:</td>
</tr>
<tr>
<td>First Name</td>
<td><html:text property="firstName" /></td>
</tr>
<tr>
<td>Last Name</td>
<td><html:text property="lastName" /></td>
</tr>
<tr>
<td>Address</td>
<td><html:text property="address" /></td>
</tr>
<%
if(request.getAttribute("errDuplicate")!=null){
%>
<tr>
<td colspan="2"><%=(String)request.getAttribute("errDuplicate") %></td>
</tr>
<%
}
%>
<tr>
<td>Email</td>
<td><html:text property="email" /></td>
</tr>
<tr>
<td>Phone</td>
<td><html:text property="phone" /></td>
</tr>
<tr>
<td>Mobile</td>
<td><html:text property="mobile" /></td>
</tr>
<tr>
<td>Date of Birth</td>
<td>
<html:select property="dobDay" >
<html:option value=""></html:option>
<c:forEach var="i" begin="1" end="31" step="1">
<html:option value="${i}">${i}</html:option>
</c:forEach>
</html:select>
<html:select property="dobMonth" >
<c:set var="count" value="0"/>
<html:option value=""></html:option>
<c:forEach var="mon" items="Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec">
<html:option value="${count}"><c:out value="${mon}"/></html:option>
<c:set var="count" value="${count+1}"/>
</c:forEach>
</html:select>
<html:select property="dobYear" >
<html:option value=""></html:option>
<c:forEach var="i" begin="<%=currentYear-50 %>" end="<%=currentYear-10 %>" >
<html:option value="${i}">${i}</html:option>
</c:forEach>
</html:select>
</td>
</tr>
<tr>
<td>Hire Date: </td>
<td><html:select property="hireDay" >
<html:option value=""></html:option>
<c:forEach var="i" begin="1" end="31" step="1">
<html:option value="${i}">${i}</html:option>
</c:forEach>
</html:select>
<html:select property="hireMonth" >
<c:set var="count" value="0"/>
<html:option value="" ></html:option>
<c:forEach var="mon" items="Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec">
<html:option value="${count}"><c:out value="${mon}"/></html:option>
<c:set var="count" value="${count+1}"/>
</c:forEach>
</html:select>
<html:select property="hireYear" >
<html:option value=""></html:option>
<c:forEach var="i" begin="<%=currentYear-50 %>" end="<%=currentYear %>">
<html:option value="${i}">${i}</html:option>
</c:forEach>
</html:select></td>
</tr>
<tr>
<td>Post:</td>
<td><html:text property="post"/></td>
</tr>
<tr>
<td colspan="2">For Login Purpose:</td>
</tr>
<tr>
<td>Privilege:</td>
<td>
<html:select property="privilege">
<html:option value=""></html:option>
<html:option value="1">Admin</html:option>
<html:option value="2">Employee</html:option>
</html:select>
</td>
</tr>
<tr>
<td>Status:</td>
<td>
<html:radio property="recordStatus" value="true">ACTIVE</html:radio>
<html:radio property="recordStatus" value="false">INACTIVE</html:radio>
</td>
</tr>
</table>
<html:hidden property="empId"/>
<html:hidden property="flag" value="edit"/>
<%-- set the parameter for the dispatch action --%>
<html:hidden property="do" value="saveEmployee" />

<html:submit>Edit</html:submit>
<html:cancel>Cancel</html:cancel>
<html:reset>Refresh</html:reset>
</html:form>
</body>
</html:html>

I hope these three are will help you to debug. The actual edit is called from other page which has "edit" button to call the edit action which actually populates the values to the employeeEdit.jsp page by calling "showEmployee()" method included in EmployeeEditAction class.

I also tried by separating action class and bean form for edit. But in vain, it didn't work.

I hope my logic is correct to implement the DynaValidatorActionForm for the edit task.

Thanking all.

[ July 08, 2008: Message edited by: sushmi shrestha ]

[ July 08, 2008: Message edited by: sushmi shrestha ]
[ July 08, 2008: Message edited by: sushmi shrestha ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, a couple of suggestions: When I asked for "relevant portions" of your code, I meant only those pieces that apply to the current problem, not the whole thing. Also, in the future, please surround your actual code with [ c o d e ] and [ / c o d e ] tags (only without the extra spaces). This will allow the posted code to keep its original indentations and make it much easier to read.

Please show us the portion of the validator.xml file that pertains to the employeeEditForm.
[ July 08, 2008: Message edited by: Merrill Higginson ]
 
sushmi shrestha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will heartly follow your suggestions

Here is my validation.xml portion:


Thanking you for the effort.
[ July 08, 2008: Message edited by: sushmi shrestha ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sushmi shrestha:
I will heartly follow your suggestions

Here is my validation.xml portion:


Thanking you for the effort.

[ July 08, 2008: Message edited by: sushmi shrestha ]

 
atla praveenkumarreddy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DynaValidatorActionForm validations will be binded with action tag path attribute value.

in jsp you have given <html:form action="/searchedEmployeeEdit">

in struts-config you have specified the action path as path="/searchedEmployeeEdit".

upto this no problem.

but in validation.xml you have to specified the form name has <form name="/employeeEdit"> but

you should specify that as <form name="/searchedEmployeeEdit">

for your kind request try this by replacing the form name with action tag path attribute value as specified by me.
 
atla praveenkumarreddy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sushmi shrestha:
I will heartly follow your suggestions

Here is my validation.xml portion:


Thanking you for the effort.

[ July 08, 2008: Message edited by: sushmi shrestha ]

 
sushmi shrestha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankyou for the hint.

I tried with your suggestion but could not resolve the problem. The change could not populate the value to the JSP form.

I am using the same form for edit and save.

The same action mapping for both edit and save would solve the problem but during the error display, the whole thing gets wrong as the both page forward errors to the same page. Is it possible to pass the dynamic value to the input parmeter of action tag in struts-config.xml? As this will solve my problem.

If "form" can be specified during submission, it would solve the problem I think but I could find no way to specify the form.

Thankyou once again.
 
sushmi shrestha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for closing the topic so lately.
Thanks to atla praveenkumarreddy for pointing where i got wrong actually.
All the confusion and mess was due the inability to understand the DynaValidatorActionForm.

I resolved my problem.

Once again thanks to you both.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sushmi", please check your private messages for an important administrative matter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic