public String getVatNetAmount()
{
String expensetype = getRequest().getParameter("type");
String localAmount = getRequest().getParameter("amount");
Double localamt = Double.parseDouble(localAmount);
Double netAmount;
netAmount = getExpensesTypeManager().getVatNetAmount(expensetype,localAmount);
am = (float) ((localamt * netAmount)/100);
// getRequest().setAttribute("NetAmount", am);
return INPUT;
}
这是我的java类方法,我想在jsp页面或javascript函数中的变量am
中获取数据?
最佳答案
你可以这样使用:
<%
String var="sth";
%>
<script>
var value = "<%=var%>";
</script>
关于javascript - 我怎样才能从java类获取变量数据到javascript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37290364/