各位大侠帮忙解释一下这些代码

愿颖 2012-03-03 09:46:23
<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>新建权重</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link type="text/css" href="<%=path %>/jxgl/css/css.css" rel="stylesheet"/>
<link type="text/css" href="<%=path %>/jxgl/css/menu_top.css" rel="stylesheet"/>
<script type="text/javascript" src="<%=path %>/jxgl/js/ccorrect_btn.js"></script>
<script type="text/javascript" src="<%=path %>/jxgl/js/check.js"></script>
<script type="text/javascript">
function back()
{
var t='${type}';
var url="";
if(t=="1")url="centraljob.do?op=toExamIndex";
else if(t=="2")url="monopolyjob.do?op=toExamIndex";
else if(t=="3")url="financejob.do?op=toExamIndex";
else if(t=="4")url="netbuildjob.do?op=toExamIndex";
else url="partyjob.do?op=toExamIndex";
location.href=url;
}
</script>
</head>

<body>
<div id="navPanel">
<div id="navMenu">
<span class="big3">新建县局一级考核权重</span>
</div>
</div>
<table border="0" class="TableList" width="100%" align="center">
<tr class="TableContent"><td align="right">
<input type="button" value="返回" class="BigButton" onclick="back();"/></td></tr>
</table>
<form action="baseWeight.do?op=doAdd" method="post">
<input type="hidden" name="bw.type" value="${type }">
<table border="0" class="TableList" width="100%" align="center">
<tr>
<td>级别名称:</td><td><input type="text" name="bw.name" class="BigInput"/></td>
</tr>
<tr>
<td>级别权重:</td><td><input type="text" name="bw.classWeight" class="BigInput" size="4"/>%</td>
</tr>
<tr>
<td>得分占质量分值百分比:</td><td><input type="text" name="bw.scoreWeight" class="BigInput" size="4"/>%</td>
</tr>
<tr class="TableControl">
<td colspan="2"><input type="submit" value="新建" class="BigButton"/></td>
</tr>
</table>
</form>
<html:errors property="ms"/>
</body>
</html>
...全文
105 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Juedaifanghua 2012-03-05
  • 打赏
  • 举报
回复
Struts1...
magong 2012-03-04
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 yjsyt_8910 的回复:]

恩恩,很实用,在这个代码中有这么一行<input type="hidden" name="bw.type" value="${type }">
它是什么作用呢?
[/Quote]
${type}
是个EL表达式,取后台的type属性对象值作为form中隐藏字段bw.type的值
愿颖 2012-03-04
  • 打赏
  • 举报
回复
同意同意,因为我刚接触这个一个星期,往大家多多指点多多赐教哦!
wyx100 2012-03-04
  • 打赏
  • 举报
回复
你需要完整全面的从头学j2ee[html/css/jsp/servlet/标签、表达式]
authorzhh 2012-03-04
  • 打赏
  • 举报
回复
1. 设置class 属性 是为了在CSS中通过 .className设置样式(也可以通过js/jquery取该对象)

2. <input type="hidden" name="bw.type" value="${type }"> 设置隐藏域,提交bw对象的type属性,这个值 通过 EL表达式 取得。
${type} 就是EL表达式取值,可能是存在request/session/aplication ...里的值。

通过你问的问题来看,你需要完整全面的从头学j2ee[html/css/jsp/servlet/标签、表达式]
ouyangxiaokang6 2012-03-03
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 yjsyt_8910 的回复:]
对就是解释struts1的标签,再有就是<input type="text" name="bw.classWeight" class="BigInput" size="4"/>中的class="BigInput"是什么意思?var t='${type}';
中,type是那来的值?初学者,有点不懂
[/Quote]
class="BigInput":是一个css,是定义这个控件的属性的,具体内容你可以去一个叫.css的文件里找到。
t='${type}':是一个EL表达式,值是你在后台的javabean里面设定后,从前台取。
愿颖 2012-03-03
  • 打赏
  • 举报
回复
对就是解释struts1的标签,再有就是<input type="text" name="bw.classWeight" class="BigInput" size="4"/>中的class="BigInput"是什么意思?var t='${type}';
中,type是那来的值?初学者,有点不懂
magong 2012-03-03
  • 打赏
  • 举报
回复
这是一个JSP页面,用了Struts1的标签。
愿颖 2012-03-03
  • 打赏
  • 举报
回复
恩恩,很实用,在这个代码中有这么一行<input type="hidden" name="bw.type" value="${type }">
它是什么作用呢?

81,114

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧