简体   繁体   中英

Can I use bootstrap with Struts2?

I've currently tried to integrate bootstrap into my project, and so far it does not look at all as I intended in the first place, this is what I have...

 <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <link rel="stylesheet" href="bootsrap/css/style.css"> <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap" rel="stylesheet"> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <title>JSP Page</title> </head> <body> <div class="container"> <s:form action="registrar" theme="simple" cssClass="well form-horizontal"> <s:textfield label="ID Asignación" placeholder="ID Unidad" name="u.ID"></s:textfield> <s:textfield label="Nombre Asignación" name="u.NombreUA"></s:textfield> <s:textfield label="Tipo cuota" name="u.TipoCuota"></s:textfield> <s:textfield label="Grupo cuota" name="u.GrupoCuota"></s:textfield> <s:textfield label="Fecha Inicio" name="u.FechaInic"></s:textfield> <s:textfield label="Grupo Fecha término" name="u.FechaTerm"></s:textfield> <s:textfield label="Región/Macrozona" name="u.RegionM"></s:textfield> <s:textfield label="Imputación conjunta" name="u.ImpConj"></s:textfield> <s:submit value="Registrar"></s:submit> </s:form> </div> </body> </html> 

Which looks like this...

index.jsp

实际上,我通过在每个文本字段中添加cssClass =“ form-control”来解决此问题。

Try to use lower version of bootstrap. I was just trying to upgrade bootstrap version on mine and it messed up the whole look.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM