Home Display some simple data in HTML
Reply: 0

Display some simple data in HTML

user1284 Published in July 21, 2018, 11:25 am

activeUsers.getUsers() returns a list with the online users in my app.

I want to display it in my HTML but I have no idea how to do this. I'm getting error 404 on my ajax request yet if I put a breakpoint in my controller it shows the list of online users.

Any help??


  @RequestMapping(value = "/loggedUsers", method = RequestMethod.GET)
public String getLoggedUsers(Model model) {
    model.addAttribute("loggedUsers", activeUsers.getUsers());
    return "loggedUsers";


$(document).ready(function () {

//get loggedUsers
    url: '/loggedUsers',
    type: 'get',
    success: function (loggedUsers) {


<div id="sidebar-right" class="visible">
<ul class="sidebar-nav">
    <li id="dashboard">
        <a href="dashboard">
            <c:forEach var="loggedUser" items="${loggedUsers}">
                <span class="menu-title">${loggedUser}</span>

the console log returns:

error 404

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301143 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO