頁面沒跳轉(zhuǎn)成功
index.jsp
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link type="text/css" href="css/bootstrap.min.css" rel="stylesheet">
? ? <link type="text/css" href="css/beyond.min.css" rel="stylesheet">
? ? <link type="text/css" href="css/font-awesome.min.css" rel="stylesheet"/>
? ? <link type="text/css" href="css/style.css" rel="stylesheet">
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/member.js"></script>
</head>
<body id="body">
<!-- ?<table background='images/login.jpg' width="600" height="360" ><tr><td valign="top" align="center">-->
<c:if test="${!empty requestScope.message}">
<script type="text/javascript">
alert("${requestScope.message}");
</script>
<c:remove var="message" scope="request"/>
</c:if>
<c:if test="${!empty sessionScope.message}">
<script type="text/javascript">
alert("${sessionScope.message}");
</script>
<c:remove var="message" scope="session"/>
</c:if>
<c:if test="${!empty sessionScope.teacher}">
<c:remove var="teacher" scope="session"/>
</c:if>
<c:if test="${!empty sessionScope.student}">
<c:remove var="student" scope="session"/>
</c:if>
<c:if test="${!empty sessionScope.admin}">
<c:remove var="admin" scope="session"/>
</c:if>
<c:if test="${!empty score}">
<c:remove var="score" scope="session"/>
</c:if>
<div style="position:absolute;left: 50%;top: 50%;width: 600px;height:360px;margin-left:-300px;margin-top:-200px;background-image: url('images/login.jpg');background-size:600px 360px">
? ? <div style="position: relative;">
? ?
<form role="form" id="login_form" class="form-horizontal" method="post" action="<%=request.getContextPath()%>/Admin_login.action"
? ? ? ? ? ? ? style="position: absolute;top: 120px;right: 160px;width:320px;font-size: 14px; color: #ffffff; ">
? ? ? ? ? ? <div class="form-group">
? ? ? ? ? ? ? ? <label for="username"
? ? ? ? ? ? ? ? ? ? ? ?class="col-xs-3 control-label ?" style="font-weight: bold;">用戶名:</label>
? ? ? ? ? ? ? ? <div class="input-group col-xs-9">
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? <input type="text" class="form-control" id="username" name="username" placeholder="請輸入用戶名"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?required>
? ? ? ? ??
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="form-group">
? ? ? ? ? ? ? ? <label for="password"
? ? ? ? ? ? ? ? ? ? ? ?class="col-xs-3 control-label ?" style="font-weight: bold;">密碼:</label>
? ? ? ? ? ? ? ? <div class="input-group col-xs-9">
? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<input type="password" class="form-control" id="password" name="password"
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? placeholder="請輸入密碼" required>
? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class=" form-group" style="text-align: right;margin-left: 20px">
? ? ? ? ? ? ? ? <button type="submit" id="btn_login" class="btn btn-palegreen ">登錄</button>
? ? ? ? ? ? ? ? <button type="reset" class="btn btn-blue">重置</button>
? ? ? ? ? ? ? ? <a href="index.jsp" class="btn btn-warning">取消</a>
? ? ? ? ? ? </div>
? ? ? ? ? ? <label id="login_tips" ?style="float: right;color: red;font-weight: 100;font-size: 12px">
? ? ? ? ? ? </label>
? ? ? ? </form>
</div>
</div>
? ?<script src="js/jquery.min.js"></script>
</body>
</html>
struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="*_*" class="action.{1}Action" method="{2}">
<result name="login_success">login_success.jsp</result>
<result name="login_failure">index.jsp</result>
</action>
? ? </package>
</struts>
2016-05-17
大部分同學的問題應(yīng)該是有兩個包沒有導入,這個是老師沒有注意到的地方,自行百度log4j的兩個jar包,導入lib里面就可以解決,親測可用~~
2016-05-13
錯誤信息是什么