微信小程序报错does not have a method "getPhone" to handle event "blur".

微信小程序一直报
Component "pages/login/login" does not have a method "getPhone" to handle event "blur".
VM1062:1 Component "pages/login/login" does not have a method "getCode" to handle event "blur".VM1062:1 Component "pages/login/login" does not have a method "getCode" to handle event "blur".
我对着视频写的呀 为什么我的一直会报错
图片说明图片说明

1个回答

MyselfOne77
MyselfOne77 回复少年.: 后面有解决吗?我也遇到了
3 个月之前 回复
qq_43460095
少年. 没有多空格呀
5 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
提示No getter method for property 错误?想不明白!

我写个简单的struts1.2的关于人员信息管理的东西在写好pojo、action、actionform并在xml中做好相关配置后,访问前台注册页面时总提示: javax.servlet.jsp.JspException: No getter method for property user.owner of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:973) at org.apache.struts.taglib.html.BaseFieldTag.prepareValue(BaseFieldTag.java:121) at org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(BaseFieldTag.java:102) at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:81) at _jsp._register__jsp._jspService(register.jsp:36) at com.caucho.jsp.JavaPage.service(JavaPage.java:61) at com.caucho.jsp.Page.pageservice(Page.java:578) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:192) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607) at java.lang.Thread.run(Thread.java:595) pojo类public class Users implements Serializable { private String name, pwd,phone,address, owner; setter/getter } 我的注册页面的内容是: <%@ 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"%> <html:errors /> <html:form action="/register.do" method="post"> <table border="0"> <tr> <td> 用户名: </td> <td> <html:text property="user.owner" /> </td> </tr> <tr> <td> 密码: </td> <td> <html:password property="user.pwd" /> </td> </tr> <tr> <td> 地址: </td> <td> <html:text property="user.address" /> </td> </tr> <tr> <td> 电话: </td> <td> <html:text property="user.phone" /> </td> </tr> <tr> <td> <center> <html:submit value="注册" /> &nbsp; <html:reset value="重置" /> </center> </td> </tr> </table> </html:form> 我的action是 public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // TODO Auto-generated method stub RegisterForm regForm = (RegisterForm) form; String owner = regForm.getOwner(); String pwd = regForm.getPwd(); String address = regForm.getAddress(); String phone = regForm.getPhone(); Users user = new Users(); user.setOwner(owner); user.setPwd(pwd); user.setAddress(address); user.setPhone(phone); //user.setName(null); //test this line !!! String result=null; boolean boo=false; try { UserServers us = new UserServers(); boo=us.addUser(user); } catch (Exception e) { e.printStackTrace(); } if (boo == true) { return (mapping.findForward("success")); } else { return (mapping.findForward("fail")); } } actionform是这样写的 public void reset(ActionMapping mapping, HttpServletRequest request) { // TODO Auto-generated method stub users = new Users(); } @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // TODO Auto-generated method stub ActionErrors errors = new ActionErrors(); if ((users.getOwner() == null) || (users.getOwner().length() < 6)) errors.add("owner", new ActionMessage("error.owner.required")); if ((users.getPwd() == null) || (users.getPwd().length() < 6)) errors .add("password", new ActionMessage( "error.password.required")); if ((users.getAddress() == null) || (users.getAddress().length() < 1)) errors.add("address", new ActionMessage("error.address.required")); if ((users.getPhone() == null) || (users.getPhone().length() < 1)) errors.add("phone", new ActionMessage("error.phone.required")); return errors; } public Users getUsers() {} public void setUsers(Users users) {} public void setOwner(String owner) { } public String getOwner() {} public void setPwd(String pwd) {} public String getPwd() {} public String getAddress() {} public void setAddress(String address) {} public String getPhone() {} public void setPhone(String phone) {} xml中的配置 <form-beans> <form-bean name="userForm" type="org.forms.UserForm" /> <form-bean name="InsertConsumeForm" type="org.forms.InsertConsumeForm" /> <form-bean name="registerForm" type="org.forms.RegisterForm" /> </form-beans> <action-mappings> <action path="/register" type="org.actions.RegisterAction" name="registerForm" scope="request" validate="true" input="/register.jsp"> <forward name="success" path="/functionpage.jsp"/> <forward name="fail" path="/register.jsp"/> </action> </action-mappings> [b]问题补充:[/b] 二楼仁兄,我以前就试验过了,和那个没关系的。

ColdFusion结构和Ajax

<div class="post-text" itemprop="text"> <p>I have a simple form with a select and a text box. Using the change function, I call a cfc that runs a query and returns a result: right now, as a struct. As odd as this may sound, I need help getting the data out of that struct and into the text box. </p> <p>Below is what I have for the cfm and the cfc. Any help would be REALLY appreciated.</p> <p><strong>test.cfm</strong> (this is just a simple form)</p> <pre><code>&lt;cfquery name="getHRSpecialists" datasource="AOO"&gt; SELECT * FROM [52PrepHRSpecialists] &lt;/cfquery&gt; &lt;script src="jquery-2.2.3.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $textBox6 = $("#textBox6"); $("#textBox5").change(function(e) { var selected = $(this).val(); console.log('change:', selected); if(selected === '') return; $.get("getHRPhone.cfc?method=getPhone", {textBox5:selected}, function(res) { $textBox6.html(res); }); }); }); &lt;/script&gt; &lt;cfform&gt; &lt;cfselect name="textBox5" id="textBox5" title="Select You Human Resource Specialist's Name" class="headerFields"&gt; &lt;option value=""&gt;Choose a Specialist&lt;/option&gt; &lt;cfoutput query="getHRSpecialists"&gt; &lt;option value="#hrSpecName#"&gt;#hrSpecName#&lt;/option&gt; &lt;/cfoutput&gt; &lt;/cfselect&gt; HRS's Phone #: &lt;cfinput id="textBox6" name="textBox6" type="text" title="Your Human Resource Specialist's Phone ##" readonly&gt; &lt;/cfform&gt; </code></pre> <p><strong>getHRPhone.cfc</strong> (this is the cfc that gets referenced from the ajax call)</p> <pre><code>&lt;cfcomponent output="false"&gt; &lt;cffunction name="getPhone" access="remote" output="true" returntype="struct" returnformat="json"&gt; &lt;cfargument name="textBox5" type="string" required="true" &gt; &lt;cfquery name="getPhone" datasource="AOO"&gt; SELECT hrSpecPhone FROM [52PrepHRSpecialists] WHERE hrSpecName = '#arguments.textBox5#' &lt;/cfquery&gt; &lt;cfset local.obj = {phone = getPhone.hrSpecPhone} &gt; &lt;cfreturn local.obj&gt; &lt;/cffunction&gt; &lt;/cfcomponent&gt; </code></pre> <p><strong>Data</strong> (this is the data I get back)</p> <pre><code>{"PHONE":"123-456-7890"} </code></pre> <p>All I need is the actual phone number in the input box based on whoever is selected.</p> </div>

远程连接redis连接池总是报错

springboot连接redis 项目启动 服务器上redis是开着的 也能连上 redis.conf中绑定本地id也删除了 就是用这个连接池的时候报错 控制台报如下错误: ``` org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:204) at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:348) at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:129) at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:92) at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:79) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:194) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:169) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:91) at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:169) at com.how2java.test.TestRedisOne.testRedisOne(TestRedisOne.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:53) at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226) at redis.clients.jedis.JedisPool.getResource(JedisPool.java:16) at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:194) ... 38 more Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out at redis.clients.jedis.Connection.connect(Connection.java:207) at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93) at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1767) at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:106) at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:888) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:432) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:361) at redis.clients.util.Pool.getResource(Pool.java:49) ... 41 more Caused by: java.net.SocketTimeoutException: connect timed out at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at redis.clients.jedis.Connection.connect(Connection.java:184) ... 48 more ``` ``` package com.how2java.springboot.web; import java.util.Date; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.how2java.redis.RedisClient; import com.how2java.springboot.pojo.JsonData; import com.how2java.springboot.pojo.UserPojo; import com.how2java.utils.JsonUtils; @RestController @RequestMapping("/api/v1/redis") public class RedisTestController { //得到redis封装类 @Autowired private RedisClient redis; //添加字符串 @GetMapping(value="add") public Object add(){ redis.set("username", "xddddddd"); return JsonData.buildSuccess(); } //通过key值得到value字符串 @GetMapping(value="get") public Object get(){ String value = redis.get("username"); return JsonData.buildSuccess(value); } //将对象通过工具类转成String类型,存入redis中 @GetMapping(value="save_user") public Object saveUser(){ UserPojo user = new UserPojo(1, "abc", "11", new Date()); String userStr = JsonUtils.obj2String(user); boolean flag = redis.set("base:user:11", userStr); return JsonData.buildSuccess(flag); } //通过key值得到value值,让后将value转为对象 @GetMapping(value="find_user") public Object findUser(){ String userStr = redis.get("base:user:11"); UserPojo user = JsonUtils.string2Obj(userStr, UserPojo.class); return JsonData.buildSuccess(user); } } ``` application.propertites ``` ##REDIS (RedisProperties) spring.redis.host=39.105.35.139 spring.redis.port=6397 spring.redis.pool.max-idle=200 spring.redis.pool.min-idle=200 spring.redis.pool.max-active=2000 spring.redis.pool.max-wait=1000 spring.redis.timeout=3000 spring.redis.database=0 spring.redis.password= ``` ``` package com.how2java.redis; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Component; /** * 功能描述:redis工具类 * 对于redisTpl.opsForValue().set(key, value)进行了一次封装,不然每次都要这样保存值 * 而封装后只需:new RedisClient().set(key,value); */ @Component public class RedisClient { @Autowired private StringRedisTemplate redisTpl; //jdbcTemplate // 功能描述:设置key-value到redis中 public boolean set(String key ,String value){ try{ redisTpl.opsForValue().set(key, value); return true; }catch(Exception e){ e.printStackTrace(); return false; } } // 功能描述:通过key获取缓存里面的值 public String get(String key){ return redisTpl.opsForValue().get(key); } } ``` ``` package com.how2java.utils; import java.io.IOException; import org.springframework.util.StringUtils; import com.fasterxml.jackson.databind.ObjectMapper; /** * 字符串转对象,对象转字符串的工具类 * 因为StringRedisTemplate的opsForValue()方法需要key,value都需要String类型,所以当value值存入对象的时候 * 先转成字符串后存入。 */ public class JsonUtils { private static ObjectMapper objectMapper = new ObjectMapper(); //对象转字符串 public static <T> String obj2String(T obj){ if (obj == null){ return null; } try { return obj instanceof String ? (String) obj : objectMapper.writeValueAsString(obj); } catch (Exception e) { e.printStackTrace(); return null; } } //字符串转对象 public static <T> T string2Obj(String str,Class<T> clazz){ if (StringUtils.isEmpty(str) || clazz == null){ return null; } try { return clazz.equals(String.class)? (T) str :objectMapper.readValue(str,clazz); } catch (IOException e) { e.printStackTrace(); return null; } } } ``` ``` package com.how2java.springboot.pojo; import java.io.Serializable; /** * 这是后端向前端响应的一个包装类 * 一般后端向前端传值会有三个属性 * 1:响应状态 * 2:如果响应成功,把数据放入 * 3: 描述,响应成功描述,或者失败的描述 */ public class JsonData implements Serializable { private static final long serialVersionUID = 1L; private Integer code; // 状态码 0 表示成功,1表示处理中,-1表示失败 private Object data; // 数据 private String msg;// 描述 public JsonData() { } public JsonData(Integer code, Object data, String msg) { this.code = code; this.data = data; this.msg = msg; } // 成功,只返回成功状态码 public static JsonData buildSuccess() { return new JsonData(0, null, null); } // 成功,传入状态码和数据 public static JsonData buildSuccess(Object data) { return new JsonData(0, data, null); } // 失败,传入描述信息 public static JsonData buildError(String msg) { return new JsonData(-1, null, msg); } // 失败,传入描述信息,状态码 public static JsonData buildError(String msg, Integer code) { return new JsonData(code, null, msg); } // 成功,传入数据,及描述信息 public static JsonData buildSuccess(Object data, String msg) { return new JsonData(0, data, msg); } // 成功,传入数据,及状态码 public static JsonData buildSuccess(Object data, int code) { return new JsonData(code, data, null); } public Integer getCode() { return code; } public void setCode(Integer code) { this.code = code; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public static long getSerialversionuid() { return serialVersionUID; } @Override public String toString() { return "JsonData [code=" + code + ", data=" + data + ", msg=" + msg + "]"; } //提供get和set方法,和toString方法 } ``` ``` package com.how2java.springboot.pojo; import java.util.Date; public class UserPojo { private int age; private String pwd; private String phone; private Date createTime; public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public UserPojo() { super(); } public UserPojo(int age, String pwd, String phone, Date date) { super(); this.age = age; this.pwd = pwd; this.phone = phone; this.createTime = date; } } ```

Spring和Mybatis整合后注入报错

新手入门,最近在学习框架整合的时候遇到一个问题,就是配置好必须的文件后,测试的时候发现用@Resource注入直接报错。找了很久都不知道什么原因,求大神们帮助T T 直接贴图。 spring-mybatis.xml ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!-- 自动扫描 --> <context:component-scan base-package="com.schoolmarket.ssm"/> <!-- 第一种方式:加载一个properties文件 --> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:jdbc.properties"/> </bean> <!-- 第二种方式:加载多个properties文件 <bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>classpath:jdbc.properties</value> <value>classpath:common.properties</value> </list> </property> <property name="fileEncoding" value="UTF-8"/> </bean> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer"> <property name="properties" ref="configProperties"/> </bean> --> <!-- 配置数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${driverClasss}"/> <property name="url" value="${jdbcUrl}"/> <property name="username" value="${username}"/> <property name="password" value="${password}"/> <!-- 初始化连接大小 --> <property name="initialSize" value="${initialSize}"></property> <!-- 连接池最大数量 --> <property name="maxActive" value="${maxActive}"></property> <!-- 连接池最大空闲 --> <property name="maxIdle" value="${maxIdle}"></property> <!-- 连接池最小空闲 --> <property name="minIdle" value="${minIdle}"></property> <!-- 获取连接最大等待时间 --> <property name="maxWait" value="${maxWait}"></property> </bean> <!-- mybatis和spring完美整合,不需要mybatis的配置映射文件 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="classpath:mapping/*.xml"></property> </bean> <!-- DAO接口所在包名,Spring会自动查找其下的类 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> <property name="basePackage" value="com.schoolmarket.ssm.dao"/> </bean> <!-- (事务管理)transaction manager, use JtaTransactionManager for global tx --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean> <!-- (事务管理)transaction manager, use JtaTransactionManager for global tx --> <tx:annotation-driven transaction-manager="transactionManager"/> </beans> ``` User.java ``` package com.schoolmarket.ssm.model; public class User { private String uid; private String username; private String pwd; private String phone; private String address; public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } } ``` UserDao.java ``` package com.schoolmarket.ssm.dao; import com.schoolmarket.ssm.model.User; public interface UserDao { User selectById(String uid); } ``` UserMapping.xml ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.schoolmarket.ssm.dao.UserDao"> <select id="selectById" resultType="com.schoolmarket.model.User" parameterType="String"> select uid,username,pwd,phone,address from users where uid = #{uid} </select> </mapper> ``` IUserService.java ``` package com.schoolmarket.ssm.service; import com.schoolmarket.ssm.model.User; public interface IUserService { public User getUserById(String uid); } ``` UserServiceImpl.java ``` package com.schoolmarket.ssm.service; import com.schoolmarket.ssm.dao.UserDao; import com.schoolmarket.ssm.model.User; import org.springframework.stereotype.Service; import javax.annotation.Resource; @Service("userService") public class UserServiceImpl implements IUserService { @Resource private UserDao userDao; public User getUserById(String uid) { return userDao.selectById(uid); } } ``` 那么重点来了。 ![图片说明](https://img-ask.csdn.net/upload/201610/28/1477619092_506993.png)

Websocket通过注解连不上service

用了好的办法就是死活打印不出来service里面的值,使用别的controller可以打印出来service里面的东西 package com.xinhaiwang.controller; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.concurrent.CopyOnWriteArraySet; import javax.servlet.http.HttpServletRequest; import javax.websocket.CloseReason; import javax.websocket.OnClose; import javax.websocket.OnError; import javax.websocket.OnMessage; import javax.websocket.OnOpen; import javax.websocket.Session; import javax.websocket.server.ServerEndpoint; import org.springframework.beans.factory.annotation.Autowired; import com.xinhaiwang.service.MklService; @ServerEndpoint("/echo") public class Websocket { @Autowired private MklService mklservice; /*private MklService mklservice=(MklService) ContextLoader.getCurrentWebApplicationContext().getBean("mklservice");*/ //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。若要实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key可以为用户标识 private static CopyOnWriteArraySet<Websocket> webSocketSet = new CopyOnWriteArraySet<Websocket>(); //与某个客户端的连接会话,需要通过它来给客户端发送数据 private Session session; @OnOpen public void onOpen(Session session) throws IOException { System.out.println("onOpen"); this.session = session; webSocketSet.add(this); //加入set中 System.out.println("有新连接加入!"); //以下代码省略... } @OnMessage public String onMessage(String message) throws Exception { System.out.println("onMessage"); System.out.println("验证连通性:"); /* DmzController dmz = new DmzController(); System.out.println(dmz.mkl()); mklservice.getCount();*/ //向前端传送消息 return "77777"; //以下代码省略... } /*@OnMessage(maxMessageSize=6) public void receiveMessage(String message) { System.out.println("receiveMessage"); System.out.println("来自客户端的消息:" + message); //以下代码省略... }*/ @OnError public void onError(Throwable t) { System.err.println("onError"); //以下代码省略... } @OnClose public void onClose(Session session, CloseReason reason) { System.err.println("onClose"); //以下代码省略... } public void sendMessage(String message) throws IOException{ //调用写好的方法向前端发起请求并一块传值 this.session.getBasicRemote().sendText(message); //this.session.getAsyncRemote().sendText(message); } /** * 获取数组 * @throws Exception */ public String getbean() throws Exception{ System.out.println("进入到自定义方法"); //判断时间 Map<String, Object>map = new HashMap<>(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 String now = df.format(new Date()); String time = "2017-11-19 11:00:00"; System.out.println("获取当前系统时间"+now);// new Date()为获取当前系统时间 System.out.println("获取自定义时间"+time);//获取自定义时间 /*System.out.println("总条数"+service.getCount());*/ String sjh[] = new String[10]; map.put("data", sjh); //判断是否到抽奖时间 System.out.println("判断时间:"+!now.equals(time)); mklservice.getCount(); System.out.println("获取总条数"+mklservice.getCount()); /*if(!now.equals(time)){ //查到中奖的手机号做成数组(加个 判断数组.length是否等于十) for (int i = 0; i < 10; i++) { //生成随机数作为id boolean a = true; Integer x=(int)(Math.random()*100); while (a) { System.out.println("随机数:"+x); Integer id = mklservice.getCount(); System.out.println("总条数"+id); if(id<x){ a = true; }else{ a = false; Mkl mkl = mklservice.getbean(x); sjh[i]=mkl.getPhone(); mkl.setYuliu1("1"); } } } map.put("data", sjh); }*/ return ""; } }

com.google.gson.JsonSyntaxException

我使用的是谷歌提供的gson解析json数据。json数据如下" {"flag":"0","data":{"id":"176","loginName":"18224006722","name":"18224006722","phone":"18224006722","mobile":"18224006722","loginToken":"c4b23c48bcc7a9bf4f4301cfeca4c3d2","isStoreAdm":"1","storeLogo":""},"tcount":0} ";网络方面我使用的是 OkHttpUtils。 使用自定义的 StringCallback() public abstract class LoginCall extends Callback<Login>{ @Override public Login parseNetworkResponse(Response response) throws Exception { String result = response.body().string(); Gson gson=new Gson(); return gson.fromJson(result,Login.class); } } java实体类我使用的是GsonFormat自动生成的而且还序列化了的,结果就是要报这个异常,求解答。 哦哦,我不使用gson解析可以获取到json字符串, java实体类: public class Login implements Serializable{ private String flag; private DataBean data; private int tcount; public String getFlag() { return flag; } public void setFlag(String flag) { this.flag = flag; } public DataBean getData() { return data; } public void setData(DataBean data) { this.data = data; } public int getTcount() { return tcount; } public void setTcount(int tcount) { this.tcount = tcount; } public static class DataBean implements Serializable{ private String id; private String loginName; private String name; private String phone; private String mobile; private String loginToken; private String isStoreAdm; private String storeLogo; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getLoginName() { return loginName; } public void setLoginName(String loginName) { this.loginName = loginName; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getLoginToken() { return loginToken; } public void setLoginToken(String loginToken) { this.loginToken = loginToken; } public String getIsStoreAdm() { return isStoreAdm; } public void setIsStoreAdm(String isStoreAdm) { this.isStoreAdm = isStoreAdm; } public String getStoreLogo() { return storeLogo; } public void setStoreLogo(String storeLogo) { this.storeLogo = storeLogo; } } 求帮助呀,谢谢大神了。

JSON编码格式错误

<div class="post-text" itemprop="text"> <p>Sorry guys for asking this easy question, but I got a stuck in here.</p> <p>I have a GET method from webservice to retrieve user data.</p> <p>So I have the json output like this right now :</p> <pre><code>{ error: false users: [2] 0: { user_id: 44 email: "asdasd1212@gmail.comnmmm" name: "rendyyyyyyy" phone: "1212121" picture: "hahaha.jpg" status: "Actived" created_at: "2014-12-27 10:48:10" } -1: { user_id: 45 email: "asdas1212151@gmail.comnmmm" name: "rendyyyyyyy" phone: "1212121" picture: "hahaha.jpg" status: "Actived" created_at: "2014-12-27 10:48:15" } } </code></pre> <p>I got that output with this following code :</p> <pre><code>$app-&gt;get('/admin/list/user', 'authenticate', function() { global $user_id; $response = array(); // fetching all users $userDB = new AdminController(MySqlDb::getInstance()-&gt;connect()); $users = $userDB-&gt;getAllUsers(); $response["error"] = false; $response["users"] = array(); foreach ($users as $user) { $tmp = array(); $tmp['user_id'] = $user-&gt;getUserId(); $tmp["email"] = $user-&gt;getEmail(); $tmp["name"] = $user-&gt;getName(); $tmp["phone"] = $user-&gt;getPhone(); $tmp["picture"] = $user-&gt;getPicture(); $tmp["status"] = $user-&gt;getStatus(); $tmp["created_at"] = $user-&gt;getCreatedAt(); array_push($response["users"], $tmp); } echoRespnse(200, $response); }); function echoRespnse($status_code, $response) { $app = \Slim\Slim::getInstance(); // Http response code $app-&gt;status($status_code); // setting response content type to json $app-&gt;contentType('application/json'); echo json_encode($response); } </code></pre> <p>I do not know why my JSON output goes wrong like that. All I want is to get JSON output like this :</p> <pre><code> { error: false users: [ { user_id: 44 email: "asdasd1212@gmail.comnmmm" name: "rendyyyyyyy" phone: "1212121" picture: "hahaha.jpg" status: "Actived" created_at: "2014-12-27 10:48:10" }, { user_id: 45 email: "asdas1212151@gmail.comnmmm" name: "rendyyyyyyy" phone: "1212121" picture: "hahaha.jpg" status: "Actived" created_at: "2014-12-27 10:48:15" } ] } </code></pre> </div>

addFlashAttribute重定向页面传值获取不到

if ((userControllerPojo.getVerificationCode1().trim()).equals(session.getAttribute("strCode"))){ if ((userService.findbyphone(user.getPhone()))!=null){ model.addAttribute("regpdited","此手机号已经注册,请前往登录"); }else { int i = userService.InsertUserbyPhone(user); if (i == 1) { String state = "注册成功,请前往登录"; model.addAttribute("state",state ); } else { model.addAttribute("state", "注册失败,请重新注册"); return "/Regedit"; } } }else { Object Vcode = "Login Success"; ar.addFlashAttribute("Vcode",Vcode); return "redirect:/Regedit.jsp"; } return "/SkipShow"; } 调试点在 ar.addFlashAttribute("Vcode",Vcode); 没有值,watch as object能找到flashattributes的值是Vcode的值,但是为什么html用el表达式¥{Vcode}获取不到

数据已经从数据库返回结果,却没在窗口显示出来,大神帮我看一下.

这是在MainActivity的显示方法 ``` public class MainActivity extends AppCompatActivity { private ListView listView; private PersonService personService; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); personService = new PersonService(this); listView = (ListView) findViewById(R.id.listView); show(); } private void show() { List<Person> personList = personService.getScrollDate(1, 20); List<HashMap<String,Object>> data= new ArrayList<HashMap<String, Object>>(); HashMap<String,Object> item; for(Person person:personList) { item = new HashMap<String,Object>(); item.put("id",person.getId()); item.put("name",person.getName()); item.put("phone", person.getPhone()); data.add(item); } //适配器用来实现数据与条目,条目与listView的绑定。 SimpleAdapter simpleAdapter = new SimpleAdapter(this,data,R.layout.item,new String[]{"id","name","phone"},new int[]{R.id.id,R.id.name,R.id.phone}); listView.setAdapter(simpleAdapter); } ``` 这是item.xml内容 ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <TextView android:layout_width="150dip" android:layout_height="wrap_content" android:id="@+id/id" /> <TextView android:layout_width="100dip" android:layout_height="wrap_content" android:id="@+id/name" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/phone" /> </LinearLayout> ``` 这是activity_main.xml内容 ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <TextView android:layout_width="150dip" android:layout_height="wrap_content" android:text="@string/id" /> <TextView android:layout_width="100dip" android:layout_height="wrap_content" android:text="@string/name" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/phone" /> </LinearLayout> <ListView android:background="#ff0000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/listView" /> </LinearLayout> ```

在PHP应用程序中使用Decorator模式

<div class="post-text" itemprop="text"> <p>I am getting to a point in my application where there seems to be a lot of presentation logic in my models:</p> <pre><code>&lt;?php foreach ($this-&gt;users as $user): ?&gt; &lt;span class="phone"&gt; &lt;?php echo $user-&gt;getPhoneNumberFormattedAsText(); ?&gt; &lt;/span&gt; &lt;?php endforeach; ?&gt; </code></pre> <p>At first, I started approaching this as a need for View Helpers:</p> <pre><code>&lt;span class="phone"&gt;&lt;?php echo $this-&gt;userPhone($user-&gt;getPhone()); ?&gt;&lt;/span&gt; </code></pre> <p>However, I've started running into a problem where I have lots of little View Helpers that are specific to certain models, that don't need to take up an entire file. It would be nice if I could group this presentation logic together and keep it out of the model. I think this is when the <a href="http://en.wikipedia.org/wiki/Decorator_pattern" rel="nofollow">decorator pattern</a> makes sense.</p> <blockquote> <p>"The decorator pattern is a design pattern that allows behaviour to be added to an existing object dynamically."</p> </blockquote> <p>I have seen a few examples online, but no real, practical examples of code. I would like to know if you have successfully used this pattern in your PHP application and what a PHP example of this should look like.</p> </div>

Hibernate4 org.hibernate.QueryException异常问题

各位大侠好,项目一直报错"org.hibernate.QueryException: could not resolve property: u_phone of: com.wanshang.po.Users",我仔细检查po类和映射文件,也没发现错误,请问各位大侠,这个问题是哪里错了?下面是各配置文件: ## Users.java ``` public class Users { private int id; private String name; private String phone; private String password; private String paypassword = "*"; private String usertype = "customer"; private float point = 0; public Users(){} public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPaypassword() { return paypassword; } public void setPaypassword(String paypassword) { this.paypassword = paypassword; } public String getUsertype() { return usertype; } public void setUsertype(String usertype) { this.usertype = usertype; } public float getPoint() { return point; } public void setPoint(float point) { this.point = point; } } ``` ## Users.hbm.xml ``` <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.wanshang.po.Users" table="usersInfo"> <!-- 用户编号 --> <id name="id" column="u_id"> <generator class="identity" /> </id> <!-- 用户姓名 --> <property name="name" column="u_name" /> <!-- 用户手机 --> <property name="phone" column="u_phone" /> <!-- 用户密码 --> <property name="password" column="u_password" /> <!-- 用户支付密码 --> <property name="paypassword" column="u_paypassword" /> <!-- 用户类型 --> <property name="usertype" column="u_usertype" /> <!-- 用户积分 --> <property name="point" column="u_point" /> </class> </hibernate-mapping> ``` ## hibernate.cfg.xml ``` <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="myeclipse.connection.profile">mysql</property> <!-- 数据库方言 --> <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property> <!-- 数据库驱动 --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <!-- 数据库链接 --> <property name="connection.url">jdbc:mysql://127.0.0.1:3306/wanshang</property> <!-- 数据库用户名 --> <property name="connection.username">root</property> <!-- 数据库密码 --> <property name="connection.password"></property> <!-- 数据库连接池最大连接数 --> <property name="connection.pool_size">2000</property> <!-- 自动建表 --> <property name="hbm2ddl.auto">update</property> <!-- 打印SQL语句 --> <property name="show_sql">true</property> <!-- 映射 --> <mapping resource="com/wanshang/po/Users.hbm.xml" /> </session-factory> </hibernate-configuration> ``` ## 报错时经常会指向这个方法,代码如下: ``` /*通过字段集合查找*/ public Users findByMap(Map<String, String> params) { // TODO Users users = new Users(); //生成Session实例 Session session = HibernateUtil.getSession(); try{ Criteria criteria = session.createCriteria(Users.class); //遍历Map Set<String> key = params.keySet(); for(Iterator it = key.iterator();it.hasNext();){ String k = (String) it.next(); //保存key criteria.add(Restrictions.eq(k, params.get(k)));//eq是等于,gt是大于,lt是小于,or是或 System.out.println(k+":"+params.get(k)); } users = (Users) criteria.list().get(0); }catch(Exception e){ e.printStackTrace(); }finally{ //关闭Session实例 HibernateUtil.closeSession(session); return users; } } ``` ## 下面是数据库截图: ![图片说明](https://img-ask.csdn.net/upload/201610/21/1477037855_873577.jpg)

学说一次设置多个标准,而不是一次设置多个标准

<div class="post-text" itemprop="text"> <p>I'm using the KendoUI Framework GRID which returns back JSON of the users current filter settings.</p> <p>Its result looks something like this for the filters.</p> <pre><code>"filter":{"logic":"and","filters":[{"field":"name","operator":"contains","value":"o"},{"field":"name","operator":"startswith","value":"w"}]} </code></pre> <p>I would need to iterate over this array and create criteria for doctrine to filter by. Every sample I've seen though shows it all happening together all at once which won't work with my scenario.</p> <p>I'm also using Symfony 3.0, so the code below creates the repository.</p> <pre><code>$repository = $this-&gt;getDoctrine()-&gt;getRepository('AppBundle:Company'); </code></pre> <p>Then I do this for the rest of the code currently.</p> <pre><code>$company_total = $repository-&gt;findAll(); $company_records = $repository-&gt;findBy(array(),$sort,$pageSize,($page-1)*$pageSize); $data["total"] = count($company_total); foreach($company_records as $company){ $temp["id"] = $company-&gt;getId(); $temp["name"] = $company-&gt;getName(); $temp["phone"] = $company-&gt;getPhone(); $temp["email"] = $company-&gt;getEmail(); $data["data"][] = $temp; } //converts data to JSON return new JsonResponse($data); </code></pre> <p>All this code is doing is returning a JSON response to the Kendo UI Grid Control so it knows what to display. I loop on company_records to create the structure I need.</p> <p>I need to apply those filters to $company_records <strong>dynamically</strong> and <strong>not statically</strong> somehow. Is this possible?</p> <p>Resources:</p> <p>Below is doing it statically in all examples</p> <p><a href="https://stackoverflow.com/questions/5349790/how-do-i-use-a-complex-criteria-inside-a-doctrine-2-entitys-repository">How do I use a complex criteria inside a doctrine 2 entity's repository?</a></p> </div>

试图将PHP表单插入SQL

<div class="post-text" itemprop="text"> <p>Some of the code in this problem can be kind of long so I will try to pinpoint where I think the problem lies. The one issue I am having is I am not sure how to tell where the code is failing. All I have is an either it loads or it doesn't. Right now it just doesn't load without any reason why.</p> <p>First I will show my form code:</p> <pre><code>function show_form($messages) { // Assign post values if exist $username=""; $password=""; $firstname=""; $lastname=""; $address=""; $city=""; $state=""; $zip=""; $phone=""; $card_number=""; $expire=""; $code=""; $product_name=""; if (isset($_POST["username"])) $username=$_POST["username"]; if (isset($_POST["password"])) $password=$_POST["password"]; if (isset($_POST["firstname"])) $firstname=$_POST["firstname"]; if (isset($_POST["lastname"])) $lastname=$_POST["lastname"]; if (isset($_POST["address"])) $address=$_POST["address"]; if (isset($_POST["city"])) $city=$_POST["city"]; if (isset($_POST["state"])) $state=$_POST["state"]; if (isset($_POST["zip"])) $zip=$_POST["zip"]; if (isset($_POST["phone"])) $phone=$_POST["phone"]; if (isset($_POST["card_number"])) $card_number=$_POST["card_number"]; if (isset($_POST["expire"])) $expire=$_POST["expire"]; if (isset($_POST["code"])) $code=$_POST["code"]; if (isset($_POST["product_name"])) $product_name=$_POST["product_name"]; echo "&lt;p&gt;&lt;/p&gt;"; echo "&lt;h2&gt; Enter New Customers Data&lt;/h2&gt;"; echo "&lt;p&gt;&lt;/p&gt;"; ?&gt; &lt;h5&gt;Complete the information in the form below and click Submit to create your account. All fields are required.&lt;/h5&gt; &lt;form name="createstudent" method="POST" action="InsertApp.php"&gt; Username:&lt;br&gt; &lt;input type="text" name="username" value=""&gt;&lt;br&gt; Last name:&lt;br&gt; &lt;input type="text" name="password" value=""&gt;&lt;br&gt; Street Address:&lt;br&gt; &lt;input type="text" name="address" value=""&gt;&lt;br&gt; First name:&lt;br&gt; &lt;input type="text" name="firstname" value=""&gt;&lt;br&gt; Last name:&lt;br&gt; &lt;input type="text" name="lastname" value=""&gt;&lt;br&gt; Street Address:&lt;br&gt; &lt;input type="text" name="address" value=""&gt;&lt;br&gt; City:&lt;br&gt; &lt;input type="text" name="city" value=""&gt;&lt;br&gt; &lt;br&gt; &lt;select name="state" size="1"&gt; &lt;option value="AK"&gt;AK&lt;/option&gt; &lt;option value="AL"&gt;AL&lt;/option&gt; &lt;option value="AR"&gt;AR&lt;/option&gt; &lt;option value="AZ"&gt;AZ&lt;/option&gt; &lt;option value="WV"&gt;WV&lt;/option&gt; &lt;option value="WY"&gt;WY&lt;/option&gt; &lt;/select&gt; &lt;br&gt; &lt;br&gt; Zipcode:&lt;br&gt; &lt;input type="text" name="zip" value=""&gt;&lt;br&gt;&lt;br&gt; &lt;input type="radio" name="credit_card" value="visa" checked&gt; Visa&lt;br&gt; &lt;input type="radio" name="credit_card" value="master"&gt; MasterCard&lt;br&gt; &lt;input type="radio" name="credit_card" value="american"&gt; American Express&lt;br&gt; &lt;input type="radio" name="credit_card" value="discover"&gt; Discover&lt;br&gt; &lt;input type="radio" name="credit_card" value="paypal"&gt; Pay Pal&lt;br&gt;&lt;br&gt; Phone Number:&lt;br&gt; &lt;input type="text" name="phone" valur""&gt;&lt;br&gt; Credit Card Number:&lt;br&gt; &lt;input type="text" name="card_number" value=""&gt;&lt;br&gt; Expiration Date (Mon/Year):&lt;br&gt; &lt;input type="text" name="expire" value=""&gt;&lt;br&gt; Security Code:&lt;br&gt; &lt;input type="text" name="code" value=""&gt;&lt;br&gt;&lt;br&gt; &lt;input type="submit" value="Submit"&gt; &lt;/form&gt; </code></pre> <p>I never had a problem with the above code I am just providing it to show you what I am working with. Next I will show you some of the code that I added which gave me problems later. I know I should of just did a small bit at a time but I screwed that up.</p> <pre><code>&lt;?php function validate_form() { $messages = array(); $redisplay = false; // Assign values $username = $_POST["username"]; $password = $_POST["password"]; $firstname = $_POST["firstname"]; $lastname = $_POST["lastname"]; $address = $_POST["address"]; $city = $_POST["state"]; $state = $_POST["state"]; $zip = $_POST["zip"]; $phone = $_POST["phone"]; $card_number = $_POST["card_number"]; $expire = $_POST["expire"]; $code = $_POST["code"]; $product_name = $_POST["product_name"]; $customer = new CustomerClass($username,$password,$firstname,$lastname,$address,$city,$state,$zip,$phone,$card_number,$expire,$code,$product_name); $count = countCostumer($customer); // Check for accounts that already exist and Do insert if ($count==0) { $res = insertCustomer($customer); echo "&lt;h3&gt;Thank you for shopping with us!&lt;/h3&gt; "; } else { echo "&lt;h3&gt;A customer account with that username already exists.&lt;/h3&gt; "; } } function countCustomer ($customer) { // Connect to the database $mysqli = connectdb(); $firstname = $customer-&gt;getFirstname(); $lastname = $customer-&gt;getLastname(); $username = $-&gt;getUsername(); // Connect to the database $mysqli = connectdb(); // Define the Query // For Windows MYSQL String is case insensitive $Myquery = "SELECT count(*) as count from Customer where username='$username'"; if ($result = $mysqli-&gt;query($Myquery)) { /* Fetch the results of the query */ while( $row = $result-&gt;fetch_assoc() ) { $count=$row["count"]; } /* Destroy the result set and free the memory used for it */ $result-&gt;close(); } $mysqli-&gt;close(); return $count; } function insertCustomer ($customer) { // Connect to the database $mysqli = connectdb(); $firstname = $customer-&gt;getFirstname(); $lastname = $customer-&gt;getLastname(); $username = $-&gt;getUsername(); // Add Prepared Statement $Query = "INSERT INTO Customer (username,password,firstName,lastName,address,city,state,zip,phone,card_number,expire,code,product_name) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"; $stmt = $mysqli-&gt;prepare($Query); $stmt-&gt;bind_param("sssssssiiiiis", $username, $password, $firstname, $lastname, $city, $state, $zip, $phone, $card_number, $expire, $code, $product_name); $stmt-&gt;execute(); $stmt-&gt;close(); $mysqli-&gt;close(); return true; } </code></pre> <p>I know this is a lot of code to put out there for help but I have no way of finding a way to pinpoint the error. If anyone knows of anywhere I can put this code that will display errors that may help. I tried using W3C Validation. However, it told me I could not use it on nonpublic domains.</p> <p>Here is some more of the code:</p> <pre><code>class StudentClass { // property declaration private $username=""; private $password=""; private $firstname=""; private $lastname=""; private $address=""; private $city=""; private $state=""; private $zip=""; private $phone=""; private $card_number=""; private $expire=""; private $code=""; private $product_name=""; // Constructor public function __construct($username,$password,$firstname,$lastname,$address,$city,$state,$zip,$phone,$card_number,$expire,$code,$product_name) { $this-&gt;username = $username; $this-&gt;password = $password; $this-&gt;firstname = $firstname; $this-&gt;lastname = $lastname; $this-&gt;address = $address; $this-&gt;city = $city; $this-&gt;state = $state; $this-&gt;zip = $zip; $this-&gt;phone = $phone; $this-&gt;card_number = $card_number; $this-&gt;expire = $expire; $this-&gt;code = $code; $this-&gt;product_name = $product_name; } // Get methods public function getUsername () { return $this-&gt;username; } public function getPassword () { return $this-&gt;password; } public function getFirstname () { return $this-&gt;firstname; } public function getLastname () { return $this-&gt;lastname; } public function getAddress () { return $this-&gt;address; } public function getCity () { return $this-&gt;city; } public function getState () { return $this-&gt;state; } public function getZip () { return $this-&gt;zip; } public function getPhone () { return $this-&gt;phone; } public function getCardNumber () { return $this-&gt;card_number; } public function getExpire () { return $this-&gt;expire; } public function getCode () { return $this-&gt;code; } public function getProductName () { return $this-&gt;product_name; } // Set methods public function setusername ($value) { $this-&gt;username = $value; } public function setPassword ($value) { $this-&gt;password = $value; } public function setFirstname ($value) { $this-&gt;firstname = $value; } public function setLastname ($value) { $this-&gt;lastname = $value; } public function setAddress ($value) { $this-&gt;address = $value; } public function setCity ($value) { $this-&gt;city = $value; } public function setState ($value) { $this-&gt;state = $value; } public function setZip ($value) { $this-&gt;zip = $value; } public function setPhone ($value) { $this-&gt;phone = $value; } public function setCardNumber ($value) { $this-&gt;card_number = $value; } public function setExpire ($value) { $this-&gt;Expire = $value; } public function setCode ($value) { $this-&gt;code = $value; } public function setProductName ($value) { $this-&gt;product_name = $value; } } // End Studentclass ?&gt; </code></pre> <p>Any help or insight would be appreciated. Thanks</p> </div>

android 实现excel的导出,没有报错,但在目标文件下,找不到应该导出的表

//导出 private void exportDataToExcel() { ExportThread eThread = new ExportThread(this, excelFileName, new OnExcelReadWriteSuccess() { @Override public void onError(Exception e) { } @Override public void onReadSuccess(ArrayList<SmsData> readList) { } @Override public void onWriteSuccess() { String exportpath=Environment.getExternalStorageDirectory().getAbsolutePath()+File.separator+"tongxunlu.xls"; try{ WritableWorkbook wb= Workbook.createWorkbook(new File(exportpath)); WritableSheet ws=wb.createSheet("sheet",0); Label label=new Label(0,0,"name"); Label label2=new Label(1,0,"phone"); Label label3=new Label(2,0,"msg"); Label label4=new Label(3,0,"issend"); ws.addCell(label); ws.addCell(label2); ws.addCell(label3); ws.addCell(label4); for(int i=1;i<lists.size()+1;i++){ ws.addCell(new Label( 0,i,lists.get(i-1).getName())); ws.addCell(new Label(1,i,lists.get(i-1).getPhone())); ws.addCell(new Label(2,i,lists.get(i-1).getSms())); if(lists.get(i-1).isSent()){ ws.addCell(new Label(3,i,"1")); }else { ws.addCell(new Label(3,i,"0")); } } wb.write(); wb.close(); Toast.makeText(MainActivity.this,"导出成功"+exportpath,Toast.LENGTH_SHORT).show(); } catch (Exception e) { e.printStackTrace(); } } }); }

关于@OneToOne

[size=large]User表[/size] @Entity @Table(name = "user") public class User implements Serializable { private static final long serialVersionUID = 6460630554415231725L; public User() { } private Integer userId; private String userName; private String password; private Integer authority; private Integer employeeId; private Employee employee; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer getUserId() { return userId; } public void setUserId(Integer userId) { this.userId = userId; } @Column(length = 15) public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } @Column(length = 15) public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public void setAuthority(Integer authority) { this.authority = authority; } @Column(length = 1) public Integer getAuthority() { return authority; } public void setEmployeeId(Integer employeeId) { this.employeeId = employeeId; } public Integer getEmployeeId() { return employeeId; } public void setEmployee(Employee employee) { this.employee = employee; } [color=red] [b]@OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "employeeid") public Employee getEmployee() { return employee; }[/b][/color] } [size=large]Employee表[/size] @Entity @Table(name = "employee") public class Employee implements Serializable { /** * */ private static final long serialVersionUID = 984272591543594665L; private Integer employeeId; private String employeeName; private String sex; private Integer age; private String address; private Integer deptId; public Integer getDeptId() { return deptId; } public void setDeptId(Integer deptId) { this.deptId = deptId; } public Integer getFilialeId() { return filialeId; } public void setFilialeId(Integer filialeId) { this.filialeId = filialeId; } public Integer getPositionId() { return positionId; } public void setPositionId(Integer positionId) { this.positionId = positionId; } private Integer filialeId; private Integer positionId; private String phone; private String email; private String remark; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer getEmployeeId() { return employeeId; } public void setEmployeeId(Integer employeeId) { this.employeeId = employeeId; } @Column(length = 20) public String getEmployeeName() { return employeeName; } public void setEmployeeName(String employeeName) { this.employeeName = employeeName; } @Column(length = 2) public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } @Column(length = 3) public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } @Column(length = 20) public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } @Column(length = 30) public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } 然后我设了hibernate自动建表,@JoinColu(name="[color=red]employeeId[/color]")就报 org.hibernate.MappingException: Repeated column in mapping for entity: com.st.po.User column: employeeId (should be mapped with insert="false" update="false") 然后我把employeeid中的[color=red]I[/color]改成小写,@JoinColu(name="[color=red]employeeid[/color]"),又建表成功了,求解!!!!!

在fragment中的listView问题

在fragment中显示一个自定义listView,但是运行后什么也没显示。 public class Tab1 extends Fragment implements ListView.OnItemClickListener{ private ArrayList<Custom> fetch = new ArrayList<Custom>(); private ContactsAdapter adapter; private ListView lv; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saveInstanceState){ View v = inflater.inflate(R.layout.tab_layout, container, false); Custom one = new Custom("Hoang Ha", "01672286349"); Custom two = new Custom("Ha Link", "03203590176"); fetch.add(one); fetch.add(two); lv =(ListView)v.findViewById(R.id.list); adapter = new ContactsAdapter(getActivity(), fetch); lv.setAdapter(adapter); lv.setOnItemClickListener(this); return v; } public class Custom{ private String contactName; private String contactPhone; public Custom(String st1, String st2){ contactName = st1; contactPhone = st2; } public String getName(){ return contactName; } public String getPhone(){ return contactPhone; } public void setName(String st1){ contactName = st1; } public void setPhone(String st2){ contactPhone = st2; } } @Override public void onItemClick(AdapterView<?> ad, View v, int position, long id) { // TODO Auto-generated method stub } private class ContactsAdapter extends BaseAdapter{ private FragmentActivity activity; private LayoutInflater inflater; private ArrayList<Custom> data; public ContactsAdapter (FragmentActivity a, ArrayList<Custom> d){ activity = a; data = d; inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public int getCount() { // TODO Auto-generated method stub data.size(); return 0; } @Override public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View v = convertView; v = inflater.inflate(R.layout.list_row, null); TextView contact_name = (TextView)v.findViewById(R.id.contact_name); TextView phone_number = (TextView)v.findViewById(R.id.phone_number); //final Custom custom = entries.get(position); final Custom custom = data.get(position); contact_name.setText(custom.getName()); phone_number.setText(custom.getPhone()); return v; } } } 这是列表xml代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/light_dark" android:padding="5dip" > <TextView android:id="@+id/contact_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:textColor="@color/white" android:typeface="sans" android:textSize="@dimen/font_medium" android:textStyle="bold"/> <TextView android:id="@+id/phone_number" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:textColor="@color/white" android:typeface="sans" android:textSize="@dimen/font_small" /> </LinearLayout>

Symfony 2编辑操作不填充表单域

<div class="post-text" itemprop="text"> <p>I'm attempting to create an edit action for a user address entity but whenever you load the page it doesn't seem to load the associated data. below is the code for my controller and view.</p> <p>Profile Controller:</p> <pre><code>public function addressEditAction($id) { $user = $this-&gt;getUser(); if (!is_object($user) || $user instanceof UserInterface) { throw new AccessDeniedException('This user does not have access to this section.'); } if ($this-&gt;container-&gt;get('security.context')-&gt;isGranted('IS_AUTHENTICATED_FULLY')) { $em = $this-&gt;getDoctrine()-&gt;getEntityManager(); $address = $em-&gt;getRepository('SCWDesignsBundle:UserAddresses')-&gt;getAddressById($user-&gt;getId(), $id); if (!$address) { throw new NotFoundHttpException(sprintf('Could not find address id: "%s"', $id)); } $form = $this-&gt;createForm(new UserAddressesFormType(), $address); $request = $this-&gt;getRequest(); if ($request-&gt;getMethod() == 'POST') { $form-&gt;bind($request); if ($form-&gt;isValid()) { $utilites = new Utilities; $address-&gt;setPhone($utilites-&gt;stripPhoneNumbers($address-&gt;getPhone())); $em-&gt;persist($address); $em-&gt;flush(); return $this-&gt;redirect($this-&gt;generateUrl('fos_user_profile_show')); } } } return $this-&gt;render('SCWDesignsBundle:Profile\Address:new.html.twig', array( 'active_page' =&gt; 'profile', 'form' =&gt; $form-&gt;createView() )); } </code></pre> <p>View:</p> <pre><code>{% trans_default_domain 'SCWDesignsBundle' %} {% block modal_block %} &lt;div class="item-box"&gt; &lt;h2&gt;Address Details&lt;/h2&gt; {% include 'SCWDesignsBundle:Default:form_errors.html.twig' %} &lt;form action="{{ path('scw_designs_address_add') }}" {{ form_enctype(form) }} method="POST" class="scw_designs_address_new clearfix"&gt; &lt;div class="address-new"&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="first-name"&gt;{{ 'profile.first_name'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.first_name) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="last-name"&gt;{{ 'profile.last_name'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.last_name) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="address"&gt;{{ 'profile.address'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.address_one) }} {{ form_widget(form.address_two) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="city"&gt;{{ 'profile.city'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.city) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="country"&gt;{{ 'profile.country'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.country) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="state"&gt;{{ 'profile.state'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.state) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="zipcode"&gt;{{ 'profile.zipcode'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.zipcode, { 'attr': { 'class': 'zipcodeUS' }}) }} &lt;/div&gt; &lt;/div&gt; &lt;div class="form-item"&gt; &lt;div class="form-label"&gt; &lt;label for="phone"&gt;{{ 'profile.phone'|trans }}: &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;/div&gt; &lt;div class="form-field"&gt; {{ form_widget(form.phone, { 'attr': { 'class': 'phoneUS' }}) }} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="modal-button-wrapper"&gt; {{ form_widget(form._token) }} &lt;button type="submit" class="btn-submit primary-button"&gt;Save Changes&lt;/button&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; {% endblock %} </code></pre> <p>In the profilecontroller you can see me call a method from the entities respository, here's the var_dump of the array $address:</p> <p>$address:</p> <pre><code>array (size=1) 0 =&gt; array (size=11) 'id' =&gt; string '4' (length=1) 'firstName' =&gt; string 'Bruce' (length=5) 'lastName' =&gt; string 'Wayne' (length=5) 'addressOne' =&gt; string '123 Gotham Lane' (length=15) 'addressTwo' =&gt; null 'city' =&gt; string 'Gotham' (length=6) 'country' =&gt; string 'USA' (length=3) 'zipcode' =&gt; string '51478' (length=5) 'phone' =&gt; string '3344796239' (length=10) 'code' =&gt; string 'NH' (length=2) 'state' =&gt; string 'New Hampshire' (length=13) </code></pre> <p>So as you can see I've gotten the proper data from the database, I've followed the instructions on binding the data to the form object, it just simply doesn't persist into the view. I've tried multiple things but can't seem to get it working. Any advice/help would be greatly appreciated.</p> <p>Thanks,</p> <p>Shawn</p> </div>

JSP用JAVABEAN传整型值时,如果数值为一位,接收到的值为0,两位以上的值正常。

现象如题,环境为MYECLIPSE和TOMCAT6,代码如下: 提交数据的文件department_add.jsp: <%@ page contentType="text/html" pageEncoding = "GBK"%> <%@ page import="com.lb.teashop.factory.*,com.lb.teashop.vo.*"%> <jsp:useBean id="department" scope="request" class="com.lb.teashop.vo.DepartmentBean"/> <html> <head><title>连锁店信息维护</title></head> <script type="text/javascript" src="../js/set_editable.js"></script> <% request.setCharacterEncoding("GBK"); //解决中文乱码问题 %> <body> <h3>添加连锁店</h3> <% String id = request.getParameter("id"); if(!(null == id || "".equals(id))){ //指定code时,显示对应信息 try{ DepartmentBean dpt=DAOFactory.getDepartmentDAOInstance().findDepartmentById(Integer.parseInt(id)); //out.println("dgc_code:" + dpt.getName()); department = dpt; //out.println("department_id:" + department.getId()); %> <form action="department_update_do.jsp" method="post"> <table> <tr> <td>店名:</td> <td> <input type="text" id="id_edit" name="id" value="<%=department.getId()%>" readonly> </td> <td> <input type="text" id="name_edit" name="name" value="<%=department.getName() %>" readonly> </td> </tr> <tr> <td>地址:</td> <td> <textarea id="address_edit" name="address" rows="6" cols="40" readonly><%=department.getAddress()%></textarea> <br><%=department.getErrorMsg("errAddress")%> </td> </tr> <tr> <td>电话:</td> <td> <input type="text" id="phone_edit" name="phone" readonly value="<%=department.getPhone()%>"> <%=department.getErrorMsg("errPhone")%> </td> </tr> <tr> <td>传真:</td> <td> <input id="fax_edit" name="fax" readonly value="<%=department.getFax()%>"> <%=department.getErrorMsg("errFax")%> </td> </tr> <tr> <td>测试号:</td> <td> <input id="apply_page_sn_edit" name="apply_page_sn" readonly value="<%=department.getApply_page_sn()%>"> <%=department.getErrorMsg("errApply_page_sn")%> </td> </tr> <tr> <td><input type="button" value="修改" onclick="set_editable();"></td> <td><input type="submit" value="提交"></td> </tr> </table> </form> <% }catch(Exception e){ e.printStackTrace(); } }else{ //未指定code时,显示空白录入界面。 %> <form action="department_add_do.jsp" method="post"> <table> <tr> <td>连锁店名称:</td> <td> <input type="text" name="name" > <%=department.getErrorMsg("errName")%> </td> </tr> <tr> <td>拼音码:</td> <td> <input type="text" name="py_code" ></input> <br><%=department.getErrorMsg("errPy_code")%> </td> </tr> <tr> <td>地址:</td> <td> <textarea id="address" name="address" rows="6" cols="40"></textarea> <br><%=department.getErrorMsg("errPy_code")%> </td> </tr> <tr> <td>电话:</td> <td> <input type="text" name="phone"></input> <br><%=department.getErrorMsg("errPhone")%> </td> </tr> <tr> <td>传真:</td> <td> <input type="text" name="fax" ></input> <br><%=department.getErrorMsg("errFax")%> </td> </tr> <tr> <td><input type="submit" value="添加"></td> <td><input type="reset" value="重置"></td> </tr> </table> </form> <% } %> </body> </html> JAVABEAN文件DepartmentBean.java: /** * */ package com.lb.teashop.vo; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * @author Administrator * */ public class DepartmentBean implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private int id; private String name; private String py_code; private String address; private String phone; private String fax; private int apply_page_sn; private int page_sn; private Map<String,String>errors=null; //声明一个保存全部错误信息的Map集合 public DepartmentBean(){ //this.code=""; this.name=""; this.py_code=""; this.errors = new HashMap<String,String>(); //实例化Map对象,保存错误信息 } public boolean isValidate(){ //数据验证操作 boolean flag = true; // //System.out.println(this.name); // //System.out.println(this.comment); // if(this.name==null || "".equals(this.name)){ // flag = false; // //System.out.print(this.name); // errors.put("errName", "请输入商品类别名称。"); //保存错误信息 // } // if(this.py_code==null || "".equals(this.py_code)){ // flag = false; // errors.put("errComment", "请输入规格描述,长度不超过150个汉字。"); // }else if(this.py_code.length()>15){ // flag = false; // //System.out.println(this.specification.length()); // errors.put("errComment", "规格描述是不超过150个字的中文。"); // } return flag; } public String getErrorMsg(String key){ String value = this.errors.get(key); return value == null?"":value; //返回value对应的内容 } /** * @return the id */ public int getId() { return id; } /** * @param id the id to set */ public void setId(int id) { this.id = id; } /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the py_code */ public String getPy_code() { return py_code; } /** * @param py_code the py_code to set */ public void setPy_code(String py_code) { this.py_code = py_code; } /** * @return the address */ public String getAddress() { return address; } /** * @param address the address to set */ public void setAddress(String address) { this.address = address; } /** * @return the phone */ public String getPhone() { return phone; } /** * @param phone the phone to set */ public void setPhone(String phone) { this.phone = phone; } /** * @return the fax */ public String getFax() { return fax; } /** * @param fax the fax to set */ public void setFax(String fax) { this.fax = fax; } /** * @return the apply_page_sn */ public int getApply_page_sn() { return apply_page_sn; } /** * @param apply_page_sn the apply_page_sn to set */ public void setApply_page_sn(int apply_page_sn) { this.apply_page_sn = apply_page_sn; } /** * @return the page_sn */ public int getPage_no() { return page_sn; } /** * @param page_sn the page_sn to set */ public void setPage_no(int page_sn) { this.page_sn = page_sn; } } 接收数据的文件department_update_do.jsp: <%@ page contentType="text/html" pageEncoding = "GBK"%> <%@ page import="com.lb.teashop.factory.*" %> <jsp:useBean id="department" scope="request" class="com.lb.teashop.vo.DepartmentBean"></jsp:useBean> <jsp:setProperty name = "department" property="*"></jsp:setProperty> <html> <head><title>连锁店信息维护</title></head> <% request.setCharacterEncoding("GBK"); //解决中文乱码问题 %> <head><title>添加连锁店</title></head> <body> <%=department.getId() %><br> <%=department.getName() %><br> <%=department.getAddress() %><br> <%=department.getPhone() %><br> <%=department.getFax() %><br> <%=department.getApply_page_sn() %><br> <% if(department.isValidate()){ try{ if(DAOFactory.getDepartmentDAOInstance().doUpdateDepartment(department)>0 ){ %> <h3>商品信息修改成功!</h3> <% response.setHeader("refresh","2;URL=department_list.jsp"); }else{ %> <h3>商品信息修改失败!</h3> <% response.setHeader("refresh","2;URL=department_add.jsp?id="+department.getId()); } }catch(Exception e){ e.printStackTrace(); //在Tomcat后台打印 } }else{ %> <jsp:forward page="department_add.jsp?id=<%=department.getId() %>"></jsp:forward> <% //response.setHeader("refresh","2;URL=department_add.jsp"); } %> </body> </html> 全部的整型变量如果小于10,接收文件看到的都为0,大于等于10的都没问题。求大牛指点迷津!非常感谢!

Symfony 3.4 - 返回数组JsonResponse

<div class="post-text" itemprop="text"> <p>My question is simple I want to return an array for an api rest in json (with JsonResponse) : </p> <p>I give you an exemple of what I started to do : </p> <p>My json response : </p> <pre><code>{ "success": "true", "message": "Liste du Profil", "id": 54, "username": "TestTest7", "phone": null, "email": "noemail@gmail.com", "resume": "TestTest7", "language": null, "friends_added": [ { "id_friend": {} } ], "friends_accepted": [], "friends_added_need_to_be_accept": [ { "id_friend": {} } ], "friends_need_to_be_accept": [] } </code></pre> <p>As you can see, that's not what I want because the fields are empty : <code>id_friend</code> as content in database <code>friends_added_need_to_be_accept</code> too but the 2 others have empty database.</p> <p>My controller : </p> <pre><code>/** * * @Rest\Post( * path = "/profile/list", * name = "api_profile_list" * ) * @Rest\View(StatusCode=201, serializerGroups={"user_detail"}) */ public function ProfileListAction(Request $request) { $em = $this-&gt;getDoctrine()-&gt;getManager(); $user = $em-&gt;getRepository('AppBundle:User')-&gt;findOneBy(array('id' =&gt; ($request-&gt;get('id_user')))); $token = $request-&gt;get('token'); if (!isset($user)) { return new JsonResponse([ 'success' =&gt; "false", 'message' =&gt; "Utilisateur non renseigné" ]); } if (!isset($token)) { return new JsonResponse([ 'success' =&gt; "false", 'message' =&gt; "Token non renseigné" ]); } if ($user-&gt;getToken() != $token) { return new JsonResponse([ 'success' =&gt; "false", 'message' =&gt; "Mauvais token", ]); } $profile = $user-&gt;getIdProfile(); $profile = $em-&gt;getRepository('AppBundle:Profile')-&gt;findOneBy(array('id' =&gt; ($profile))); $friend_3 = $em-&gt;getRepository('AppBundle:Friend')-&gt;findBy(array( 'user_one' =&gt; ($user-&gt;getId()), 'enabled' =&gt; 1 )); $friend_4 = $em-&gt;getRepository('AppBundle:Friend')-&gt;findBy(array( 'user_two' =&gt; ($user-&gt;getId()), 'enabled' =&gt; 1 )); $friend_1 = $em-&gt;getRepository('AppBundle:Friend')-&gt;findBy(array( 'user_one' =&gt; ($user-&gt;getId()), 'enabled' =&gt; 2 )); $friend_2 = $em-&gt;getRepository('AppBundle:Friend')-&gt;findBy(array( 'user_two' =&gt; ($user-&gt;getid()), 'enabled' =&gt; 2 )); if (!isset($friend_1) and !isset($friend_2)) { return new JsonResponse([ 'success' =&gt; "true", 'message' =&gt; "Liste du Profil", 'id' =&gt; $user-&gt;getId(), 'username' =&gt; $user-&gt;getUsername(), 'phone' =&gt; $profile-&gt;getPhone(), 'email' =&gt; $profile-&gt;getEmail(), 'resume' =&gt; $profile-&gt;getResume(), 'language' =&gt; $profile-&gt;getLanguage(), ]); } $arrayCollection_1 = array(); $arrayCollection_2 = array(); $arrayCollection_3 = array(); $arrayCollection_4 = array(); foreach($friend_1 as $friends_1) { $arrayCollection_1[] = array( 'id_friend' =&gt; $friends_1-&gt;getUserOne(), ); } foreach($friend_2 as $friends_2) { $arrayCollection_2[] = array( 'id_friend' =&gt; $friends_2-&gt;getUserOne(), ); } foreach($friend_3 as $friends_3) { $arrayCollection_3[] = array( 'id_friend' =&gt; $friends_3-&gt;getUserOne(), ); } foreach($friend_4 as $friends_4) { $arrayCollection_4[] = array( 'id_friend' =&gt; $friends_4-&gt;getUserOne(), ); } return new JsonResponse([ 'success' =&gt; "true", 'message' =&gt; "Liste du Profil", 'id' =&gt; $user-&gt;getId(), 'username' =&gt; $user-&gt;getUsername(), 'phone' =&gt; $profile-&gt;getPhone(), 'email' =&gt; $profile-&gt;getEmail(), 'resume' =&gt; $profile-&gt;getResume(), 'language' =&gt; $profile-&gt;getLanguage(), 'friends_added' =&gt; $arrayCollection_1, 'friends_accepted' =&gt; $arrayCollection_2, 'friends_added_need_to_be_accept' =&gt; $arrayCollection_3, 'friends_need_to_be_accept' =&gt; $arrayCollection_4, ]); } </code></pre> <p>My profile entity : </p> <pre><code>class Profile { /** * @var integer * * @ORM\Column(name="id", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") * @ORM\OneToOne(targetEntity="User", inversedBy="Profile") */ protected $id; /** * @var string * * @ORM\Column(name="resume", type="text", length=65535, nullable=true) */ protected $resume; /** * @var string * * @Assert\Image() * @ORM\Column(name="avatar_path", type="string", length=255, nullable=true) */ protected $avatarPath; /** * @var \DateTime * * @ORM\Column(name="last_connexion", type="datetime", nullable=false) */ protected $lastConnexion; /** * @var \DateTime * * @ORM\Column(name="birth", type="datetime", nullable=false) */ protected $birth; /** * @var string * * @ORM\Column(name="email", type="string", length=255, nullable=false, unique=true) */ protected $email; /** * @var integer * * @ORM\Column(name="level", type="integer", nullable=false) */ protected $level = '1'; /** * @var string * * @ORM\Column(name="phone", type="string", length=60, nullable=true, unique=true) * @Assert\Regex( * pattern="/(0|\+)[1-9]([-. ]?[0-9]{2}){4}/", * message="You need to put a french number ! Starting with 0 or +33 !", * ) */ protected $phone; /** * @var string * * @ORM\Column(name="language", type="text", length=65535, nullable=true) */ protected $language; /** * @var boolean * * @ORM\Column(name="is_male", type="boolean", nullable=false) */ protected $isMale = '1'; /** * @var \DateTime * * @ORM\Column(name="created_account", type="datetime", nullable=false) */ protected $createdAccount = 'CURRENT_TIMESTAMP'; /** * @return int */ public function getId() { return $this-&gt;id; } /** * @param int $id */ public function setId($id) { $this-&gt;id = $id; } /** * @return string */ public function getResume() { return $this-&gt;resume; } /** * @param string $resume */ public function setResume($resume) { $this-&gt;resume = $resume; } /** * @return string */ public function getAvatarPath() { return $this-&gt;avatarPath; } /** * @param string|null */ public function setAvatarPath($avatarPath) { $this-&gt;avatarPath = $avatarPath; } /** * @return \DateTime */ public function getLastConnexion() { return $this-&gt;lastConnexion; } /** * @param \DateTime $lastConnexion */ public function setLastConnexion(\DateTime $lastConnexion) { $this-&gt;lastConnexion = $lastConnexion; } /** * @return \DateTime */ public function getBirth() { return $this-&gt;birth; } /** * @param \DateTime $birth */ public function setBirth(\DateTime $birth) { $this-&gt;birth = $birth; } /** * @return string */ public function getEmail() { return $this-&gt;email; } /** * @param string $email */ public function setEmail($email) { $this-&gt;email = $email; } /** * @return int */ public function getLevel() { return $this-&gt;level; } /** * @param int $level */ public function setLevel($level) { $this-&gt;level = $level; } /** * @return string */ public function getPhone() { return $this-&gt;phone; } /** * @param string|null */ public function setPhone($phone) { $this-&gt;phone = $phone; } /** * @return string */ public function getLanguage() { return $this-&gt;language; } /** * @param string $language */ public function setLanguage($language) { $this-&gt;language = $language; } /** * @return \DateTime */ public function getCreatedAccount() { return $this-&gt;createdAccount; } /** * @param \DateTime $createdAccount */ public function setCreatedAccount(\DateTime $createdAccount) { $this-&gt;createdAccount = $createdAccount; } /** * @return bool */ public function isMale() { return $this-&gt;isMale; } /** * @param bool $isMale */ public function setIsMale($isMale) { $this-&gt;isMale = $isMale; } } </code></pre> <p>and my friend entity : </p> <pre><code>class Friend { /** * @var integer * * @ORM\Column(name="id", type="integer", nullable=false) * @ORM\Id() * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** * @var \AppBundle\Entity\User * * @ORM\GeneratedValue(strategy="NONE") * @ORM\ManyToOne(targetEntity="User") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="user_id_one", referencedColumnName="id") * }) */ protected $user_one; /** * @var \AppBundle\Entity\User * * @ORM\GeneratedValue(strategy="NONE") * @ORM\ManyToOne(targetEntity="User") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="user_id_two", referencedColumnName="id") * }) */ protected $user_two; /** * @var integer * * @ORM\Column(name="enabled", type="integer", nullable=false) */ private $enabled; /** * @return int */ public function getEnabled() { return $this-&gt;enabled; } /** * @param int $enabled */ public function setEnabled($enabled) { $this-&gt;enabled = $enabled; } /** * @return User */ public function getUserTwo() { return $this-&gt;user_two; } /** * @param User $user_two */ public function setUserTwo($user_two) { $this-&gt;user_two = $user_two; } /** * @return User */ public function getUserOne() { return $this-&gt;user_one; } /** * @param User $user_one */ public function setUserOne($user_one) { $this-&gt;user_one = $user_one; } /** * @return int */ public function getId() { return $this-&gt;id; } /** * @param int $id */ public function setId($id) { $this-&gt;id = $id; } } </code></pre> <p>I am 100% sure that my entities are good and that the error come when I want to fill the array.</p> <p>Look when I do : </p> <pre><code>foreach($friend_1 as $friends_1) { $arrayCollection_1[] = array( 'id_friend' =&gt; 4, ); } </code></pre> <p>That return me : </p> <pre><code>{ "success": "true", "message": "Liste du Profil", "id": 54, "username": "TestTest7", "phone": null, "email": "noemail@gmail.com", "resume": "TestTest7", "language": null, "friends_added": [ { "id_friend": 4 } ], "friends_accepted": [], "friends_added_need_to_be_accept": [], "friends_need_to_be_accept": [] } </code></pre> <p>Thx for anyone who will try to answer and ask if you want more detail of something that I could forget !</p> </div>

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

实现简单的文件系统

实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简

MIPS单周期CPU-组成原理实验-华中科技大学

使用logisim布线完成的MIPS单周期CPU,可支持28条指令。跑马灯的代码已经装入了寄存器,可以直接开启时钟运行。

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

基于QT和OpenCV的五子棋实现源码

一个简单的五子棋应用,基于QT和OpenCV的实现源码,通过相邻棋子判断是否获胜,不包含人工智能算法,适合新手入门

Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

JAVA初级工程师面试36问(完结)

第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

智鼎(附答案).zip

并不是完整题库,但是有智鼎在线2019年9、10、11三个月的试题,有十七套以上题目,普通的网申行测题足以对付,可以在做题时自己总结一些规律,都不是很难

Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

JavaWEB商城项目(包括数据库)

功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

一学即懂的计算机视觉(第一季)

图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

相关热词 c#中如何设置提交按钮 c#帮助怎么用 c# 读取合并单元格的值 c#带阻程序 c# 替换span内容 c# rpc c#控制台点阵字输出 c#do while循环 c#调用dll多线程 c#找出两个集合不同的
立即提问