<%@ page language="java" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html> <head> <title>JSP for AddForm form</title> </head> <body> <html:form action="/add" enctype="multipart/form-data"> name : <html:text property="name"/><html:errors property="name"/><br/> photo : <html:file property="photo"/><html:errors property="photo"/><br/> <html:submit/><html:cancel/> </html:form> </body> </html> view plaincopy to clipboardprint? <%@ page language="java" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html> <head> <title>JSP for AddForm form</title> </head> <body> <html:form action="/add" enctype="multipart/form-data"> name : <html:text property="name"/><html:errors property="name"/><br/> photo : <html:file property="photo"/><html:errors property="photo"/><br/> <html:submit/><html:cancel/> </html:form> </body> </html>
<%@ page language="java" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html> <head> <title>JSP for AddForm form</title> </head> <body> <html:form action="/add" enctype="multipart/form-data"> name : <html:text property="name"/><html:errors property="name"/><br/> photo : <html:file property="photo"/><html:errors property="photo"/><br/> <html:submit/><html:cancel/> </html:form> </body> </html> 3:photo(javabean)代码如下
Java代码 package com.hp.entity;
import java.sql.Blob;
public class Photo implements java.io.Serializable {
private Integer id; private String name; private Blob photo;
public Photo() { }
public Photo(String name) { this.name = name; }
public Photo(String name, Blob photo) { this.name = name; this.photo = photo; }
public Integer getId() { return this.id; }
public void setId(Integer id) { this.id = id; }
public String getName() { return this.name; }
public void setName(String name) { this.name = name; }
public Blob getPhoto() { return photo; }
public void setPhoto(Blob photo) { this.photo = photo; }
} view plaincopy to clipboardprint? package com.hp.entity;
import java.sql.Blob;
public class Photo implements java.io.Serializable {
private Integer id; private String name; private Blob photo;
public Photo() { }
public Photo(String name) { this.name = name; }
public Photo(String name, Blob photo) { this.name = name; this.photo = photo; }
public Integer getId() { return this.id; }
public void setId(Integer id) { this.id = id; } |