[Cruce-commit] SF.net SVN: cruce:[158] JSP/trunk/Forum/WebContent
Status: Beta
Brought to you by:
caiusb
|
From: <ali...@us...> - 2010-05-18 15:14:54
|
Revision: 158
http://cruce.svn.sourceforge.net/cruce/?rev=158&view=rev
Author: alinposho
Date: 2010-05-18 15:14:48 +0000 (Tue, 18 May 2010)
Log Message:
-----------
Am pus css-ul din login intr-o pagina separata si l-am legat ca si css extern urmand sa fac acelasi lucru si pentru paginile: Thread si Topic
Modified Paths:
--------------
JSP/trunk/Forum/WebContent/commitRegister.jsp
JSP/trunk/Forum/WebContent/index.jsp
JSP/trunk/Forum/WebContent/login.jsp
Added Paths:
-----------
JSP/trunk/Forum/WebContent/pageStyle.css
Modified: JSP/trunk/Forum/WebContent/commitRegister.jsp
===================================================================
--- JSP/trunk/Forum/WebContent/commitRegister.jsp 2010-05-18 14:44:10 UTC (rev 157)
+++ JSP/trunk/Forum/WebContent/commitRegister.jsp 2010-05-18 15:14:48 UTC (rev 158)
@@ -67,9 +67,7 @@
{
//saving problem string as a session variable
session.setAttribute("problem", problem);
- %>
- <!-- Forwarding problem -->
-
+ %>
<jsp:forward page="register.jsp"></jsp:forward>
<%
}
Modified: JSP/trunk/Forum/WebContent/index.jsp
===================================================================
--- JSP/trunk/Forum/WebContent/index.jsp 2010-05-18 14:44:10 UTC (rev 157)
+++ JSP/trunk/Forum/WebContent/index.jsp 2010-05-18 15:14:48 UTC (rev 158)
@@ -10,77 +10,33 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Team Bubulina's Forum</title>
-<style type="text/css">
-table{
- border: 10px solid blue;
- border-collapse: collapse;
- align: center;
- width: 80%
-}
-th{
- align: center;
-}
-td{
- border: 3px solid blue;
- border-collapse: collapse;
- height: 40px;
-}
+<!-- Linking css -->
+<link rel="stylesheet" href="pageStyle.css" type="text/css">
-a:link {
- color: green;
-}
-
-h1 {
- font-weight: bold;
- text-align: center;
-}
-
-#leftContent {
- float: left;
- padding: 10px;
- width: 300px; /* ie5win fudge begins */
- voice-family: "\"}\"";
- voice-family:inherit;
- width: 270px;
- }
-html>body #leftContent {
- width: 270px; /* ie5win fudge ends */
- }
-#rigthContent {
- float: left;
- padding: 10px;
- width: 300px; /* ie5win fudge begins */
- voice-family: "\"}\"";
- voice-family:inherit;
- width: 270px;
- }
-html>body #rigthContent {
- width: 270px; /* ie5win fudge ends */
- }
-</style>
</head>
<body>
<%
//This form is to be dispayed only if the user is logged in
- String user = request.getParameter("user");
+ String user = (String)session.getAttribute("user");
if(user != null && !user.equalsIgnoreCase("null"))
- {
-%>
+ {//If the user has logged in
+ %>
<!-- The form for adding a new Thread -->
- <div id="leftContent" align="right">
- Thread name: <INPUT TYPE="TEXT" NAME="ThreadName" value="">
- <FORM NAME="AddThread" action="index.jsp" method="get">
- <INPUT TYPE="submit" VALUE="Add Thread">
+ <div id="leftContent" align="right">
+ <FORM NAME="AddThread" action="index.jsp" method="get">
+ Thread name: <INPUT TYPE="TEXT" NAME="ThreadName" value="">
+ <INPUT TYPE="submit" VALUE="Add Thread">
</FORM>
</div>
-
-<%
- //If the user has logged in
- %>
- <p> Hello <%out.print(user); %>!</p>
+ <div id="#rigthContent" align="right" >
+ <font size="4px">
+ Hello <%out.print(user); %>!
+ Welcome to our forum.
+ </font>
+ </div>
<%
}
else
@@ -91,20 +47,7 @@
<form name="Login" action="login.jsp" method="post">
User name: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
- <input type="submit" value="login">
- <%
- //Handling posible login problems
- String problem = request.getParameter("problem");
- if(problem != null && (problem.isEmpty() == false)
- && (problem.equals("null")) == false)
- {
- %>
- <font color="red" size="14">
- There is the following problem: <%out.println(problem); %>
- </font>
- <%
- }
- %>
+ <input type="submit" value="login">
</form>
<form action="register.jsp" action=post>
<input type="submit" value="register">
Modified: JSP/trunk/Forum/WebContent/login.jsp
===================================================================
--- JSP/trunk/Forum/WebContent/login.jsp 2010-05-18 14:44:10 UTC (rev 157)
+++ JSP/trunk/Forum/WebContent/login.jsp 2010-05-18 15:14:48 UTC (rev 158)
@@ -7,9 +7,10 @@
<%@page import="prc.bubulina.forum.dataclasses.*"%>
<html>
+
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Insert title here</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>login</title>
</head>
<body>
<%
@@ -42,30 +43,25 @@
if(problem != null)
{
%>
- <!-- Forwarding problem -->
- <form name="dummy2">
- <input type="hidden" name="problem" value="<%out.print(problem);%>">
- </form>
+ <p align="center">
+ There is the following problem: <%out.println(problem); %>.<br>
+ Please try signing in again.
+ <form action="index.jsp" method="post" >
+ <input align="top" type="submit" value="Back to main">
+ </form>
<%
- String redirectURL = "index.jsp";
- response.sendRedirect(redirectURL);
}
else
{
- //All OK
- %>
- <!-- Forwarding user name -->
- <form name="dummy">
- <input type="hidden" name="user"
- value="<%out.print(userName);%>"
- >
- </form>
- <p>
- Congratulations <%out.print(userName);%>. You have been successfully logged in.
- </p>
- <form action="index.jsp" method="post">
- <input type="submit" value="Back to main">
- </form>
+ //All OK
+ //Saving the new logged user in the cookies
+ session.setAttribute("user", userName);
+ %>
+ <p align="center">
+ Congratulations <%out.print(userName);%>. You have been successfully logged in.
+ <form action="index.jsp" method="post" >
+ <input align="top" type="submit" value="Back to main">
+ </form>
<%
}
%>
Added: JSP/trunk/Forum/WebContent/pageStyle.css
===================================================================
--- JSP/trunk/Forum/WebContent/pageStyle.css (rev 0)
+++ JSP/trunk/Forum/WebContent/pageStyle.css 2010-05-18 15:14:48 UTC (rev 158)
@@ -0,0 +1,48 @@
+@CHARSET "ISO-8859-1";
+table{
+ border: 10px solid blue;
+ border-collapse: collapse;
+ align: center;
+ width: 80%
+}
+
+th{
+ align: center;
+}
+td{
+ border: 3px solid blue;
+ border-collapse: collapse;
+ height: 40px;
+}
+
+a:link {
+ color: green;
+}
+
+h1 {
+ font-weight: bold;
+ text-align: center;
+}
+
+#leftContent {
+ float: left;
+ padding: 10px;
+ width: 300px; /* ie5win fudge begins */
+ voice-family: "\"}\"";
+ voice-family:inherit;
+ width: 270px;
+ }
+html>body #leftContent {
+ width: 270px; /* ie5win fudge ends */
+ }
+#rigthContent {
+ float: left;
+ padding: 10px;
+ width: 300px; /* ie5win fudge begins */
+ voice-family: "\"}\"";
+ voice-family:inherit;
+ width: 270px;
+ }
+html>body #rigthContent {
+ width: 270px; /* ie5win fudge ends */
+ }
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|