用数组处理表单数据之一
2013-05-05 06:24
344 查看
在jsp中改写toString()
<jsp:useBean id="simpleBean" scope="request" class="liulixin.facebook.SimpleBean" /> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <P> colors = <%=toString(simpleBean.getColors())%> </body> </html> <%!public static String toString(String list[]) { return "www.188029.net"; }%>
package liulixin.facebook; public class SimpleBean implements java.io.Serializable { private String colors[]; public String[] getColors() { return colors; } public void setColors(String[] colors) { this.colors = colors; } /** * Gets an element of the colors property */ public String getColors(int index) { return this.colors[index]; } /** * Sets an element of the colors property */ public void setColors(int index, String value) { this.colors[index] = value; } }在jsp中混杂java代码是一件多么惬意的事呀。什么框架,设计模式,go!
相关文章推荐
- 通达OA 对于工作流表单中列表控件数据的数组问题处理
- 通达OA 对于工作流表单中列表控件数据的数组问题处理
- 用数组处理表单数据之二——整数数组型数据
- PHP中使用php://input处理相同name值的表单数据
- 面向对象处理人员数据 (动态数组,人员数据的增加与删除)
- mina自定义编解码器接收处理byte数组(同时解决数据传输中的粘包、缺包问题)
- php 将print_r处理后的数据还原为原始数组的方法
- jsp 处理表单数据
- spring mvc表单数据绑定,对于基本类型和日期的处理WebDataBinder
- springmvc处理表单数据到后台
- nodejs之处理表单数据
- jquery序列化form表单使用ajax提交后处理返回的json数据
- 四、处理表单数据
- Numpy快速处理数据--结构数组(二)
- fastJson在java后台转换json格式数据探究(二)--处理数组/List/Map
- mybatis 处理数组类型及使用Json格式保存数据 JsonTypeHandler and ArrayTypeHandler
- C语言程序设计---6:利用数组处理批量数据
- form 转json,将form表单中的数据序列化数组后转换为Json
- ajax自动提交表单数据,经php处理返回数据
- Servlet对表单数据的处理