⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib.txt

📁 又一个课程设计 简易 JSP 论坛 功能较简单的那种, 界面上模仿了 Discuz JSP 本来就学的不行, 只是尽量实现了 MVC
💻 TXT
字号:
<%@ page pageEncoding='UTF-8' %><%!
	HttpServletRequest request;
	HttpServletResponse response;
	HttpSession session;
	javax.servlet.jsp.JspWriter out = null;
	String _title_ = "";
	void setTitle(String s) {
		if (s == null) return;
		s = s.trim();
		if ("".equals(s)) return;
		this._title_ = s;
	}
	String getTitle() {
		if (this._title_ == null) return "";
		if (!"".equals(this._title_)) return this._title_ + " - ";
		return "";
	}
	String getParameter(String k) {
		String value = request.getParameter(k);
		if (value == null) value = "";
		return value;
	}
	int getIParameter(String key) {
		String value = getParameter(key);
		try {
			return Integer.parseInt(value);
		} catch(Exception e) {
			return -1;
		}
	}
	void showNotIntop(Topic topic) {
		if (!topic.isInTop()) return;
		if (!"YES".equals(session.getAttribute("isLogin"))) return;
		Object o = session.getAttribute("usr");
		if (o == null) return;
		User u = (User)o;
		if ("true".equals(request.getAttribute("isManager")) || u.isAdmin())
			w("<a href='protected/SetTopicIntop?action=down&id="+topic.getId()+"'><img title='取消置顶' src='images/icon_down.gif' border='0' /></a>");
	}
	void showIntop(Topic topic) {
		if (topic.isInTop()) return;
		if (!"YES".equals(session.getAttribute("isLogin"))) return;
		Object o = session.getAttribute("usr");
		if (o == null) return;
		User u = (User)o;
		if ("true".equals(request.getAttribute("isManager")) || u.isAdmin())
			w("<a href='protected/SetTopicIntop?id="+topic.getId()+"'><img title='设为置顶' src='images/icon_intop.gif' border='0' /></a>");
	}
	void showDel(String x) {
		if (!"YES".equals(session.getAttribute("isLogin"))) return;
		Object o = session.getAttribute("usr");
		if (o == null) return;
		User u = (User)o;
		if ("true".equals(request.getAttribute("isManager")) || u.isAdmin())
			w("<a onclick='return confirm(\"确认删除吗?\");' href='" + x + "'><img title='删除' src='images/icon_del.gif' border='0' /></a>");
	}
	void showEdit(Topic topic) {
		if (!"YES".equals(session.getAttribute("isLogin"))) return;
		Object o = session.getAttribute("usr");
		if (o == null) return;
		User u = (User)o;
		if ("true".equals(request.getAttribute("isManager"))
				|| topic.getAuthor().equals(u.getUsn()) || u.isAdmin())
			w("<a href='protected/EditTopic?id="+topic.getId()+"'><img title='编辑' src='images/icon_edit.gif' border='0' /></a>");
	}
	void w(String s) { try { out.print(s); } catch(java.io.IOException e) {} }
	void wln(String s) { w(s); w(System.getProperty("line.separator")); }
	void wJS(String s) { wln("<script type='text/JavaScript'>//<![CDATA["); wln(s); wln("//]]></script>"); }
	String toJS(String s) { return cn.ialvin.web.WebUtil.toJS(s); }
	void alert(String s) { wJS("alert(" + toJS(s) + ");"); }
	void replace(String s) { wJS("window.location.replace(" + toJS(s) + ");"); }
	void go(String s) { this.wJS("window.location.href = " + toJS(s) + ";"); }
	void back() { this.wJS("window.history.go(-1);"); }
	String encodeHTML(String s) { return cn.ialvin.web.Encoder.encodeHTML(s); }
%><%
	this.out = out;
	this.request = request;
	this.response = response;
	this.session = session;
%><%@ page import="cn.ialvin.bbs.bean.*"
%><%@ page import="java.util.*"
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -