Java bootstrap表单和POST方法的问题
我使用bootstrap和Eclipse(使用JBoss)制作了一个带有公式集的简单页面 Html代码(仅部分): ?为什么“email”和“pass”属性返回null 对我的英语很抱歉Java bootstrap表单和POST方法的问题,java,twitter-bootstrap,Java,Twitter Bootstrap,我使用bootstrap和Eclipse(使用JBoss)制作了一个带有公式集的简单页面 Html代码(仅部分): ?为什么“email”和“pass”属性返回null 对我的英语很抱歉 谢谢。要检索http变量,您应该使用getParameter而不是getAttribute <div class="jumbotron"> <div class="container"> <form method="POST" class="form-inl
谢谢。要检索http变量,您应该使用
getParameter
而不是getAttribute
<div class="jumbotron">
<div class="container">
<form method="POST" class="form-inline" action="validarIngresoAdmin.htm">
<h4>Ingrese sus datos:</h4>
<input type="text" class="form-control input-sm" placeholder="Email" name="txtEmail">
<input type="password" class="form-control input-sm" placeholder="Password" name="txtPsw">
<button type="submit" class="btn btn-danger">Iniciar sesión</button>
</form>
</div>
private void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException
{
PrintWriter pw = response.getWriter();
String email = (String)request.getAttribute("txtEmail");
String pass = (String)request.getAttribute("txtPsw");
}