`
gg19861207
  • 浏览: 179868 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
FormBean里的属性获取的方法:假如FormBean类型的表单ProductStyleForm里有一个属性叫做productid,流程是productlist.jsp(传递过去一个productid的参数)提交到 ProductStyleAction.java(该Action类绑定了ProductStyleForm),然后经过 ProductStyleAction.java类的处理,又返回到productStylelist.jsp,则在productStylelist.jsp中: 1:<html:text property="productid"/>:是 ...
1:一个用于验证多个表单属性是否为空的js函数   function FormField(name,descrption){ this.name = name; this.description = description; } function checkForm(objForm){ tinyMCE.triggerSave(); var list = new Array(new FormField("name","产品名称"),new FormField("v_type_name","产品类别"),ne ...
select_productType.jsp:   <%@ page contentType="text/html;charset=UTF-8" %><%@ include file="/page/share/taglib.jsp" %><html><head><title> 类别选择 </title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&g ...
1:<html:optionsCollectiion>的用法 <tr bgcolor="f5f5f5">       <td width="25%"> <div align="right">品牌 :</div></td>      <td width="75%"> <html:select property="brandid">          <html:option value=" ...
//UploadFileServiceBean 提供一个查找到要删除文件列表的函数 package com.itcast.service.product.impl; import java.util.LinkedHashMap;import java.util.List; import javax.persistence.Query; import org.springframework.stereotype.Service; import com.itcast.service.base.DaoSupport;import com.itcast.service.product.Uplo ...
<html:hidden property="method">要求对应的formBean 中必须有method这个属性,并且必须为该method属性提供get 和 set方法,而<input type="hidden" name="method">则不需要formBean中必须有method这个属性。
背景:ProductInfo对Brand是多对一的关系,ProductInfo对ProductType是多对一的关系一:1:首先测试单向关联:即只在ProductInfo里添加@ManyToOne(cascade=CascadeType.REFRESH)public Brand getBrand() {return brand;} 和@ManyToOne(cascade=CascadeType.REFRESH,optional=false) //optional=false说明必须要有品牌属性,即这个属性必须有,不能为空public ProductType getType() {return ...
package com.itcast.util; import java.io.IOException;import java.util.Properties; public class SetUrl {static Properties props = new Properties();/** * 该函数的功能就是读取一个属性文件,并根据传入的Key参数返回对应的值 * @param key 属性文件里的键 * @return */public static String getUrlAddress(String key){try {//因为SetUrl 和 siteUrl.propert ...
比如一个action是这么配置的:<action path="/control/brand/list" name="brandForm" scope="request"> <forward name="list" path="/page/brand/brandlist.jsp"></forward></action> 那么在1:不加.do后缀的:<html:form action="/control/brand/manage&quo ...
public boolean validateImageFile(FormFile formFile){if(formFile!=null && formFile.getFileSize()>0){//可以去tomcat目录conf/web.xml查询各种文件的文件类型List<String> allowType = Arrays.asList("image/bmp","image/png","image/gif","image/jpg","image/jpeg" ...
//一个验证表单数据的函数 function checkfm(form){ //验证属性名称为name的字段不能为空if (trim(form.name.value)==""){alert("类别名称不能为空!");form.name.focus();return false;} //验证类型为FormFile的字段logofile,判断上传文件的类型是否合法var fileName = form.logofile.value;if(trim(fileName)!=""){var ext = fileName.substring( ...
package junit.test; import java.util.Iterator;import java.util.LinkedHashMap;import java.util.List; import javax.persistence.EntityManager;import javax.persistence.EntityManagerFactory;import javax.persistence.Persistence;import javax.sql.DataSource; import junit.framework.Assert;import junit.fram ...
public boolean validateFileType(String propertyName) throws Exception{PropertyDescriptor[] propertydesc = Introspector.getBeanInfo(this.getClass()).getPropertyDescriptors();boolean exsit = false;for(PropertyDescriptor property : propertydesc){if(property.getName().equals(propertyName)){exsit = true;M ...
在tomcat安装目录下的conf/web.xml中可以查看到对应的上传文件的列表: <mime-mapping> <extension>abs</extension> <mime-type>audio/x-mpeg</mime-type> </mime-mapping> <mime-mapping> <extension>ai</extension> <mime-type>application/postscript</mime-type> </mim ...
add_brand.jsp中有关上传文件的组件: <html:form action="/control/brand/manage" method="post" enctype="multipart/form-data" onsubmit="return checkfm(this)"> <tr bgcolor="f5f5f5"> <td width="22%" > <div align="right"> ...
Global site tag (gtag.js) - Google Analytics