Changes to JSP code for HTML only

Asked

Viewed 25 times

-2

How can I include a form in my JSP page with Bootstrap 4. I’ve tried to create a form that follows the bottom around my form but it didn’t work. Or better, how can I use HTML5 only without JSP tags.

  <div class="form-group">

  </div>
</form>
<form>
        <div class="form-group">
            <form:form action="${pageContext.request.contextPath}/save"
                modelAttribute="employee">
        Nome: <form:input path="name" />
                <br />
        Selecione o Genero: <form:radiobutton path="gender" value="Masculino" />Masculino&nbsp;
                    <form:radiobutton path="gender" value="Feminino" />Feminino&nbsp;<br />
        Departemento: 
        <form:select path="department">
                    <form:option value="Support">Support</form:option>
                    <form:option value="Testing">Testing</form:option>
                    <form:option value="Development">Development</form:option>
                    <form:option value="Business Analyst">Business Analyst</form:option>
                </form:select>
                <br />
        Data de Aniversário: <form:input path="dob" type="date" />
                <br />
                <form:hidden path="id" />
                <button type="submit">Salvar</button>
            </form:form>
            <div class="card text-center">
                <div class="card-header">Featured</div>
                <div class="card-body">
                    <h5 class="card-title">Special title treatment</h5>
                    <p class="card-text">With supporting text below as a natural
                        lead-in to additional content.</p>
                </div>
            </div>
    </form>

1 answer

0

To use the bootstrap on your jsp page you must import it through the link tag. At the beginning of your JSP put:

 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

Yes, you can only use HTML tags. In fact, JSP allows you to use Expression Language and JSTL (with proper imports) but you can only use common html tags.

  • 1

    I managed to get @Matheusednei. My question was how to create a form on my page. As I had informed I am already using Bootstrap in my project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.