m attaching my source here please do let me know wats the problem i dont know wats happening but my application doesnt go beyond From...
wat to do???
and the thing is that it was working properly but now m getting this problem...
n yes i tried to replace all my forms and actions and even struts-config with previous codes but yet m there only no change in situation...
UserForm...
// Created by Xslt generator for Eclipse.
// XSL : not found (java.io.FileNotFoundException: (The handle is invalid))
// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xsl
package com.patni.peass.form.user;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
/**
* UserForm.java created by EasyStruts - XsltGen.
*
http://easystruts.sf.net * created on 05-02-2006
*
* XDoclet definition:
* @struts:form name="userForm"
*/
public class UserForm extends ActionForm {
// --------------------------------------------------------- Instance Variables
/** mobileNo property */
private
String mobileNo = null;
/** countryCode property */
private String countryCode = null;
/** phoneNo property */
private String phoneNo = null;
/** lastName property */
private String lastName = null;
/** middleName property */
private String middleName = null;
/** roleId property */
private String roleId = "2";
/** firstName property */
private String firstName = null;
/** userName property */
private String userName = null;
/** userEmailID property */
private String userEmailID = null;
/** extensionNo property */
private String extensionNo = null;
/** admin property */
/**private String admin = null;
/** areaCode property */
private String areaCode = null;
/** userAlias property */
private String userAlias = null;
/** location property */
private String location=null;
/** user'list property*/
private String userList=null;
private String savesubmit=null;
private String editsubmit=null;
private String deletesubmit=null;
private String function=null;
// --------------------------------------------------------- Methods
/**
* Method validate
* @param ActionMapping mapping
* @param HttpServletRequest request
* @return ActionErrors
*/
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {
ActionErrors ae = new ActionErrors();
if(request.getParameterMap().containsKey("button.edit"))
{
}
if(userName==null || userName.equals(""))
{
ae.add("userName",new ActionError("error.no.userName"));
}
/*if(roleId==null || roleId.equals(""))
{
ae.add("roleId",new ActionError("error.no.roleId"));
}
*/
if(userEmailID==null || userEmailID.equals(""))
{
ae.add("userEmailID",new ActionError("error.no.userEmailID"));
}
if(countryCode!=null || areaCode!=null || phoneNo!= null)
{
if(!(isNumeric(countryCode) && isNumeric(areaCode) && isNumeric(phoneNo)))
{
ae.add("contactNo",new ActionError("error.invalid.contactNo"));
}
}
if(extensionNo!= null)
{
if(!(isNumeric(extensionNo)))
{
ae.add("extensionNo",new ActionError("error.invalid.extensionNo"));
}
}
if(mobileNo != null)
{
if(!(isNumeric(mobileNo)))
{
ae.add("mobileNo",new ActionError("error.invalid.mobileNo"));
}
}
return ae;
}
/** To check whether entered string is numeric or not...
* returns true if string is numeric and false otherwise...
*
*/
public boolean isNumeric(String number)
{
for(int i=0;i<number.length()-1;i++)
{
if((number.charAt(i)<'0' || number.charAt(i)>'9'))
return false;
}
return true;
}
/**
* Returns the mobileNo.
* @return String
*/
public String getMobileNo() {
return mobileNo;
}
/**
* Set the mobileNo.
* @param mobileNo The mobileNo to set
*/
public void setMobileNo(String mobileno) {
this.mobileNo = mobileno;
}
/**
* Returns the countryCode.
* @return String
*/
public String getCountryCode() {
return countryCode;
}
/**
* Set the countryCode.
* @param countryCode The countryCode to set
*/
public void setCountryCode(String countrycode) {
this.countryCode = countrycode;
}
/**
* Returns the phoneNo.
* @return String
*/
public String getPhoneNo() {
return phoneNo;
}
/**
* Set the phoneNo.
* @param phoneNo The phoneNo to set
*/
public void setPhoneNo(String phoneno) {
this.phoneNo = phoneno;
}
/**
* Returns the lastName.
* @return String
*/
public String getLastName() {
return lastName;
}
/**
* Set the lastName.
* @param lastName The lastName to set
*/
public void setLastName(String lastname) {
this.lastName = lastname;
}
/**
* Returns the middleName.
* @return String
*/
public String getMiddleName() {
return middleName;
}
/**
* Set the middleName.
* @param middleName The middleName to set
*/
public void setMiddleName(String middlename) {
this.middleName = middlename;
}
/**
* Returns the firstName.
* @return String
*/
public String getFirstName() {
return firstName;
}
/**
* Set the firstName.
* @param firstName The firstName to set
*/
public void setFirstName(String firstname) {
this.firstName = firstname;
}
/**
* Returns the userName.
* @return String
*/
public String getUserName() {
return userName;
}
/**
* Set the userName.
* @param userName The userName to set
*/
public void setUserName(String username) {
this.userName = username;
}
/**
* Returns the userEmailID.
* @return String
*/
public String getUserEmailID() {
return userEmailID;
}
/**
* Set the userEmailID.
* @param userEmailID The userEmailID to set
*/
public void setUserEmailID(String email) {
this.userEmailID = email;
}
/**
* Returns the extensionNo.
* @return String
*/
public String getExtensionNo() {
return extensionNo;
}
/**
* Set the extensionNo.
* @param extensionNo The extensionNo to set
*/
public void setExtensionNo(String extensionno) {
this.extensionNo = extensionno;
}
/**
* Returns the areaCode.
* @return String
*/
public String getAreaCode() {
return areaCode;
}
/**
* Set the areaCode.
* @param areaCode The areaCode to set
*/
public void setAreaCode(String areacode) {
this.areaCode = areacode;
}
/**
* Returns the userAlias.
* @return String
*/
public String getUserAlias() {
return userAlias;
}
/**
* Set the userAlias.
* @param userAlias The userAlias to set
*/
public void setUserAlias(String useralias) {
this.userAlias = useralias;
}
/**
* @return
*/
public String getLocation() {
return location;
}
/**
* @param string
*/
public void setLocation(String string) {
location = string;
}
/**
* @return
*/
public String getUserList() {
return userList;
}
/**
* @param string
*/
public void setUserList(String string) {
userList = string;
}
/**
* @param integer
*/
public void setRoleId(String string) {
if(string=="admin")
roleId="1";
if(string=="normal")
roleId="2";
}
public String getRoleId()
{
return (String)(roleId);
}
/**
* @return
*/
/**
* @return
*/
public String getFunction() {
return function;
}
/**
* @param string
*/
public void setFunction(String string) {
function = string;
}
/**
* @return
*/
public String getDeletesubmit() {
return deletesubmit;
}
/**
* @return
*/
public String getEditsubmit() {
return editsubmit;
}
/**
* @return
*/
public String getSavesubmit() {
return savesubmit;
}
/**
* @param string
*/
public void setDeletesubmit(String string) {
deletesubmit = string;
}
/**
* @param string
*/
public void setEditsubmit(String string) {
editsubmit = string;
}
/**
* @param string
*/
public void setSavesubmit(String string) {
savesubmit = string;
}
}
UserAction
// Created by Xslt generator for Eclipse.
// XSL : not found (java.io.FileNotFoundException: (Bad file descriptor))
// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xsl
package com.patni.peass.action.user;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.patni.peass.bean.user.UserBean;
import com.patni.peass.business.UserBusiness;
import com.patni.peass.utils.common.PasswordUtil;
/**
* UserAction.java created by EasyStruts - XsltGen.
*
http://easystruts.sf.net * created on 05-02-2006
*
* XDoclet definition:
* @struts:action validate="true"
*/
public class UserAction extends Action {
/**
*
*/
public UserAction() {
super();
}
/* (non-Javadoc)
* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public UserBean createBean(HttpServletRequest request)
{
String password=null;
String contactNo=request.getParameter("countryCode")+'-'+request.getParameter("areaCode")+'-'+request.getParameter("phoneNo");
password=PasswordUtil.generatePassword();
UserBean ub = new UserBean();
ub.setUserName(request.getParameter("userName"));
ub.setUserPassword(password);
ub.setRoleId((int) 2);
//ub.setRoleId(Integer.parseInt(request.getParameter("roleId")));
ub.setUserEmailID(request.getParameter("userEmailID"));
ub.setUserAlias(request.getParameter("userAlias"));
ub.setFirstName(request.getParameter("firstName"));
ub.setLastName(request.getParameter("lastName"));
ub.setContactNo(contactNo);
ub.setLocation(request.getParameter("location"));
ub.setExtensionNo(request.getParameter("extensionNo"));
ub.setMobileNo(request.getParameter("mobileNo"));
return ub;
}
public ArrayList createBean(ArrayList userList)
{
return userList;
}
protected Map getKeyMethodMap(ActionMapping mapping,
ActionForm form,
HttpServletRequest request) {
Map map = new HashMap();
map.put("button.save", "add");
map.put("button.edit", "edit");
map.put("button.delete", "delete");
return map;
}
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
boolean doSave, doEdit, doDelete;
doSave=(request.getParameter("savesubmit")!=null);
doEdit=(request.getParameter("editsubmit")!=null);
doDelete=(request.getParameter("deletesubmit")!=null);
if(doSave)
{
boolean res=false;
boolean res1=false;
UserBean ub=createBean(request);
res1=UserBusiness.validateUser(request,ub);
if(res1){
res=UserBusiness.addRecord(ub);
}
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliure");
}
}
if(doEdit)
{boolean res=false;
UserBean ub=createBean(request);
res=UserBusiness.updateRecord(ub);
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliure");
}
}
if(doDelete)
{
boolean res=false;
UserBean ub=createBean(request);
res=UserBusiness.updateRecord(ub);
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliure");
}
}
boolean res1=false, res=false;
UserBean ub=createBean(request);
res1=UserBusiness.validateUser(request,ub);
if(res1){
res=UserBusiness.addRecord(ub);
}
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliour");
}
/*ArrayList userList=new ArrayList();
userList=UserBusiness.findAll();
request.setAttribute("users",userList);
return mapping.findForward("faliour");*/
}
/*public ActionForward save(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
boolean res=false;
boolean res1=false;
UserBean ub=createBean(request);
res1=UserBusiness.validateUser(request,ub);
if(res1){
res=UserBusiness.addRecord(ub);
}
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliour");
}
}
/**
* Method edit
* @param ActionMapping mapping
* @param ActionForm form
* @param HttpServletRequest request
* @param HttpServletResponse response
* @return ActionForward
* @throws Exception
*/
/*
public ActionForward edit(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
boolean res=false;
UserBean ub=createBean(request);
res=UserBusiness.updateRecord(ub);
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliour");
}
}
/**
* Method edit
* @param ActionMapping mapping
* @param ActionForm form
* @param HttpServletRequest request
* @param HttpServletResponse response
* @return ActionForward
* @throws Exception
*//*
public ActionForward delete(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
boolean res=false;
UserBean ub=createBean(request);
res=UserBusiness.updateRecord(ub);
if(res)
{
return mapping.findForward("success");
}
else
{
return mapping.findForward("faliour");
}
}*/
}
struts-config
<form-beans>
</form-bean>
<form-bean name="userForm" type="com.patni.peass.form.user.UserForm">
</form-bean>
</form-beans>
:
:
:
<action-mappings>
<action
input="/UserInfo.jsp"
name="userForm"
path="/user"
scope="request"
type="com.patni.peass.action.user.UserAction" >
<forward name="success" path="/UserInfo.jsp" />
</action>
</action-mappings>