设置一个人主页给我 要JSP代码,求高手帮忙`
5个回答
2013-08-11
展开全部
个人的主页,这个概念有点大哦,它包括许多的内容。也不是一个页面可以处理的。估计应该有留言版啊,个人相册啊什么的。你说清楚点我如果有空了可以写个给你,或者你可以到www.csdn.com上去下一个就可以了,那上面是现在中过比较全的一个源码网站!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-11
展开全部
没有需求,楼上的仁兄们也能给出代码,真的很牛啊!!!如果客户真的这么跟我说就要一个页面,我就给他一个html的白板...因为你没告诉我们你需要什么,做多了也不会加钱
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-11
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你可以随便找个个人主页,然后鼠标右击,选择“查看源”
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-08-11
展开全部
jsp源代码:JSP的login程序代码
<!-- Login Manager -->
<JAVA TYPE="class">
public static boolean checkUserPermission(HttpSession mySession, HttpServletRequest request, HttpServletResponse response)
{
if (mySession.getValue("hasPermission") == null || !((Boolean) mySession.getValue("hasPermission")).booleanValue())
{
String requestedUrl = HttpUtils.getRequestURL(request).toString();
String queryString = request.getQueryString();
if (queryString != null)
{
requestedUrl = requestedUrl + "?" + queryString;
}
requestedUrl = response.encodeUrl(requestedUrl);
mySession.putValue("requestedUrl", requestedUrl);
return false;
}
else
{
return true;
}
}
</JAVA>
<%
// THIS IS A JSP FILE
String goodUser = "bill";
String goodPass = "bobo";
HttpSession mySession = request.getSession(true);
String errorMessage = "Please Login To Access The Page You Requested";
boolean loginAttempt = false;
String myMethod = request.getMethod();
if (request.getParameterValues("click") != null && request.getParameterValues("click")[0].trim().equals("Log In"))
{
loginAttempt = true;
}
if (loginAttempt)
{
String username = request.getParameterValues("user")[0].trim();
String password = request.getParameterValues("pass")[0].trim();
//out.println("username = |" + username + "| & password = |" + password + "|<BR>");
if (goodUser.equals(username) && goodPass.equals(password))
{
response.sendRedirect((String)mySession.getValue("requestedUrl"));
mySession.putValue("hasPermission", new Boolean(true));
errorMessage = "Unable to redirect: " + (String)mySession.getValue("requestedUrl");
}
else
{
errorMessage = "You did not get the Username or Password right";
}
}
else
{
errorMessage = "Haven\'t tried logging in yet.";
if (mySession.getValue("requestedUrl") == null)
{
mySession.putValue("requestedUrl", "/index.jsp");
}
//out.println("set userReferrer to " + mySession.getValue("redirectTo") + "<BR>");
}
%>
<CENTER>
<font color=red><%=errorMessage%></font>
<TABLE align=center>
<FORM action="adminLogin2.jsp" method=post name="login">
<TR><TD>Username:</TD><TD><input type=text name=user value=""></TD></TR>
<TR><TD>Password:</TD><TD><input type=password name=pass value=""></TD></TR>
<TR><TD colspan=2 align=center><input type=submit name=click value="Log In"></TD></TR>
</FORM>
</TABLE>
</CENTER>
Original URL: <%= (String)mySession.getValue("requestedUrl") %>
<script language="javascript">
// <!--
if (document.forms.login != null)
document.forms.login.user.focus();
// -->
</script>
<!-- Login Manager -->
<JAVA TYPE="class">
public static boolean checkUserPermission(HttpSession mySession, HttpServletRequest request, HttpServletResponse response)
{
if (mySession.getValue("hasPermission") == null || !((Boolean) mySession.getValue("hasPermission")).booleanValue())
{
String requestedUrl = HttpUtils.getRequestURL(request).toString();
String queryString = request.getQueryString();
if (queryString != null)
{
requestedUrl = requestedUrl + "?" + queryString;
}
requestedUrl = response.encodeUrl(requestedUrl);
mySession.putValue("requestedUrl", requestedUrl);
return false;
}
else
{
return true;
}
}
</JAVA>
<%
// THIS IS A JSP FILE
String goodUser = "bill";
String goodPass = "bobo";
HttpSession mySession = request.getSession(true);
String errorMessage = "Please Login To Access The Page You Requested";
boolean loginAttempt = false;
String myMethod = request.getMethod();
if (request.getParameterValues("click") != null && request.getParameterValues("click")[0].trim().equals("Log In"))
{
loginAttempt = true;
}
if (loginAttempt)
{
String username = request.getParameterValues("user")[0].trim();
String password = request.getParameterValues("pass")[0].trim();
//out.println("username = |" + username + "| & password = |" + password + "|<BR>");
if (goodUser.equals(username) && goodPass.equals(password))
{
response.sendRedirect((String)mySession.getValue("requestedUrl"));
mySession.putValue("hasPermission", new Boolean(true));
errorMessage = "Unable to redirect: " + (String)mySession.getValue("requestedUrl");
}
else
{
errorMessage = "You did not get the Username or Password right";
}
}
else
{
errorMessage = "Haven\'t tried logging in yet.";
if (mySession.getValue("requestedUrl") == null)
{
mySession.putValue("requestedUrl", "/index.jsp");
}
//out.println("set userReferrer to " + mySession.getValue("redirectTo") + "<BR>");
}
%>
<CENTER>
<font color=red><%=errorMessage%></font>
<TABLE align=center>
<FORM action="adminLogin2.jsp" method=post name="login">
<TR><TD>Username:</TD><TD><input type=text name=user value=""></TD></TR>
<TR><TD>Password:</TD><TD><input type=password name=pass value=""></TD></TR>
<TR><TD colspan=2 align=center><input type=submit name=click value="Log In"></TD></TR>
</FORM>
</TABLE>
</CENTER>
Original URL: <%= (String)mySession.getValue("requestedUrl") %>
<script language="javascript">
// <!--
if (document.forms.login != null)
document.forms.login.user.focus();
// -->
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询