应该是在servlet或action里 setAttribute,然后跳转到jsp的
解决方案 »
- struts2对象传参如何去除空格,直接hibernate保存数据库中String类型字段有空格
- 关于在java虚拟主机中支持javax.script库的问题
- DJFocus详解?前景如何呢?讨论下
- 求解:说出两个模型设计,并举例说明.
- 为什么用request.setAttribute传值取出来的是null
- 急求:java如何发送和接收XML数据包??? 谢了......
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- Statement stmt=conn.createStatement(); 这个有什么错?
- 有关在jsp中处理输入输出的问题。
- 怎么得到这个数组的长度??
- JSP 与 Spring,hibernate 使用问题,急!!!
- 开发通用查询框架可行吗?
include file如果没有用也不用写呀。
<input type="text" name="kk" value="1">如果这个text在form标签里提交之后 直接 request.getAttribute("kk");就可以获得 1 这个值
就是这个样,这是最经常用的吗,当然也可以用request.getparameter("kk")来获取
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/custom-tag.tld" prefix="custom" %><custom:front_info />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="css/index_black.css" />
<script type="text/javascript" src="js/index_slide.js" charset="GBK"></script> </head>
<body>
<!-- 总版面 -->
<div align="center" id="main_div">
<!-- 中部 -->
<div style="color: #ffffff; width: 910px; height: 281px; margin-top: 15px;">
<!-- 中部左侧 -->
<div style="float: left; width: 294px; text-align: left;">
<div>
<table>
<tr>
<td id="block_title_bar" style="width: 294px;">
<div style="float: left;">天气预报</div>
<div style="float: right;"><%=request.getAttribute("today_date") %> </div>
</td>
</tr>
<tr>
<td style="width: 294px; height:80px; background-color: #000; text-align: right;">
<div style="float: left; width: 76px;">
<div style="float: left; margin-left: 5px; margin-top: 17px;color: #d9b536; font-family: 黑体; font-size: 15px;">星<br/><br/>期</div>
<div style="float: right; margin-top: 6px; font-size: 50px; font-family:Arial Black;">
<%
if(request.getAttribute("dow").toString().equals("0")){
out.print("日");}
else{
out.print(request.getAttribute("dow"));
}%>
</div>
</div>
<div style="float: right; background-color: #fff;height:80px;">
<div style="margin-top: 15px; margin-left: 15px;">
<iframe width="150" height="20" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://news.sina.com.cn/iframe/2008/weather/jump_new.html"></iframe>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- 中部左侧结束 -->
<!-- 中部右侧 -->
<div style="float: right;">
<!-- 推荐球队 -->
<div style="margin-left: 20px;">
<table>
<tr>
<td colspan="2"></td>
<td colspan="2"></td>
<td id="block_title_bar">
我型我秀
</td>
</tr>
<tr>
<%=request.getAttribute("recoTeams") %>
</tr>
<tr>
<td height="10px;" colspan="3"></td>
</tr>
<tr>
<td id="block_title_bar"> 最新约战</td>
<td></td>
<td id="block_title_bar" colspan="3" style="width:390px;" colspan="2">***</td>
</tr>
</table>
</div>