-1

I've calculated the total form submission in the backend, and now I need to display it beside the "total submission" tag on the JSP page. I've tried a variety of approaches, but nothing seems to be working. What is the best approach to show the long value on a jsp page?

Doyel Mishra
  • 312
  • 1
  • 3
  • 14

3 Answers3

1

Usually you put the object in the HttpResponse object of the servlet and forward it (read this for an example: Pass variables from servlet to jsp )

after this in the jsp you get the object (or the value directly) and <%=valueToShow%>

HypedBuddy
  • 11
  • 1
  • 3
1

if the bean is included in your model:

<div>
    <dt>Submissions</dt>
    <dt><form:input path="totalSubmissions" readonly="true" /></dt>                    
</div>
0

//jsp Page

 <dd>Total Submissions:- ${dashboard.totalSubmissions}</dd>

//controller

long total_submissions = flowSubService.totalSubmissions() + formSubService.totalSubmissions();
 mv.addObject("dashboard", bean);

//bean

private long totalSubmissions;
getter setter
Doyel Mishra
  • 312
  • 1
  • 3
  • 14