Ouvrir une autre page1 ou page2
bonjour a vous,
je ne suis pas encore chevroné avec les jsp, je suis confronté a un problème qui se résume comme suit.
comment ouvrir une page1 ou page2 jsp en tenant compte de certains paramteres en entré?
merci,
bout de code:
Code:
1 2 3 4 5 6 7 8 9 10
| if (fullName.equals("")){
%>
<h3><% out.println("username non valide!!!"); %> </h3>
ouvrir la page page1.jsp
<%}else{%>
<h3><% out.println(fullName); %> </h3>
ouvrir la page2.jsp
<%} |
totalité de la page:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="DBconnect.*" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/affablebean.css">
<link rel="stylesheet" type="text/css" href="css/arrondir.css">
<title>Leave Request</title>
</head>
<body>
<div id="main">
<div id="header">
<div id="widgetBar">
<div class="headerWidget">
[ language toggle ]
</div>
<div class="headerWidget">
[ ------------------- ]
</div>
</div>
<img src="css/quantumLogo1.gif" id="logo" alt="quantumLogo1"/>
<img src="css/I_leave5.png" id="logoText" alt="I_leave5">
<h1> Leave Request System </h1>
<div id="coins">
<div id="welcomeText">
<div padding="2">
<p>You are about to enter the online leave request system. This system
is designed to allow employees and supervisors functionality to request
leave and approve or deny leave requests.</P>
<p>As an employee, you will have the following options upon logging into the system:
1. Create a Leave Request,
2. View Pending Requests, and
3. View Process Requests. </P>
<p>As a supervisor, you will have the same options as the employee, as well as the
following upon logging into the system:
1. View Pending Requests of Employees,
2. View Processed Requests of Employees, and
3. View Reports. </P>
</div>
<p>[ welcome text ]</p>
</div>
</div>
<%-- <div id="indexRightColumn" > </div> --%>
<form name="Name Input Form" action="" >
<div id="pwdTable">
<table border="0">
<tbody>
<tr>
<td align="right">User Name : </td>
<td align="left"><input type="text" name="username" size="30" value="belaid.bd.dahmani"/></td>
<td align="right"> </td>
</tr>
<tr>
<td align="right">Password : </td>
<td align="left"> <input type="password" name="password" size="32" /></td>
<td align="right"><input type="submit" value="Login" name="login" /> </td>
</tr>
<tr>
<td ></td>
<td ><img src="css/forgotpwd.png" alt="Forgot password"> Forgot your password </td>
<td > </td>
</tr>
<jsp:useBean id="userPwd" scope="session" class="DBconnect.BeanPassword" />
<jsp:setProperty name="userPwd" property="username" />
<jsp:setProperty name="userPwd" property="password" />
<%
String user = request.getParameter("username");
String pwd = request.getParameter("password");
%>
<%
PwdAuthentification pwdAut = new PwdAuthentification(pwd,user);
String fullName = pwdAut.getUserName();
if (fullName.equals("")){
%>
<h3><% out.println("username non valide!!!"); %> </h3>
ouvrir la page page1.jsp
<%}else{%>
<h3><% out.println(fullName); %> </h3>
ouvrir la page2.jsp
<%}
%>
</tbody>
</table>
</div>
</form>
<%--
<%
PwdAuthentification pwdAut = new PwdAuthentification();
%>
--%>
<div id="footer">
<hr>
<p id="footerText">[ footer text ]</p>
</div>
</div>
</body>
</html> |