here is my jsp
<%-- <%
response.setHeader("Pragma", "no-cache");
%>
<%
response.setHeader("Cache-Control", "no-store");
%>
<%
response.setDateHeader("Expires", -1);
%> --%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Candidate</title>
<link href="style2.css" rel="stylesheet" type="text/css" />
<sx:head parseContent="true" />
<script type="text/javascript">
function Checkfiles() {
var fup = document.getElementById('upload_filename');
var fileName = fup.value;
//alert (fileName);
var ext = fileName.substring(fileName.lastIndexOf('.') + 1);
//alert (ext);
if (fileName == "") {
alert("Please select a file to Upload");
return false;
} else if (ext == "doc" || ext == "DOC") {
return true;
} else {
alert("Make sure to upload only .doc files");
fup.focus();
return false;
}
}
</script>
</head>
<body>
<%@ page errorPage="errorpage.jsp" %>
<%@ include file="QuickSearch.jsp"%>
<form name="frm" action="AddCandidate" method="post"
enctype="multipart/form-data">
<%@ include file="MainPage.jsp"%>
<!--Menu ends here-->
<!--Content Starts here-->
<div class="wrapper">
<div class="cont1"></div>
<div class="cont2">
<div class="title">Add Candidate</div>
<div class="centent">
<div class="conbox1">
<div class="fields">
<h1>Identification</h1>
<div class="formbox_in">
<s:textfield label="First Name" name="firstName"
value="%{firstName}" maxlength="25" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />
<s:hidden name="userName" value="%{userName}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />
<s:hidden name="roleInfo" value="%{roleInfo}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Middle Name" name="middleInitial"
maxlength="25"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Last Name" name="lastName"
value="%{lastName}" maxlength="25" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<!-- <label class="label" for="gender">Gender:</label>
<input type="radio" value="1" id="gender1" name="gender" style="float: left; margin-left: 10px; margin-top: 4px;">
<label for="gender1" style="width: 45px; text-align: left; margin-left: 5px;">Male</label>
<input type="radio" value="2" id="gender2" name="gender" style="float: left; margin-top: 4px;">
<label for="gender2" style="text-align: left; width: 50px; margin-left: 5px;">Female</label> -->
<s:radio label="Gender" name="gender" required="true"
list="#{'1':'Male','2':'Female'}" />
</div>
<div class="clear"></div>
</div>
<div class="fields">
<h1>Contact Details</h1>
<div class="formbox_in">
<s:textfield label="Address" name="address" maxlength="30" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="City" name="city" maxlength="30" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:select label="State" name="state" headerKey="Select" required="true"
headerValue="Select" list="states" listKey="value"
listValue="value"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Zip" name="zip" required="true"
maxlength="6"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:select label="Country" name="country" headerKey="United States" required="true"
headerValue="United States" list="countries" listKey="value"
listValue="value"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Home Phone" name="homePhone"
value="%{homePhone}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Cell Phone" name="cellPhone"
value="%{cellPhone}" maxlength="15"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Email" name="emailId" value="%{emailId}"
maxlength="50" required="true"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:textfield label="Alternate Email" name="altEmail"
maxlength="50"
style="border:1px solid #ccc; background:#fff; width:165px;" />
</div>
<div class="clear"></div>
</div>
</div>
<div class="conbox2">
<div class="fields">
<h1>Highest Education</h1>
<div class="formbox_in">
<s:select label="Education Level" name="educationLevel"
headerKey="Select" headerValue="Select"
list="{'Doctorate','Masters','Associate','Bachelors','High School'}"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
</div>
<div class="clear"></div>
</div>
<div class="fields">
<h1>Status</h1>
<div class="formbox_in">
<sx:datetimepicker name="dateAvailable" formatLength="medium"
label="Date" displayFormat="MM/dd/yyyy"
value="%{dateAvailable}" type="date"
cssStyle="border:1px solid #ccc; width:165px;" />
</div>
<div class="clear"></div>
<div class="formbox_in">
<s:select label="Work Permit Type" headerKey="Select" required="true"
headerValue="Select" name="workPermit"
list="{'Citizen','H1','F1-OPT','Other'}"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
</div>
<div class="clear"></div>
<div class="formbox_in" style="margin-top: 20px;">
<%-- <s:select label="Status" headerKey="-1" headerValue="Any" value="-1"
name="status" multiple="true"
list="listOfStatus" listKey="statusName" listValue="statusName"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" /> --%>
<s:select label="Status" headerKey="-1"
name="status" multiple="true" value="%{statusMultiList}" required="true"
list="listOfStatus" listKey="statusName" listValue="statusName"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
<%-- <s:select label="Status" headerKey="-1"
name="status" multiple="true" required="true"
list="listOfStatus" listKey="statusName" listValue="statusName"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" /> --%>
</div>
<div class="clear"></div>
<div class="formbox_in" style="margin-top:60px;">
<s:select label="Sourcer" name="sourcer" required="true"
headerKey="Select" headerValue="Select" list="listOfSourcers"
listKey="%{firstName+' '+lastName}"
listValue="%{firstName+' '+lastName}"
style="border:1px solid #ccc; background:#fff; width:165px; margin-left:10px;" />
</div>
<div class="clear"></div>
</div>
<div class="fields">
<h1>Resume</h1>
<div class="formbox_in">
<s:file id="upload_filename" name="upload_filename"
label="Resume " style="border:1px solid #ccc; margin-left:10px;" />
</div>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
<div class="conbox">
<div class="formbox" style="width:54px; margin-top:15px;">
<input type="submit" name="submit" align="right" value="Save"
class="title_bg" style="width: 54px;" />
</div>
</div>
</div>
</div>
<div class="cont3"></div>
</div>
</form>
</body>
</html>
jatan bhavsar wrote:Hi Usha,
Can you post your whole jsp as i put the line you mention and it worked perfectly. Have you made any changes in default theme provided by struts as you have mention theme="simple" explicitly.
Regards
Jatan bhavsar