Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to retrive the uploaded file in Struts

807591Mar 21 2008 — edited Mar 21 2008
hi i am getting error while retrieving the uploaded file in struts. The code is

struts-config.xml
===========
<form-bean name="GreivanceForm" type="org.apache.struts.validator.DynaValidatorActionForm" >
<form-property name="compcode" type="java.lang.String" />
<form-property name="complaintName" type="java.lang.String" />
<form-property name="category" type="java.lang.String" />
<form-property name="subcategory" type="java.lang.String" />
<form-property name="priority" type="java.lang.String" />
<form-property name="occdate" type="java.lang.String" />
<form-property name="occtime" type="java.lang.String" />
<form-property name="desc" type="java.lang.String" />
<form-property name="comments" type="java.lang.String" />
<form-property name="onbehalf" type="java.lang.String"/>
<form-property name="employeeId" type="java.lang.String"/>
<form-property name="hidSelectedNames" type="java.lang.String"/>
<form-property name="individual" type="java.lang.String"/>
<form-property name="compOption" type="java.lang.String" />
<form-property name="selectedrequestor" type="java.lang.String" />

<form-property name="file" type="java.lang.String"/>

</form-bean>
<action path="/helpdesk/GrievanceComplaint"
type="com.srit.hrnet.helpdesk.grievancemechanism.GrievanceComplaintAction"
scope="request" name="GreivanceForm"
input=""
validate="true"
parameter="compOption" >
<forward name="success" path="/helpdesk/GrievanceRedressalMechanism/ComplaintDetails.jsp"/>
<forward name="showmeetingform" path="/helpdesk/complaint/MeetingDetailsForm.jsp"/>
<forward name="transconfirm" path="/helpdesk/GrievanceRedressalMechanism/TransConfirm.jsp"/>
<forward name="ViewCompForm" path="/helpdesk/GrievanceRedressalMechanism/ViewCompForm.jsp"/>
</action>

and
Actionclass:
========
/*
* Created on Nov 5, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.srit.hrnet.helpdesk.grievancemechanism;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.actions.DispatchAction;
import org.apache.struts.upload.FormFile;
import org.apache.struts.validator.DynaValidatorActionForm;
import org.apache.struts.validator.DynaValidatorForm;

import com.srit.hrnet.components.SequenceCodeGenerator;
import com.srit.hrnet.emp.EmployeeGenTO;
import com.srit.hrnet.emp.courier.CourierMailDAO;
import com.srit.hrnet.emp.courier.CourierMailTO;
import com.srit.hrnet.emp.parameter.ParamMasterTO;
import com.srit.hrnet.helpdesk.SessionValidate;
import com.srit.hrnet.helpdesk.category.CategoryDAO;
import com.srit.hrnet.helpdesk.category.CategoryTO;
import com.srit.hrnet.helpdesk.mails.HDMail;
import com.srit.hrnet.utilities.DateUtilities;
import com.srit.hrnet.helpdesk.complaint.TaskDAO;
import com.srit.hrnet.helpdesk.SessionValidate;
import com.srit.hrnet.helpdesk.grievancemechanism.GrievanceComplaintForm;



public class GrievanceComplaintAction extends DispatchAction{




public ActionForward submitForm(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response)throws ServletException,IOException {


String msg=null;
DynaValidatorActionForm objDyna = (DynaValidatorActionForm)form;
GrievanceComplaintDAO gcDao= new GrievanceComplaintDAO();
ActionForward forward = new ActionForward();
// GrievanceComplaintForm gcForm=(GrievanceComplaintForm)form;
String CompId = null;
try
{
SequenceCodeGenerator seq=new SequenceCodeGenerator("GrievanceMechanism");
CompId=seq.generateCode();
GrievanceComplaintTO gcTO=new GrievanceComplaintTO();
System.out.println("Inside GrievanceComplaintAction ......");
String CompName=request.getParameter("complaintName");
String Category=request.getParameter("category");
String prority=request.getParameter("priority");
String dateofocc=request.getParameter("occdate");
String timeofocc=request.getParameter("occtime");
String desc=request.getParameter("desc");
String comments=request.getParameter("comments");
// String file=request.getParameter("file");
// String complaintcode = .generateCode();

System.out.println("Inside insert()::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::");

System.out.println("Name Of the Complaint name>>>>>>>>>>>>>>"+CompName);
System.out.println("Name Of the Categoryt>>>>>>>>>>>>>>"+Category);
System.out.println("Name Of the prority>>>>>>>>>>>>>>"+prority);
System.out.println("Name Of the dateofocc>>>>>>>>>>>>>>"+dateofocc);
System.out.println("Name Of the timeofocc>>>>>>>>>>>>>>"+timeofocc);
System.out.println("Name Of the desc>>>>>>>>>>>>>>"+desc);
System.out.println("Name Of the comments>>>>>>>>>>>>>>"+comments);
// System.out.println("Name Of the file>>>>>>>>>>>>>>"+file);
GregorianCalendar occdate=DateUtilities.getGCDateForString(objDyna.getString("occdate"),((com.srit.hrnet.emp.EmployeeGenTO)request.getSession().getAttribute("LoginUser")).getDateFormat(),'/');
gcTO.setComplaintCode(CompId);
gcTO.setComplaintName(CompName);
gcTO.setCategory(Category);
gcTO.setPriority(prority);
gcTO.setOccdate(occdate);
System.out.println("After Setting date in GTO is>>>>>>>>>>>>>>"+gcTO.getOccdate());
gcTO.setOcctime(timeofocc);
gcTO.setDesc(desc);
gcTO.setComments(comments);

HDMail mailComp = new HDMail();
String errorFlag = null;
String filePath = ""+objDyna.get("file");// Attachment path
StringTokenizer st=new StringTokenizer(filePath,".");


String extension=null;
// String filename=null;
String attachmentPath = null;
while(st.hasMoreTokens())
{
extension=st.nextToken();
}
// while(st1.hasMoreTokens()){
// filename=st1.nextToken();
// }
System.out.println("Attachment path : "+attachmentPath);
System.out.println("Extension is.........."+extension);
// System.out.println("Name of the file is.............."+filename);
if(filePath != null && filePath.indexOf(".") != -1 && filePath.length()>=5 ){// If attachment exists
// attachmentPath = filePath.substring(filePath.indexOf(".")+1,filePath.length());// file extension
//// System.out.println("Attachment path : "+attachmentPath);
if(!extension.equalsIgnoreCase("txt") && !extension.equalsIgnoreCase("htm")
&&!extension.equalsIgnoreCase("doc") &&!extension.equalsIgnoreCase("rtf")
&&!extension.equalsIgnoreCase("msg") &&!extension.equalsIgnoreCase("oft")
&& !extension.equalsIgnoreCase("xls")){
errorFlag = "1"; // if the file is not a valid type (not in the above mentioned extensions)
}

}
gcTO.setAttachmentName(filePath);
if(errorFlag.equals("1")){
// String attachmentName = null;
//// String attachmentPath = request.getParameter("agendaAttachment");
// DynaValidatorForm dyna=(DynaValidatorForm)form;
// FormFile file= (FormFile)objDyna.get("file");
// //dyna.get("file");
//
// System.out.println("Name of the file after casting....."+file.getFileName());
//
// if(file!=null && file.getFileName()!=null && !file.getFileName().trim().equals("")){
// String fileName = null;
// fileName = file.getFileName();
// attachmentName = fileName;
//
//
// if(validFile(fileName))
// writeFile(file,request,fileName);
// else
// {
// ActionMessages errors=new ActionMessages();
// errors.add("Err:MsgDesc",new ActionMessage("com.srit.hrnet.helpdesk.complaint.form.fileupload"));
// saveErrors(request,errors);
//// ActionForward map1 = submitSubCategory(mapping,form,request,response);
// resetToken(request);
// saveToken(request);
// return mapping.findForward("ViewCompForm");
// }
//
// //}
// //}
// int recordexists = gcDao.getComplaint(CompId);
// if(recordexists == 1){
// System.out.println("Calling the update method");
// gcDao.updateComplaintDetails(gcTO);
// }else{
boolean retVal=gcDao.insert(gcTO);


if (retVal){
System.out.println("Record Inserted inside Action.");
msg = "<font color='blue'>Record Inserted Successfully .</font>";
request.setAttribute("status", msg);
}
else{
System.out.println("Unable to insert Record inside Action.");
msg = "<font color='red'>Unable to insert Record .</font>";
request.setAttribute("status", msg);
}

}

else
{
System.out.println("Upload a file of extension(.jpg,.gif,.doc,.htm,.xls,.rtf,oft,msg) inside Action.");
msg = "<font color='red'>Upload a file of extension(.jpg,.gif,.doc,.htm,.xls,.rtf,.oft,.msg) </font>";
request.setAttribute("status", msg);
}
}
catch (Exception e) {
// TODO: handle exception
System.out.println("Exception Occurred inside insert action....."+e.getMessage());
e.printStackTrace();
}

// else
// {
// String insStatus="10";
// System.out.println("Accept:Redirecting due to resubmission");
// request.setAttribute("transStatus",insStatus);
// forward =mapping.findForward("transconfirm");
//
// }


return mapping.findForward("success");
}

public boolean validFile(String fileName){
if(!fileName.equals("")){
int filelength=fileName.length();
int sublength= fileName.indexOf('.');
String extension = fileName.substring(sublength+1,filelength);
if(extension.trim().equalsIgnoreCase("msg") || extension.trim().equalsIgnoreCase("txt") || extension.trim().equalsIgnoreCase("xls") || extension.trim().equalsIgnoreCase("ppt") || extension.trim().equalsIgnoreCase("jpg") || extension.trim().equalsIgnoreCase("gif")|| extension.trim().equalsIgnoreCase("doc" )|| extension.trim().equalsIgnoreCase("pdf") || extension.trim().equalsIgnoreCase("wmv") || extension.trim().equalsIgnoreCase("zip") || extension.trim().equalsIgnoreCase("jpeg") || extension.trim().equalsIgnoreCase("xml") || extension.trim().equalsIgnoreCase("html") ||extension.trim().equalsIgnoreCase("bmp") ||extension.trim().equalsIgnoreCase("htm") ||extension.trim().equalsIgnoreCase("ppt")||extension.trim().equalsIgnoreCase("oft")||extension.trim().equalsIgnoreCase("csv")){

return true;
}else{
return false;
}
}
return true;

}
public int writeFile(FormFile file,HttpServletRequest request,String fileName){

int retValue = 0;
String size = (file.getFileSize() + " bytes");
if(file.getFileSize()>0){
//System.out.println("The size of the file is :" + file.getFileSize() + " bytes");
String data = null;
try {
//retrieve the file data
String fileTodelete = request.getRealPath("/helpdesk/meetingsagenda/"+fileName);
boolean success = (new File(fileTodelete)).delete();
//System.out.println("sucess......"+success);

ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream stream = file.getInputStream();
//write the file to the file specified

System.out.println("sfsdfkjdsfds "+request.getRealPath("/helpdesk/meetingsagenda/"+fileName));

OutputStream bos = new FileOutputStream(request.getRealPath("/helpdesk/meetingsagenda/"+fileName));
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
bos.write(buffer, 0, bytesRead);
}
bos.close();
data = "The file has been written to \""+ "/helpdesk/meetingsagenda/"+ "\"";

System.out.println("data........."+data);
//close the stream
stream.close();

}catch(FileNotFoundException fnfe) {
System.out.println("com.srit.hrnet.homepage.fromceo.FromCEOAction.writeFile.Exception :"+ fnfe.toString());
fnfe.printStackTrace();
//retValue = FORMFILE_FILE_NA;

}catch(IOException ioe) {
System.out.println("com.srit.hrnet.homepage.fromceo.FromCEOAction.writeFile.Exception :"+ ioe.toString());
ioe.printStackTrace();
//retValue = FORMFILE_ERR_UPD;

}//end of try catch:~
}else{
//The file was a not available
//retValue = FORMFILE_SIZE_ZERO;
}//end of if else:~
// System.out.println("retValue........."+retValue);
return retValue;
}

}//end of ComplaintAction

and GrievanceFormTO:(Dummy form bean)
==========
/*
* Created on Nov 4, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.srit.hrnet.helpdesk.grievancemechanism;

import java.util.GregorianCalendar;

import org.apache.struts.upload.FormFile;


public class GrievanceComplaintTO implements java.io.Serializable {

private String complaintCode;
private String compcode; //complaind Id

private String complaintName;

private String category;

private String priority;

//private GregorianCalendar date;
private FormFile theFile;
private String compOption;
private String desc;

private String comments;

private String status;

private String serviceperson; //employee who is going to serve the complaint.Applicatble only in case of manual flow.

private String loggedEmpId; //the employee who has logged the complaint

private String applyEmpId; //employee to whom the cmplaint belongs to or owner of the complaint

private String associateComm;

private String associateRating;

private GregorianCalendar occdate;

private String occtime;
private String attachmentName;
public String getApplyEmpId() {
return applyEmpId;
}

public void setApplyEmpId(String applyEmpId) {
this.applyEmpId = applyEmpId;
}

public String getAssociateComm() {
return associateComm;
}

public void setAssociateComm(String associateComm) {
this.associateComm = associateComm;
}

public String getAssociateRating() {
return associateRating;
}

public void setAssociateRating(String associateRating) {
this.associateRating = associateRating;
}

public String getCategory() {
return category;
}

public void setCategory(String category) {
this.category = category;
}

public String getComments() {
return comments;
}

public void setComments(String comments) {
this.comments = comments;
}

public String getCompcode() {
return compcode;
}

public void setCompcode(String compcode) {
this.compcode = compcode;
}

public String getComplaintName() {
return complaintName;
}

public void setComplaintName(String complaintName) {
this.complaintName = complaintName;
}

public String getCompOption() {
return compOption;
}

public void setCompOption(String compOption) {
this.compOption = compOption;
}

public String getDesc() {
return desc;
}

public void setDesc(String desc) {
this.desc = desc;
}

public String getLoggedEmpId() {
return loggedEmpId;
}

public void setLoggedEmpId(String loggedEmpId) {
this.loggedEmpId = loggedEmpId;
}



public String getOcctime() {
return occtime;
}

public void setOcctime(String occtime) {
this.occtime = occtime;
}

public String getPriority() {
return priority;
}

public void setPriority(String priority) {
this.priority = priority;
}

public String getServiceperson() {
return serviceperson;
}

public void setServiceperson(String serviceperson) {
this.serviceperson = serviceperson;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getComplaintCode() {
return complaintCode;
}

public void setComplaintCode(String complaintCode) {
this.complaintCode = complaintCode;
}

public void setOccdate(GregorianCalendar occdate) {
this.occdate = occdate;
}

public GregorianCalendar getOccdate() {
return occdate;
}

public String getAttachmentName() {
return attachmentName;
}

public void setAttachmentName(String attachmentName) {
this.attachmentName = attachmentName;
}

public FormFile getTheFile() {
return theFile;
}

public void setTheFile(FormFile theFile) {
this.theFile = theFile;
}


}
but i am getting error
javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:497)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.srit.hrnet.filter.SessionValidateFilter.doFilter(SessionValidateFilter.java:81)


root cause

org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'org.apache.struts.upload.CommonsMultipartRequestHandler$CommonsFormFile' to property 'file' of type 'java.lang.String'
org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:424)
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1733)
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.srit.hrnet.filter.SessionValidateFilter.doFilter(SessionValidateFilter.java:81)

and my jsp is:
=========
<%@ page language="java" %>
<%@ taglib uri="struts-bean" prefix="bean" %>
<%@ taglib uri="struts-html" prefix="html" %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="TabGenerator" prefix="GenerateTab" %>
<%@ page import="com.srit.hrnet.utilities.DateUtilities"%>
<%@ page import="com.srit.hrnet.components.BasicDAOConstants" %>
<%@ taglib uri="AccessLogin" prefix="GeneralAccess" %>
<%@ taglib uri="iterateTag" prefix="iterateTag" %>
<%@ page import="com.srit.hrnet.components.BasicDAOConstants,com.srit.hrnet.emp.EmployeeGenTO,com.srit.hrnet.helpdesk.grievancemechanism.*"%>

<%@ page import="com.srit.hrnet.tags.*"%>



<html:html locale="true">
<HEAD>
<TITLE>
<bean:message key="com.srit.hrnet.helpdesk.complaint.form.title"/>
</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">

<link rel="stylesheet" type="text/css" href="<%= (session.getAttribute("LoginUser") != null ?
((com.srit.hrnet.emp.EmployeeGenTO)session.getAttribute("LoginUser")).getEmpPageStyleSheet() :
com.srit.hrnet.components.access.AccessCodes.GLOBAL_STYLESHEET)%>">
<script language="javaScript" src="<%= request.getContextPath()%>/jscript/GlobalValidationScript.js" purpose="include"></script>
<%

int dateFormat = (session.getAttribute("LoginUser") != null ? ((com.srit.hrnet.emp.EmployeeGenTO)session.getAttribute("LoginUser")).getDateFormat() : 2);
System.out.println("/reports/training/TRngBaseReport dateFormat = "+dateFormat);
/* *** get the current date *** */
java.util.GregorianCalendar gc1 = new java.util.GregorianCalendar();
int yy = gc1.get(java.util.Calendar.YEAR);
int mm = gc1.get(java.util.Calendar.MONTH);
int dd = gc1.get(java.util.Calendar.DATE);
mm = mm + 1;
String mon;
String day;
if(dd <= 9)
day = "0" + java.lang.String.valueOf(dd);
else
day = java.lang.String.valueOf(dd);
if(mm <= 9)
mon = "0" + java.lang.String.valueOf(mm);
else
mon = java.lang.String.valueOf(mm);
java.lang.String currentDate = "";
if(dateFormat == 3){
currentDate = java.lang.String.valueOf(yy+"/"+mon+"/"+day);/* (yyy-mm-dd format) */
}else if(dateFormat == 1){
currentDate = java.lang.String.valueOf(mon+"/"+day+"/"+yy);/* (mm-dd-yyy format) */
}else if(dateFormat == 2){
currentDate = java.lang.String.valueOf(day+"/"+mon+"/"+yy);/* (dd-mm-yyy format) */
}
System.out.println("/reports/training/TRngBaseReport currentDate = "+currentDate);
%>
<script language="javaScript" src="<%= (session.getAttribute("LoginUser")!=null ? ((com.srit.hrnet.emp.EmployeeGenTO)session.getAttribute("LoginUser")).getScriptFile() : "")%>" purpose="include"></script>
<script language="javaScript" src="jscript/CommonDialog.js" purpose="include"></script>
<script language="javaScript" src="jscript/GlobalValidationScript.js"></script>
<script language="javascript">
var gNow = new Date("<%=currentDate%>");



function val_complaint()
{

if(document.GreivanceForm.complaintName.value.length==0)
{
alert("Enter Complaint Name");
document.GreivanceForm.complaintName.focus();
return false;
}
if(document.GreivanceForm.category.value =='NA')
{
alert("select category");
document.GreivanceForm.category.focus();
return false;
}
if(document.GreivanceForm.priority.value == 'NA')
{
alert("select priority");
document.GreivanceForm.priority.focus();
return false;
}

if(document.GreivanceForm.occdate.value == "")
{
alert("Enter Date (dd/mm/yy)");
document.GreivanceForm.occdate.focus();
return false;
}
else
if(document.GreivanceForm.occdate.value>document.GreivanceForm.currentDate.value){
alert("select Previous or Current date");
document.GreivanceForm.occdate.focus();
return false;
}

if(document.GreivanceForm.occtime.value == "")
{
alert("Select Time of Occurence.");
document.GreivanceForm.occtime.focus();
return false;
}
else

if(!IsValidTime(document.GreivanceForm.occtime.value) )
{
alert("Enter Valid Time (HH:MM)");
return false;
}

if(document.GreivanceForm.desc.value == "")
{
alert("Enter Description");
document.GreivanceForm.desc.focus();
return false;
}

document.forms[0].compOption.value='submitForm';
document.forms[0].submit();
return false;
}



function IsValidTime(givenTime)
{

var hour = 0;
var minute = 0;
var timePat = /^(\d{1,2}):(\d{1,2})?$/;
var matchArray = givenTime.match(timePat);
if (matchArray == null)
{
alert("Enter Valid Time.");
return false;
}
hour = matchArray[1];
minute = matchArray[2];
if(hour==0 && minute==0)
{
alert("The Time You Entered is 0:0");
return false;
}

if (hour < 0 || hour > 23)
{
alert("Hour must be between 0 and 23");
return false;
}


if (minute<0 || minute > 59)
{
alert ("Minute must be between 0 and 59.");
return false;
}

return true;
}

unction help(url)
{
var attributes = 'menubar=no,toolbar=no,location=no,width=625,height=375,resizable=yes';
var name = 'Help';
window.open(url,name,attributes);
}
//return false;

</script>

<script language = "javaScript" src = "<%=request.getContextPath()%>/jscript/CommonDialog.js" purpose = "include"></script>


</HEAD>

<body bgcolor="#FFFFFF" onload="setFocus()">
<GenerateTab:displaytabs tabId="<%=com.srit.hrnet.masters.gui.GUIConstants.HD_GRIEVANCE_REDRESSAL_FORM%>" activeSubTab="0" >
<table align="right">
<tr>
<td>
<img src="<%=request.getContextPath()%>/images/help.gif" border="0" alt="Help">

</td>
</tr>
</table>



<html:form action="/helpdesk/GrievanceComplaint" enctype="multipart/form-data" method="POST" onsubmit="javascript:return val_complaint()">
<html:hidden property="compOption" value="submitForm" />
<html:hidden property="onbehalf"/>
<html:hidden property="employeeId"/>
<html:hidden property="hidSelectedNames"/>
<html:hidden property="selectedrequestor"/>
<html:hidden property="individual"/>

<table cellpadding="3" cellspacing="0" align="center" >


<th align="center" class="tablehead" colspan="2">
<b> Complaint Form </b>
</th>


<tr>
<td colspan="1" class='tablesubhead'>
<b><bean:message key="com.srit.hrnet.helpdesk.redressal.form.complaintname"/></b><font class="star"> *</font>
</td>
<td class='subhead'>
<html:text property="complaintName" maxlength="99"/>
</td>
</tr>


<tr>
<td class='tablesubhead' colspan="1"><b><bean:message key="com.srit.hrnet.helpdesk.redressal.form.category"/></b>
<font class="star">*</font></td>
<td class="tableright" property="category" >
<iterateTag:iterate propertyName='<%=IterateInterface.ITERATE_HELPDESK_GRIEVANCE_CATEGORY%>' defaultSelected='<%=request.getAttribute("category")==null?null:""+request.getAttribute("category")%>' selectSize='<%=100%>' tabInd='<%="3"%>'>
</iterateTag:iterate>
</td>
</tr>
<tr>
<td class='tablesubhead' colspan="1"><b><bean:message key="com.srit.hrnet.helpdesk.redressal.form.priority"/></b>
<font class="star">*</font></td>
<td class="subhead">
<iterateTag:iterate propertyName='<%=IterateInterface.ITERATE_HELPDESK_GRIEVANCE_PRIORITY%>' defaultSelected='<%=request.getAttribute("priority")==null?null:""+request.getAttribute("priority")%>' selectSize='<%=100%>' tabInd='<%="3"%>'>
</iterateTag:iterate>
</td>
</tr>

<tr>
<td class='tablesubhead' colspan=1><b>Date of Occurence</b>
<font class="star">*</font> </td>
<td class="subhead">
<html:text name="GreivanceForm" property="occdate" maxlength="10"/>
<input type="hidden" name="currDate" />
<img src="<%= request.getContextPath()%>/images/calendar.jpg" border="0" alt="Calendar" >

</td>
</tr>

<tr>
<td class='tablesubhead' colspan=1><b>Time of Occurence</b>
<font class="star">*</font></td>
<td class="subhead">
<html:text name="GreivanceForm" property="occtime" maxlength="10"/>&nbsp;(24 Hrs format)</td>
</tr>
<tr>
<td class="tablesubhead" colspan=1>
<b>Description</b>
<font class="star">*</font></td>
<td class="subhead">
<html:textarea property="desc" styleClass="formObject" cols="40" rows="4"></html:textarea>
</td>
</tr>
<tr>
<td class="tablesubhead" colspan=1>
<b>Comments/Suggestions</b>
</td>
<td class="subhead">
<html:textarea property="comments" styleClass="formObject" value="" cols="40" rows="4"></html:textarea>
</td>
</tr>
<tr>
<td class="tableleft">
<b><bean:message key="com.srit.hrnet.helpdesk.redressal.form.attachment"/> </b>
</td>
<td class="tableright">

<html:file property="file" size="18" />

</td>



</tr>
<tr>
<td colspan="2" align="center" class="tablesubhead">
<input type="submit" class="submit" value="Submit" >
&nbsp;<html:reset property="reset" styleClass="submit" />
</td>
</tr>

</table>
<input type="hidden" name="currentDate" value="<%=currentDate%>">


</html:form>
</GenerateTab:displaytabs>
<html:javascript formName="/SubmitComplaint"/>
</body>
</html:html>


please help me..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2008
Added on Mar 21 2008
1 comment
402 views