William Brogden wrote:
How can I return only the value?
Simple - use a servlet. JSP always assumes you want to write an HTML page.
Bill
Bill, I have tried to use servlet but I had difficulties in calling the bean.
FYI, I am using bean to store the value. By using jsp, I can call the bean using:
<jsp:useBean id="beanAnalysis" class="bean.Analysis" scope="application"/>
AFAIK, bean can only be called from servlet if the servlet is called by another servlet and not by jsp.
Do you have any information on how I can use servlet in this context?
Below is my coding in jsp:
<html>
<head>
</head>
<body>
<jsp:useBean id="beanAnalysis" class="bean.Analysis" scope="application"/>
<%
beanAnalysis.setWallUValue(Float.parseFloat(request.getParameter("val")));
//MORE CODING ON CALCULATIONS
//CALCULATE ENERGY PERFORMANCE
SolarGainCalculation sgc = new SolarGainCalculation();
sgc.setTransmissionLossEP(beanAnalysis.getCurrentTransmissionLoss());
sgc.setVentilationLossEP(beanAnalysis.getCurrentVentilationLoss());
sgc.setInternalGainEP(beanAnalysis.getCurrentInternalGain());
sgc.setSolarGainEP(beanAnalysis.getCurrentSolarGain());
beanAnalysis.setCurrentEnergyPerformance((int)sgc.energyPerformance());
response.getWriter().print(beanAnalysis.getCurrentEnergyPerformance()); //THIS IS THE VALUE I RETURN TO AJAX
%>
</body>
</html>
Iman