Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 675

I want to show data on front end with the help of jsp [closed]

$
0
0

@RequestMapping(value = "/orders", method = { RequestMethod.GET })public String orderList(ModelMap model, HttpServletRequest request) {

    String uuid;    try {        uuid = (String) request.getSession().getAttribute("uuid");        List<Store> store = storeRepo.getStoresByVendorUuid(uuid);        List<Orders> orders = ordersRepo.getOrdersByStoreUuid(store.get(0).getUuid());        //List<User> user =userRepo.getUsersByUuid(orders.get(0).getCustomerUuid());        //User users = userRepo.getUserByUuid(orders.getCustomerUuid());        String[] statuses = { "New", "Placed", "Canceled", "Accepted", "Ready for pickup", "Out for pickup","Out for delivery", "Delivered" };        String[] colors = { "info", "primary", "danger", "success", "info", "primary", "primary", "success" };        //model.addAttribute("user", user);        model.addAttribute("statuses", statuses);        model.addAttribute("colors", colors);        model.addAttribute("orders", orders);    } catch (Exception e) {        e.printStackTrace();    }    return "orders";}

And JSP code is here

<c:if test="${status > 0}"><jsp:setProperty name="dateValue" property="time"                                                    value="${order.createDateTime}" /><tr><td><a data-toggle="modal" data-target="#myModal"                                                        data-paragraphs="${order.uuid}">ORDRS${order.uuid}</a></td><td><fmt:formatDate pattern="MMM dd, yyyy"                                                            value="${dateValue}" /></td><%-- <td>${order.store_name}</td> --%><td>${order.ordered_by_user_name}</td><td><span                                                        class="label label-${colors[order.deliveryStatus] }">${statuses[order.deliveryStatus] }</span></td><td><a class="view" title="View" data-toggle="modal"                                                        data-target="#myModal" data-paragraphs="${order.uuid}"><i                                                            class="material-icons">&#xe8f4;</i></a><c:if test="${status > 4 && status < 17}"><a  onclick='window.open("livetracking?id=${order.uuid}","","toolbar=no,status=no,menubar=no,location=center,scrollbars=no,resizable=no,height=500,width=657");'                                                        title="Live Tracking" id="mdlive" ><i                                                            class="fa fa-map-marker" aria-hidden="true"></i></a></c:if><c:if test="${status < 4}"><a  onclick='alert("Live tracking is not available in this status.")'                                                        title="Live Tracking" id="mdlive" ><i                                                            class="fa fa-map-marker" aria-hidden="true"></i></a></c:if></td></tr></c:if></c:forEach></tbody>

I run this service but on backend I get all data but on front or JSP page its not show so I want solution for this. and delivery status is in DB store string format like 'DELIVERY_REQUESTED', 'LANDING_CUSTOMER' in this format so give me solution for this


Viewing all articles
Browse latest Browse all 675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>