shashi bhushans

Greenhorn
+ Follow
since May 12, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shashi bhushans

Hi,
My Application deployed in My App SLRUM, This Application ll work only in IE8 & IE9. It is not working in Chrome & firefox. I need my Application to work in all browser. In this i used following Technologies like: jsp, sturts, css, ajax, javascript.
I attached code snippet of ajax :function makeRequest() {
if (window.XMLHttpRequest) {
xmlHttpReq = new XMLHttpRequest();
} else {
if (window.ActiveXObject) {
xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
}
}
Please give me solution.
Thanks in advance.
Hi Srikant Venkata,
I have scjp voucher & would like to sell it for Rs:5000/. If you interested you can reach me @ +91-9620800380 or mail me: shashi09ster@gmail.com
12 years ago

Hi Friends,

I have a SCJP voucher for Rs:5845/- and would like to sell it for Rs:5500/-,expiry date: 29th March 2012. I am located in Bangalore. I want to give only bangaloreans.
if anyone interested please reply back to shashi09ster@gmail.com or reach me to +91-09620800380.
12 years ago
Hi Guys,
I attached screen shot of "loading please wait" msg. If i click on Report section(marked circle in screenshot) I used javascript for loading please wait msg in small window popup. after few secs it has to close popup window but it is not closing automatically. please see following code used for loading please wait:

see javascript function fnBeforeUnload() & function fnOnLoad()

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>


<%@page import="in.gov.mrc.kstd.arch.util.WEBKEYS"%>
<%@page import="in.gov.mrc.kstd.business.ApplicationUser"%>
<%@page import="in.gov.mrc.kstd.arch.util.IMRCConstants"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>KSTD</title>
</head>
<script language="javascript">
var reportFlag;
var msgWindow;
function fnOpenAbout()
{
window.open("about.html", '',"left=300,top=200,width=400,height=250,status=no,scrollbars=no,toolbar=no0,location=no,menubar=no");
}
function fnBeforeUnload()
{
if(reportFlag=='report')
{
var url="/CMSMTDP/Wait.html";
var width = 100;
var height = 100;
var name = "Loading";
var sw=screen.width-20;
var sh=screen.height;
var positionleft=(sw-width)/2;
var positiontop=(sh-height)/2.5;
var day = new Date();
var id = day.getTime();
var options = "toolbar=no,scrollbars=yes,resizable=no,width="+width+",height=" + height;
msgWindow=window.open(url,id,options);
msgWindow.focus();
for(width1 = 1 ; width1 < positionleft ; width1 = width1 + 10);
msgWindow.moveTo(width1,positiontop)
}

}
function fnOnLoad()
{

if(msgWindow && typeof msgWindow!='undefined')
msgWindow.close();
}

function fnGenerateReport(url)
{
reportFlag='report';
document.location.href=url;
}
</script>
<body onload="fnOnLoad()" onBeforeUnload="fnBeforeUnload()">
<table align="left"><tr><td align="left">
<%if(session.getAttribute("changepassword")==null){%>

<%
ApplicationUser applicationUser=(ApplicationUser)session.getAttribute(WEBKEYS.USER_DETAILS);
if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.IT_STAFF)
{

%>



<div><span style="width:100;text-align:left"><b><u><font size="2">Grant Allocation</font></u></b></span> </div>
<div>
<div><a href="/CMSMTDP/createGrant.do?dispatch=grantCreate" style="width:100;text-align:left">Create</a></div>
<div><a href="/CMSMTDP/fetchOrder.do?dispatch=fetchOrder" style="width:100;text-align:left">Update</a></div>
<div><a href="/CMSMTDP/fetchCorrectGrantDetails.do?dispatch=fetchOrder" style="width:100;text-align:left">Correct</a></div>
</div>

<br>
<div><span style="width:100;text-align:left"><b><u><font size="2">Action Plan</font></u></b></span> </div>
<div>
<div><a href="/CMSMTDP/createActionPlan.do?dispatch=actionCreate" style="width:100;text-align:left">Create</a></div>
<div><a href="/CMSMTDP/fetchApprovalNo.do?dispatch=fetchApproval" style="width:100;text-align:left">Update</a></div>
<div><a href="/CMSMTDP/fetchCorrectActionPlanDetails.do?dispatch=fetchApproval" style="width:100;text-align:left">Correct</a></div>
</div>
<br>
<div><span style="width:100;text-align:left"><b><u><font size="2">Release Details</font></u></b></span> </div>
<div>
<div><a href="/CMSMTDP/createRelease.do?dispatch=releaseCreate" style="width:100;text-align:left">Create</a></div>
<div><a href="/CMSMTDP/fetchReleaseNo.do?dispatch=fetchReleaseNo" style="width:100;text-align:left">Update</a></div>
<div><a href="/CMSMTDP/fetchCorrectReleaseDetails.do?dispatch=fetchReleaseNo" style="width:100;text-align:left">Correct</a></div>
</div>
<br>
<!-- input type=button value="Work Detail" onclick="loadMainFrame(this)" style="width:100;font-weight:bold; background-color:pink;" -->
<div><span value="Work Detail" onclick="" style="width:100;text-align:left" ><b><u><font size="2">Work Detail</font></u></b></span></div>

<div>
<div><a href="/CMSMTDP/createWorkDetails.do?dispatch=workDetailCreate" style="width:100;text-align:left">Create</a></div>
<div><a href="/CMSMTDP/updateWorkDetails.do?dispatch=updateWorkDetails" style="width:100;text-align:left" >Update</a></div>
<div><a href="/CMSMTDP/correctWorkDetails.do?dispatch=updateWorkDetails" style="width:100;text-align:left" >Correct</a></div>

</div>
<br>
<div>

<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/fetchExpenditureDetails.do?dispatch=expenditureUpdate')" style="width:100;text-align:left"><b><u>Expenditure Updation</u></b></a></div>
</div>

<br>
<%
}
%>
<div><span style="text-align:left"><b><u><font size="2">Reports</font></u></b></span> </div>
<div><a href="/CMSMTDP/DistrictReport.do" style="width:100;text-align:left" >Geographic Abstract Report</a></div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/generateAbstractReport.do?dispatch=fetchDistrict')" style="width:100;text-align:left">Abstractreport</a></div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/generateWorkSummaryReport.do?dispatch=fetchUlb')" style="width:100;text-align:left">Worksummaryreports</a></div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/fetchWorkDetailsReport.do?dispatch=workDetailReport')" style="width:100;text-align:left">WorkDetails</a></div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/generateDeletedWorkSummaryReport.do?dispatch=fetchUlb')" style="width:100;text-align:left">DeletedWorkSummaryreports</a></div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/generateDeletedWorkSummaryReport.do?dispatch=passwordReport')" style="width:100;text-align:left">PassWordExpiryreports</a></div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/generateWorkwiseProgressReport.do?dispatch=fetchUlb')" style="width:100;text-align:left">WorkwiseProgressreports</a></div>


<br>
<%

if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.MRC_ADMIN)
{
%>

<div>
<div><span style="text-align:left"><b><u><font size="2">Administrator</font></u></b></span> </div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/retrieveWorkDetails.do?dispatch=workDetailReport')" style="width:100;text-align:left">Retrive Works</a></div>
</div>

<div>
<br>
<div><span style="text-align:left"><b><u><font size="2">Delete</font></u></b></span> </div>
<div><a href="#" onclick="fnGenerateReport('/CMSMTDP/fetchWorkDetailsReport.do?dispatch=deleteworkDetails')" style="width:100;text-align:left">Works</a></div>
<%
}
%>
</div>
<div>
<br>
<hr>
<%
if(applicationUser!=null && (applicationUser.getRoleId()==IMRCConstants.IT_STAFF || applicationUser.getRoleId()==IMRCConstants.MRC_ADMIN))
{
%>
<div><span style="text-align:left"><b><u><font size="2">User</font></u></b></span> </div>
<% } %>
<%
if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.MRC_ADMIN)
{
%>

<div><a href="/CMSMTDP/uploadWorkDetails.do?dispatch=fetchUploadWorkDetail" style="width:100;text-align:left" >Upload</a></div>
<div><a href="/CMSMTDP/createUser.do?dispatch=fetchCreateUserDetails" style="text-align:left">Create User</a></div>
<div><a href="/CMSMTDP/changePasswordAdmin.do?dispatch=changePasswordFetchDetails" style="text-align:left">Reset Password</a></div>

<%
}
else if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.IT_STAFF)
{
%>

<div><a href="/CMSMTDP/fetchChangePassword.do" style="text-align:left">Change Password</a></div>
<br style="line-height:5px"/>
<%
}
%>

</div>
<br>
<div><a href=#" onclick="fnOpenAbout()" style="width:100;text-align:left">About</a></div>
<%} else{%>
<%
ApplicationUser applicationUser=(ApplicationUser)session.getAttribute(WEBKEYS.USER_DETAILS);
if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.IT_STAFF)
{
%>
<div><span style="width:100;text-align:left"><b><u><font size="2">Grant Allocation</font></u></b></span> </div>
<div>
<div><a href="#" style="width:100;text-align:left">Create</a></div>
<div><a href="#" style="width:100;text-align:left">Update</a></div>
<div><a href="#" style="width:100;text-align:left">Correct</a></div>
</div>

<br>
<div><span style="width:100;text-align:left"><b><u><font size="2">Action Plan</font></u></b></span> </div>
<div>
<div><a href="#" style="width:100;text-align:left">Create</a></div>
<div><a href="#" style="width:100;text-align:left">Update</a></div>
<div><a href="#" style="width:100;text-align:left">Correct</a></div>
</div>
<br>
<div><span style="width:100;text-align:left"><b><u><font size="2">Release Details</font></u></b></span> </div>
<div>
<div><a href="#" style="width:100;text-align:left">Create</a></div>
<div><a href="#" style="width:100;text-align:left">Update</a></div>
<div><a href="#" style="width:100;text-align:left">Correct</a></div>
</div>
<br>
<!-- input type=button value="Work Detail" onclick="loadMainFrame(this)" style="width:100;font-weight:bold; background-color:pink;" -->
<div><span value="Work Detail" onclick="" style="width:100;text-align:left" ><b><u><font size="2">Work Detail</font></u></b></span></div>

<div>
<div><a href="#" style="width:100;text-align:left">Create</a></div>
<div><a href="#" style="width:100;text-align:left" >Update</a></div>
<div><a href="#" style="width:100;text-align:left" >Correct</a></div>

</div>
<br>
<div>

<div><a href="#" style="width:100;text-align:left"><b><u>Expenditure Updation</u></b></a></div>
</div>

<br>
<%
}
%>
<div><span style="text-align:left"><b><u><font size="2">Reports</font></u></b></span> </div>
<div><a href="#" style="width:100;text-align:left" >Geographic Abstract Report</a></div>
<div><a href="#" style="width:100;text-align:left">Abstractreport</a></div>
<div><a href="#" style="width:100;text-align:left">Worksummaryreports</a></div>
<div><a href="#" style="width:100;text-align:left">WorkDetails</a></div>
<div><a href="#" style="width:100;text-align:left">DeletedWorkSummaryreports</a></div>
<div><a href="#" style="width:100;text-align:left">PassWordExpiryreports</a></div>
<div><a href="#" style="width:100;text-align:left">WorkwiseProgressreports</a></div>
<br>
<%

if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.MRC_ADMIN)
{
%>

<div>
<div><span style="text-align:left"><b><u><font size="2">Administrator</font></u></b></span> </div>
<div><a href="#" style="width:100;text-align:left">Retrive Works</a></div>
</div>

<div>
<br>
<div><span style="text-align:left"><b><u><font size="2">Delete</font></u></b></span> </div>
<div><a href="#" style="width:100;text-align:left">Works</a></div>
<%
}
%>
</div>
<div>
<br>
<hr>
<div><span style="text-align:left"><b><u><font size="2">User</font></u></b></span> </div>
<%
if(applicationUser!=null && applicationUser.getRoleId()==IMRCConstants.MRC_ADMIN)
{
%>

<div><a href="#" style="width:100;text-align:left" >Upload</a></div>
<div><a href="#" style="text-align:left">Create User</a></div>
<div><a href="#" style="text-align:left">Reset Password</a></div>

<%
}
else
{
%>

<div><a href="#" style="text-align:left">Change Password</a></div>
<%
}
%>
<br style="line-height:5px"/>
</div>
<br>
<div><a href="#" style="width:100;text-align:left">About</a></div>


<%} %>


</td></tr></table>
</body>
</html>
Hi Guys,
In work wise progress report Jsp page, drop down list is there. If i select anyone town name(in list out of 215 town names), it ll display report. After viewing report. i refreshed tat page(ie., it does not go to default "SELECT" option instead, it takes the same city name that i used to check previous report).

For this project i used struts 1.2 & jsp.
please check following code :

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
import="java.sql.*,java.text.DecimalFormat" %>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>

<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<bean:define id="reportModel" name="JSPView"
type="in.gov.mrc.kstd.business.ReportModel" />


<%@page import="in.gov.mrc.kstd.business.WorkwiseProgressReport"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Workwise Progress Report</title>
</head>


<script language="javascript">

function fnFetchData()
{
document.WorkDetailForm.action="/CMSMTDP/generateWorkwiseProgressReport.do?dispatch=workwiseProgressReport";
document.WorkDetailForm.submit();
}

function fnClose()
{
document.location.href="/CMSMTDP/close.do";
}

function fnExport()
{
document.location.href = "/CMSMTDP/export-excel.do?tilesPath=.mrc.exportWorkwiseProgressReport";
}

</script>

<body bgcolor="FFFFCC">

<html:form action="/generateWorkwiseProgressReport.do" method="post">
<table border="0" cellpadding="2" align="center" >

<tr>
<td colspan="7" align="center" class="reportcolumnheader">Town:<html:select property="ulb.ulbId" name = "reportModel" onchange="fnFetchData()">


<logic:notEmpty property = "ulbList" name = "reportModel">
<html:option value="-2">Select</html:option>
<html:option value="-1">All</html:option>
<bean:define id="ulbLst" property="ulbList" name="reportModel"/>
<html:options collection ="ulbLst" property="ulbId" labelProperty="ulbName"/>
</logic:notEmpty>

</html:select> </td>
</tr>
</table>
<logic:equal property="showReportFlag" name="reportModel" value="true">
<table border="1" cellpadding="2" align="center" >

<tr>
<td colspan="13" align="center" class="reportcolumnheader">Workwise Progress Report</td>
</tr>
<tr>
<td colspan="13" align="right" height="5px">
<span style="font-size:10px;font-weight: bold">Rs in Lakhs</span>
</td>
</tr>

<tr>
<td class="reportcolumnheader">S.No</td>
<td class="reportcolumnheader">Town Name</td>
<td class="reportcolumnheader">SectorName</td>
<td class="reportcolumnheader">Package</td>
<td class="reportcolumnheader">Work Code</td>
<td class="reportcolumnheader">WorkName</td>
<td class="reportcolumnheader">Contractor/Entrusted Agency Name</td>
<td class="reportcolumnheader" width="70px">Commencement Date </td>
<td class="reportcolumnheader" width="70px">Target Date</td>
<td class="reportcolumnheader">Work Completion Date</td>
<td class="reportcolumnheader">Contract Amount</td>
<td class="reportcolumnheader">Estimate Cost</td>
<td class="reportcolumnheader">Expenditure Cost</td>

</tr>

<logic:empty property="workwiseProgressReportList" name="reportModel">
<tr ><td colspan="13" align="center" ><span style="font-size:10px;font-weight: bold">No records found</span></td></tr>
</logic:empty>
<%
double contractAmountTotal=0;
double estimateCostTotal=0;
double expenditureCostTotal=0;
int sNo=0;
%>

<logic:notEmpty property="workwiseProgressReportList" name="reportModel">
<logic:iterate id="workwiseProgressReport" property="workwiseProgressReportList" name="reportModel">
<tr>

<%!String contractTotal = null;
String estimateTotal = null;
String expenditureTotal = null;
%>

<%
WorkwiseProgressReport work=(WorkwiseProgressReport) workwiseProgressReport;
int ulbGroup=work.getUlbGroup();
int sectorGroup=work.getSectorGroup();

DecimalFormat df = new DecimalFormat("#0.00");

contractAmountTotal=contractAmountTotal+work.getContractAmount();
contractTotal = df.format(contractAmountTotal);

estimateCostTotal=estimateCostTotal+work.getEstimateCost();
estimateTotal = df.format(estimateCostTotal);

expenditureCostTotal=expenditureCostTotal+work.getExpenditureCost();
expenditureTotal = df.format(expenditureCostTotal);

sNo++;
%>
<td class="reportcolumnLabel"><%=sNo %></td>
<td class="reportcolumnLabel"><bean:write property="ulbName" name="workwiseProgressReport"/></td>

<td class="reportcolumnLabel"><bean:write property="sectorName" name="workwiseProgressReport"/></td>

<td class="reportcolumnLabel"><bean:write property="packageCode" name="workwiseProgressReport"/></td>
<% String workCodeStr=work.getSectorCode()+"/"+work.getPackageCode()+"/"+work.getWorkCode();
%>
<td class="reportcolumnLabel"><%=workCodeStr %></td>
<td class="reportcolumnLabel"><bean:write property="workName" name="workwiseProgressReport"/></td>
<td class="reportcolumnNumber"><bean:write property="contractorentrustedagencyName" name="workwiseProgressReport"/> </td>
<td class="reportcolumnLabel"><bean:write property="commencementDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnLabel"><bean:write property="targetDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="workCompDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="contractAmount" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="estimateCost" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="expenditureCost" name="workwiseProgressReport"/> </td>
</tr>
</logic:iterate>

<tr>
<td colspan="10" align="right" class="reportcolumnheaderRight"> Grand Total:</td>
<td class="reportcolumnheaderRight" align="right"><%=contractTotal %></td>
<td class="reportcolumnheaderRight" align="right"><%=estimateTotal %></td>
<td class="reportcolumnheaderRight" align="right"><%=expenditureTotal %></td>
</tr>

</logic:notEmpty>
</table>

<table align="center" border="0" >

<tr><td colspan="13" align="center"><input type="button" value="Close" class="button" onclick="fnClose()"/>
<input type="button" value="Save As Excel" class="button" onclick="fnExport()"/></td>



</tr>
</table>
</logic:equal>
</html:form>

</body>
</html>
12 years ago
Hi Guys,
I displaying report for work wise progress in jsp. At end of line i calculating total amount of Contract . In my result it is displaying 477.74999999994. For reference you can see attached screen shot file. But i want result in this format 477.74(i dont want to be round off).
below code is report jsp page:


<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
import="java.sql.*"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>

<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<bean:define id="reportModel" name="JSPView"
type="in.gov.mrc.kstd.business.ReportModel" />


<%@page import="in.gov.mrc.kstd.business.WorkwiseProgressReport"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Workwise Progress Report</title>
</head>


<script language="javascript">

function fnFetchData()
{
document.WorkDetailForm.action="/CMSMTDP/generateWorkwiseProgressReport.do?dispatch=workwiseProgressReport";
document.WorkDetailForm.submit();
}

function fnClose()
{
document.location.href="/CMSMTDP/close.do";
}

function fnExport()
{
document.location.href = "/CMSMTDP/export-excel.do?tilesPath=.mrc.exportWorkwiseProgressReport";
}

</script>

<body bgcolor="FFFFCC">

<html:form action="/generateWorkwiseProgressReport.do" method="post">
<table border="0" cellpadding="2" align="center" >

<tr>
<td colspan="7" align="center" class="reportcolumnheader">Town:<html:select property="ulb.ulbId" name = "reportModel" onchange="fnFetchData()">


<logic:notEmpty property = "ulbList" name = "reportModel">
<html:option value="-2">Select</html:option>
<html:option value="-1">All</html:option>
<bean:define id="ulbLst" property="ulbList" name="reportModel"/>
<html:options collection ="ulbLst" property="ulbId" labelProperty="ulbName"/>
</logic:notEmpty>

</html:select> </td>
</tr>
</table>
<logic:equal property="showReportFlag" name="reportModel" value="true">
<table border="1" cellpadding="2" align="center" >

<tr>
<td colspan="13" align="center" class="reportcolumnheader">Workwise Progress Report</td>
</tr>
<tr>
<td colspan="13" align="right" height="5px">
<span style="font-size:10px;font-weight: bold">Rs in Lakhs</span>
</td>
</tr>

<tr>
<td class="reportcolumnheader">S.No</td>
<td class="reportcolumnheader">Town Name</td>
<td class="reportcolumnheader">SectorName</td>
<td class="reportcolumnheader">Package</td>
<td class="reportcolumnheader">Work Code</td>
<td class="reportcolumnheader">WorkName</td>
<td class="reportcolumnheader">Contractor/Entrusted Agency Name</td>
<td class="reportcolumnheader" width="70px">Commencement Date </td>
<td class="reportcolumnheader" width="70px">Target Date</td>
<td class="reportcolumnheader">Work Completion Date</td>
<td class="reportcolumnheader">Contract Amount</td>
<td class="reportcolumnheader">Estimate Cost</td>
<td class="reportcolumnheader">Expenditure Cost</td>

</tr>

<logic:empty property="workwiseProgressReportList" name="reportModel">
<tr ><td colspan="13" align="center" ><span style="font-size:10px;font-weight: bold">No records found</span></td></tr>
</logic:empty>
<%
double contractAmountTotal=0;
double estimateCostTotal=0;
double expenditureCostTotal=0;
int sNo=0;
%>
<logic:notEmpty property="workwiseProgressReportList" name="reportModel">
<logic:iterate id="workwiseProgressReport" property="workwiseProgressReportList" name="reportModel">
<tr>

<%
WorkwiseProgressReport work=(WorkwiseProgressReport) workwiseProgressReport;
int grouper=work.getUlbGroup();
int sectorGroup=work.getSectorGroup();
contractAmountTotal=contractAmountTotal+work.getContractAmount();
estimateCostTotal=estimateCostTotal+work.getEstimateCost();
expenditureCostTotal=expenditureCostTotal+work.getExpenditureCost();
sNo++;
%>
<td class="reportcolumnLabel"><%=sNo %></td>
<td class="reportcolumnLabel"><bean:write property="ulbName" name="workwiseProgressReport"/></td>

<td class="reportcolumnLabel"><bean:write property="sectorName" name="workwiseProgressReport"/></td>

<td class="reportcolumnLabel"><bean:write property="packageCode" name="workwiseProgressReport"/></td>
<% String workCodeStr=work.getSectorCode()+"/"+work.getPackageCode()+"/"+work.getWorkCode();
%>
<td class="reportcolumnLabel"><%=workCodeStr %></td>
<td class="reportcolumnLabel"><bean:write property="workName" name="workwiseProgressReport"/></td>
<td class="reportcolumnNumber"><bean:write property="contractorentrustedagencyName" name="workwiseProgressReport"/> </td>
<td class="reportcolumnLabel"><bean:write property="commencementDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnLabel"><bean:write property="targetDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="workCompDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="contractAmount" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="estimateCost" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="expenditureCost" name="workwiseProgressReport"/> </td>
</tr>
</logic:iterate>
<tr>
<td colspan="10" align="right" class="reportcolumnheaderRight">Total:</td>
<td class="reportcolumnheaderRight" align="right"><%=contractAmountTotal %></td>
<td class="reportcolumnheaderRight" align="right"><%=estimateCostTotal %></td>
<td class="reportcolumnheaderRight" align="right"><%=expenditureCostTotal %></td>
</tr>
</logic:notEmpty>
</table>

<table align="center" border="0" >

<tr><td colspan="14" align="center"><input type="button" value="Close" class="button" onclick="fnClose()"/>
<input type="button" value="Save As Excel" class="button" onclick="fnExport()"/></td>



</tr>
</table>
</logic:equal>
</html:form>

</body>
</html>



Please help me & need code for that

12 years ago
Hi All,
In Work Detail Module, 3 sub modules are--> 1.create, 2.update, 3.correct.
In CREATE Work Detail page, i ll add data and upload photos of work details in createworkdetail.jsp. photos ll stored in D:\CMSMTDP_WorkDetailImages\Anekal\n1.jpeg
In updateworkdetail.jsp & correctworkdetail.jsp(see attached screen pics) if i click on image it ll show error(refer getOutputStream already response.txt) but image is visible n pop in new window.

code for downloaded file(D:\CMSMTDP_WorkDetailImages\Anekal) & to view in jsp

public static void downloadFile(String fileName,HttpServletResponse res) throws WebException
{
ServletOutputStream outStream = null;

int bytesRead=0;
byte [] byteArray = new byte[4096];
System.out.println("filename===>"+fileName);
if(null != fileName)
{
try
{
System.out.println("inside prior to execution download");
FileInputStream is=new FileInputStream(new File(fileName));
res.setContentType("image/jpeg");
outStream = res.getOutputStream();
bytesRead = is.read(byteArray);
while (bytesRead!= -1)
{
outStream.write(byteArray, 0, bytesRead);
bytesRead = is.read(byteArray);
}

// Flush and close stream
outStream.flush();
outStream.close();
is.close();
}
catch (FileNotFoundException e)
{
//throw new WebException(e);
e.printStackTrace();
}
catch (IOException e)
{
throw new WebException(e);
}
}

}
error getting in console:
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:610)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:112)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:125)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:118)
at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:173)
at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:893)
at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
at org.apache.jsp.jsp.Common.CommonLayout_jsp._jspx_meth_tiles_005finsert_005f0(CommonLayout_jsp.java:188)
at org.apache.jsp.jsp.Common.CommonLayout_jsp._jspService(CommonLayout_jsp.java:145)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at org.apache.struts.action.RequestProcessor.doInclude(RequestProcessor.java:1110)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:292)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at in.gov.mrc.kstd.arch.web.WSSORequestFilter.doFilter(WSSORequestFilter.java:141)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
12 years ago
JSP
Hi guys,
In jsp page 2 date text field(1.Entrustment date 2.commencement date). when date is entered in ENTRUSMENT DATE field.same date should be assigned to the COMMENCEMENT DATEfield.
Please let me know how to do with example
i used Ajax in my projects similar to Google search. in Google when you type starting letters, remaining letters will drop down. like that i used in my projects . output is coming. in asset_id column values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001. when i type 1 in text field it is displaying all values from asset_id column.. if i type 1 it should display which are all starts from 1.
query: SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like ? after like some pattern matching should be there.
asset_id is varchar data type
In DETAILS_MASTER_ASSET table ASSET_ID column is there. In ASSET_ID values are like this (a) 1101aaa0001 (b) 4101acd0001 (c) 5204hog0001.
I want what query ll come after like statement. I wrote query like this "SELECT ASSET_ID FROM DETAILS_MASTER_ASSET WHERE ASSET_ID like Next wat ll come
Hi,o
i tried ajax code in jsp and struts. i m getting data from DB but it is not displaying in textbox(displaying below textbox).
below my code in jsp page:
function showData(value){
var name1;

xmlHttp=GetXmlHttpObject();
var url="<%=request.getContextPath()%>/beforeModifyAsset.do?parameter=autoCmplete";
url=url+"&asset="+value;

xmlHttp.onreadystatechange=stateChanged ;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() {
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
var showdata = xmlHttp.responseText;
document.getElementById("mydiv").innerHTML= showdata;
}
}
function GetXmlHttpObject(){
var xmlHttp=null;
try {
xmlHttp=new XMLHttpRequest();
}
catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
<body class="background" id="bodycontent" onload="assetId()">
<html:form action="/beforeModifyAsset.do">
<br>
<center>
<span class="pageHeading"><bean:message key="LS0305" /></span>
</center>
<br>
<logic:messagesPresent>
<table width="450" border="0" cellpadding="0" cellspacing="0" align="center">
<html:messages id="error">
<tr>
<td align="center" width="95%" class="BodyTextMed">
<font color="red">
<li>
<span class="alertMsgs"><bean:write name="error" /></span>
</li>
</font>
</td>
</tr>
</html:messages>
</table>
</logic:messagesPresent>
<logic:messagesPresent message="true">
<table border="0" width="450" cellpadding="0" cellspacing="0" align="center">
<html:messages id="message" message="true">
<tr>
<td align="center" align="center">
<font color="red">
<li>
<span class="alertMsgs"><bean:write name="message" /></span>
</li>
</font>
</td>
</tr>
</html:messages>
</table>
</logic:messagesPresent>
<table width="60%" align="center" class="table">
<tr>
<td>
<table width="98%" align="center" cellSpacing=0 cellPadding=0 border=0 id="bodycontent" >
<tr>
<td align="left" class="td">  Asset Identification Number <font color="red">*</font>:</td>
<td align="left" id="asset" > 
<html:text property="assetId" onkeyup="showData(this.value);"></html:text>
<div id="mydiv"></div>
</td>
</tr>
<tr>

Note: i want to display in textbox similar to google search.
please help me.. what to do next
13 years ago