Following is my jsp code. I’m new to JSP. I get the error shown after the code
<body>
<%!
public ArrayList<ArrayList<Leg>> trip;
public void routeManager(){
Location stLoc = new Location(60.2040521,24.96185113,"1023");
Location endLoc = new Location(60.17936316, 24.92282214 ,"1130");
RouteRetriever hrr = new RouteRetriever();
trip = hrr.getRoutes(stLoc, endLoc, false);
}
%>
<% routeManager();
System.out.println("Im here AA");%>
<%= out.println("Hello World:"+hrr.size()) %>
<p>Booooooooooooo!</p>
</body>
Error:
An error occurred at line: 30 in the jsp file: /index.jsp
The method print(boolean) in the type JspWriter is not applicable for the arguments (void)
I think you should change
to (just output)
or if you want to use println (change <%= to <%):