Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to write a values in HTML template, Using Microservices?

MVC Pattern template creation for PDF conversion

public static void main(String...aArguments) throws IOException {

        String strDatos = "Jorman 14988611";
    StringTokenizer tokens = new StringTokenizer(strDatos, " ");
    int nDatos = tokens.countTokens();
    String[] datos = new String[nDatos];
    int i = 0;

    


This code separates a string into tokens and stores them in an array of strings, and then compares a variable with the first home ... why isn't it working?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

home.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>View Names</title>
    <link href="<c:url value="/css1/common1.css"/>" rel="stylesheet" type="text/css">
</head>
<body>
<table>
    <thead>
    <tr>
        <th>Name</th>
        <th>Name</th>
        <th>Name</th>
    </tr>
    </thead>
    <tbody>



    <c:forEach items="${names}" var="name">
        <tr>
            <td>${name}</td>
        ${name1}
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>


Note: here "names" refer List<String> . If you have List<User> then in <td> <td>${user.getName()}</td> 

mapping:

    @PostMapping("/view")
    public String getModel(@RequestBody ViewModel viewModel, Model model){

        model.addAttribute("names", viewModel.getNames());
        model.addAttribute("name1", viewModel.getName1());
        return "home";
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading