SSH电力项目四-显示首页
1.登录页面:
将上一节中的页面放到/WEB-INF/page/目录下,需要登录后才能访问该页面:
对应页面:/WEB-INF/page/menu/home.jsp
<%@ page language="java" pageEncoding="UTF-8"%> <HTML>
<HEAD>
<TITLE>电力监测中心首页</TITLE>
<LINK href="/css/Font.css" type="text/css" rel="stylesheet"> <STYLE>BODY {
SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-BASE-COLOR: #dee3f7
}
</STYLE> <SCRIPT type="text/javascript">
function submitrequest(action){
eval("document.location='"+action+"'");
} </SCRIPT>
</HEAD> <FRAMESET border=0 frameSpacing=0 rows=82,* frameBorder=0 id="mainparent">
<FRAME name=topFrame src="${pageContext.request.contextPath }/system/elecMenuAction_title.do" noResize scrolling=no>
<FRAMESET id="main" border="0" frameSpacing="0" frameBorder="0" cols="153,1%,*">
<FRAME name="leftFrame" src="${pageContext.request.contextPath }/system/elecMenuAction_left.do" noResize>
<frame name="changeButton" src="${pageContext.request.contextPath }/system/elecMenuAction_change.do" frameBorder=0 marginHeight=0 marginWidth=0 scrolling=no noresize>
<FRAME name="mainFrame" src="${pageContext.request.contextPath }/system/elecMenuAction_loading.do" >
</FRAMESET>
</FRAMESET> </HTML>
创建elecMenuAction.java文件:
package com.itheima.elec.web.action;
@SuppressWarnings("serial")
@Controller("elecMenuAction")
@Scope(value="prototype")
public class ElecMenuAction extends BaseAction<MenuForm>{//需要一个Modeldriver
MenuForm menuForm = this.getModel();
/**
* MenuHome系统登录的首页
* @return
*/
//执行保存
public String menuHome(){
System.out.println(menuForm.getName() + "--" + menuForm.getPassword());
return "menuHome";
}
public String title(){
return "title";
}
public String left(){
return "left";
}
public String change(){
return "change";
}
public String loading(){
return "loading";
}
/**
* 重新登录
* @return 跳转到主页面index.jsp
*/
public String logout(){
//清空指定名称的session
// request.getSession().removeAttribute("arg0");
//清空所有session
request.getSession().invalidate();
return "logout";
}
}
对应struts.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- 开发模式 -->
<constant name="struts.devMode" value="true"></constant>
<!-- ui主题,简单主题 -->
<constant name="struts.ui.theme" value="simple"></constant>
<!-- 修改struts的后缀 改成do -->
<constant name="struts.action.extension" value="do"></constant> <!-- 系统管理 -->
<package name="system" namespace="/system" extends="struts-default">
<!-- 测试 -->
<action name="elecTextAction_*" class="elecTextAction" method="{1}">
<result name="save">/system/textAdd.jsp</result>
</action>
<action name="elecMenuAction_*" class="elecMenuAction" method="{1}">
<result name="menuHome">/WEB-INF/page/menu/home.jsp</result>
<result name="title">/WEB-INF/page/menu/title.jsp</result>
<result name="left">/WEB-INF/page/menu/left.jsp</result>
<result name="change">/WEB-INF/page/menu/change.jsp</result>
<result name="loading">/WEB-INF/page/menu/loading.jsp</result>
<result name="logout" type="redirect">
/index.jsp
</result>
</action>
</package>
</struts>
然后:登录后点击重新登录,退出首页
还有对应的loading.jsp页面
<%@ page language="java" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<link href="${pageContext.request.contextPath }/css/Style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
<!--
body { margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {
color: #000000;
}
-->
</style>
<style>
BODY {SCROLLBAR-FACE-COLOR: #cccccc; SCROLLBAR-HIGHLIGHT-COLOR: #ffffFF; SCROLLBAR-SHADOW-COLOR: #ffffff; SCROLLBAR-3DLIGHT-COLOR: #cccccc; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #ffffFF; SCROLLBAR-DARKSHADOW-COLOR: #cccccc; }
</style>
<script language="javascript">
function shiftiframe(value)
{
if(value==1){
if(document.all.station.width==500)
{
document.all.station.width=1100;
document.getElementById("devtd").style.display="none";
}
else if(document.all.station.width==1100)
{
document.all.station.width=500;
document.getElementById("devtd").style.display="";
}
}
else{
if(document.all.dev.width==500)
{
document.all.dev.width=1100;
document.getElementById("stationtd").style.display="none";
}
else if(document.all.dev.width==1100)
{
document.all.dev.width=500;
document.getElementById("stationtd").style.display="";
}
}
}
/**添加10分钟后自动刷新页面,站点和设备运行的实时性*/
window.onload=function(){
setTimeout('refresh10()',1000*60*10) ;
}
function refresh10(){
window.location.reload();
}
</script>
<link href="${pageContext.request.contextPath }/css/login.css" rel="stylesheet" type="text/css">
</head> <body> <form name="Form1" method="post" action="name.aspx" id="Form1"> <table width="100%" border="0" height="88" border="1" background=${pageContext.request.contextPath }/images/back1.jpg>
<tr>
<td colspan=3 class="ta_01" align="center" background="${pageContext.request.contextPath }/images/b-info.gif"><strong>系统首页</strong></td>
</tr> <tr>
<td width="50%" height="84" align="left" valign="top" id="stationtd"> <fieldset id="stationset" style="width: 500px; height: 430px; padding: 1 background:${pageContext.request.contextPath }/images/back1.JPG"><legend>
<font color="#0000FF">
<img border="0" src="${pageContext.request.contextPath }/images/zoom.gif" width="14" height="14"><a href="#" onclick="shiftiframe('1')">站点运行情况</a></font></legend>
<IFRAME src="elecMenuAction_alermStation.do" name="station" id="station" frameBorder="0" width="500" scrolling="auto" height="400"></IFRAME> </fieldset> </td> <td width="50%" align="left" valign="top" id="devtd">
<fieldset id="devset" style="width: 500px; height: 430px; padding: 1 background:${pageContext.request.contextPath }/images/back1.JPG"><legend>
<font color="#0000FF">
<img border="0" src="${pageContext.request.contextPath }/images/zoom.gif" width="14" height="14"><a href="#" onclick="shiftiframe('2')">设备运行情况</a></font></legend>
<IFRAME src="elecMenuAction_alermDevice.do" name="dev" id="dev" frameBorder="0" width="500" scrolling="auto" height="400"></IFRAME>
</fieldset>
</td>
</tr>
<tr><td height=2></td></tr> </table> </form> </body> </html>
SSH电力项目四-显示首页的更多相关文章
- SSH电力项目
第一步:创建测试表Elec_Text: create table Elec_Text(textID varchar(50) not null primary key,textName varchar( ...
- SSH电力项目一 搭建Hibernate框架
Hibernate所需要的基本文件: ElectText.java ElecText.hbm.xml hibernate.cfg.xml 第一步:创建测试表Elec_Text: create tabl ...
- SSH电力项目九--运行监控首页显示
需求:在首页显示出设备运行情况,并去掉<br>换行符,每隔十分钟刷新一次页面. ElecMenuAction.java 首先注入运行监控service public class ElecM ...
- 电力项目十七--数据字典首页JS添加和删除表格
知识点:jQuery是一个JavaScript函数库. JS代码: function insertRows(){ //获取表格对象 var tb1 = $("#dictTbl"); ...
- SSH电力项目三 - Dao层、service层查询实现(HQL)
底层方法封装:模糊查询,姓张的人 查询思路:select * from elec_text o #Dao层 where o.textName like '%张%' ...
- SSH电力项目二
底层方法封装(CommonDaoImpl类) public class CommonDaoImpl<T> extends HibernateDaoSupport implements IC ...
- SSH项目与SSM项目的进入首页的方法
SSH项目中: jsp页面一般都是存放在WEB-INF下面的目录下,这样我们就不能直接访问到这些jsp页面了,保证了页面的安全性. 在struts的管理中,是利用action来实现页面的跳转,进入in ...
- 在xcode运行编译时,编译成功,但项目中显示缺少该文件,这是只要关闭重启xcode即可。
在xcode运行编译时,编译成功,但项目中显示缺少该文件,这是只要关闭重启xcode即可.
- SSH框架项目开发命名规范
SSH 框架项目开发命名规范 一.各层包及类命名规范 总体原则:包名所有字母小写,类名采用 "驼峰标识",具体如下: 1. Action 类 包命名规范:co ...
随机推荐
- 也谈谈js的压缩,jquery压缩。【转】
问题缘由: 负责公司的开发平台研发工作,考虑的知识产权的保护工作,必须要考虑java的加密技术和js脚本的加密技术.在目前java加密很容易破解的情况下,还是先搞定js的加密和压缩,一方面可以提高页面 ...
- zebra/quagga
参考:http://blog.chinaunix.net/uid-25513153-id-212328.html 一.zebra安装 .编译安装 vim ./lib/zebra.h + 增加: #if ...
- Android学习CursorWrapper与Decorator模式 (转至http://www.cnblogs.com/bastard/archive/2012/05/31/2527944.html)
一 Decorator模式 意图: 动态的给一个对象添加一些额外的职责.就增加功能来说,Decorator模式相比生成子类更为灵活. 动态的给一个对象,而不是对整个类添加额外职责,说明此模式将采用的结 ...
- CentOS7.2内核版本查看简述
1.uname 命令 [root@bogon /]# uname --help 用法:uname [选项]... 输出一组系统信息.如果不跟随选项,则视为只附加-s 选项. -a, --all以如 ...
- iOS: Assertion failure on picker view
Q:I'm getting an assertion failure while scrolling a picker view w/ zero data(zero rows). While scro ...
- hdu5087——Revenge of LIS II
Revenge of LIS II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others ...
- React封装RadioGroup
class RadioGroup extends React.Component { getRadioComponent(item, index) { return <div className ...
- Git 基础 - 查看提交历史
查看提交历史 在提交了若干更新之后,又或者克隆了某个项目,想回顾下提交历史,可以使用 git log 命令查看. 接下来的例子会用我专门用于演示的 simplegit 项目,运行下面的命令获取该项目源 ...
- 基于Bootstrap使用jQuery实现输入框组input-group的添加与删除-改进版
上一次说到了基于Bootstrap使用jQuery实现输入框组input-group的添加与删除 ,初始状态下只有一个输入框组,可以通过点击输入框组的右侧“+”(或自定义的文字)可以在原输入框组的下面 ...
- MathType在字母上加虚线的方法
在数学中根据不同的需要,会对其中的公式或变量字母作不同的标记.这些标记在用MathType编辑数学公式时同样也要准确地编辑出来,例如在字母上方加虚线.这种数学样式在使用时也是根据自己的数学问题来使用的 ...