propManager.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:4k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: propManager.jsp,v $
- * $Revision: 1.3.2.1 $
- * $Date: 2001/01/06 23:50:07 $
- */
- %>
- <%@ page
- import="java.sql.*,
- java.util.*,
- com.coolservlets.forum.*,
- com.coolservlets.forum.util.*,
- com.coolservlets.forum.database.*"%>
- <jsp:useBean id="adminBean" scope="session"
- class="com.coolservlets.forum.util.admin.AdminBean"/>
- <% ////////////////////////////////
- // Jive authorization check
- // check the bean for the existence of an authorization token.
- // Its existence proves the user is valid. If it's not found, redirect
- // to the login page
- Authorization authToken = adminBean.getAuthToken();
- if( authToken == null ) {
- response.sendRedirect( "/mainctrl/bbs/admin" );
- return;
- }
- %>
- <% ///////////////////////
- // get parameters
- String propAction = ParamUtils.getParameter(request,"propAction");
- String propName = ParamUtils.getParameter(request,"propName");
- String propValue = ParamUtils.getParameter(request,"propValue",true);
- %>
- <% //////////////////
- // perform action
- boolean doSomething = (propAction != null);
- // add a property
- if( doSomething && propAction.equals("增加") ) {
- if( propName != null && propValue != null ) {
- // add if prop doesn't already exist
- if( PropertyManager.getProperty(propName) == null ) {
- PropertyManager.setProperty(propName,propValue);
- }
- }
- }
- // update a property
- else if( doSomething && propAction.equals("修改") ) {
- if( propValue != null ) {
- PropertyManager.setProperty(propName,propValue);
- }
- }
- // delete a property
- else if( doSomething && propAction.equals("删除") ) {
- if( propName != null ) {
- PropertyManager.deleteProperty(propName);
- }
- }
- %>
- <html>
- <head>
- <title>属性管理</title>
- <link rel="stylesheet" href="style/global.css">
- <style type="text/css">
- INPUT {
- font-family : courier new;
- font-size : 9pt;
- }
- </style>
- </head>
- <body background="images/shadowBack.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
- <%-- header --%>
- <table class="pageHeaderBg" cellpadding="1" cellspacing="0" border="0" width="100%">
- <td><table class="pageHeaderFg" cellpadding="3" cellspacing="0" border="0" width="100%">
- <td>
- <span class="pageHeaderText">
- 属性管理
- </span>
- </td>
- </table></td>
- </table>
- <%-- /header --%>
- <p>
- 此处是所有的全局属性。
- <p>
- <table bgcolor="#333333" cellpadding="0" cellspacing="0" border="0" width="100%">
- <td>
- <table bgcolor="#333333" cellpadding="3" cellspacing="1" border="0" width="100%">
- <tr bgcolor="#dddddd">
- <td>
- 属性名称
- </td>
- <td>
- 属性值
- </td>
- <td> </td>
- <td> </td>
- </tr>
- <% /////////////////////////
- // display all properties
- Enumeration propertyNames = PropertyManager.propertyNames();
- while( propertyNames.hasMoreElements() ) {
- String name = (String)propertyNames.nextElement();
- String value = PropertyManager.getProperty(name);
- %>
- <tr bgcolor="#ffffff">
- <form action="propManager.jsp">
- <input type="hidden" name="propName" value="<%= name %>">
- <td>
- <span style="font-size:8pt">
- <%= name %>
- </span>
- </td>
- <td>
- <input type="text" value="<%= value %>" name="propValue" size="40">
- </td>
- <td align="center">
- <input type="submit" name="propAction" value="修改">
- </td>
- <td align="center">
- <input type="submit" name="propAction" value="删除"
- onclick="return confirm('您确认要删除此属性吗?')">
- </td>
- </form>
- </tr>
- <% }
- %>
- </table>
- </td>
- </table>
- <p>
- <b>增加一个属性</b>
- <form action="propManager.jsp">
- <table bgcolor="#333333" cellpadding="0" cellspacing="0" border="0" width="100%">
- <td>
- <table bgcolor="#333333" cellpadding="3" cellspacing="1" border="0" width="100%">
- <tr bgcolor="#ffffff">
- <td>
- 名称:
- </td>
- <td>
- <input type="text" name="propName" value="">
- </td>
- </tr>
- <tr bgcolor="#ffffff">
- <td>
- 属性值:
- </td>
- <td>
- <input type="text" name="propValue" value="">
- </td>
- </tr>
- <tr bgcolor="#ffffff">
- <td colspan="2" align="center">
- <input type="submit" name="propAction" value="增加">
- </td>
- </tr>
- </table>
- </td>
- </table>
- </form>
- <br>
- </body>
- </html>