前面测试f的时候,不是吧userId 的访问权限改成public了吗? 为什么测试felds 的时候输出fields.lengrh的时候输出0个? 不应该是一个吗?
打印出来没有结果是什么情况
shells[i] = new Shell(); 为什么数组 后面直接new Shell类, 是 Shell 类型的 shells数组 直接实例化? 把 Shell() 在内存中的地址 给 shell[i]?
session.setAttribute("key",value)
将数据存储到HttpSession对象中
Object value = session.getAttribute("key")
根据key获取HttpSession中的数据,返回Object
Enumeration attributeNames = session.getAttributeNames()
获取HttpSession中所有的key,返回枚举类型
session.removeAttribute("key")
根据key删除HttpSession中的数据
String id = session.getId()
根据获取当前HttpSession的SessionID,返回字符串类型
提交表单按钮如何和表单的提交关联起来的,从代码中完全没看出来啊
老师,我搜索那个网址出现了这个,在这里没找到下载,是在这里找吗
(1)代码可以写成a=a++吗?
(2)代码可以写成b=a+b吗?
(3)是不是算术运算符得到的结果变量可以是操作数本身或者其他变量?
reactV6版本不用this.props.match.params.id,我百度搜了好多看着有点乱,最后运行出来了。老师可以帮我看一下这样写可以吗?
老师,如何快捷地打出一个英文的括号()呢
// 定义比较规则 // 正数:大,负数:小,0:相等 @Override public int compareTo(Users o) { if(this.uesrage>o.getUesrage()){ return 1; // (由小到大) } if(this.uesrage == o.getUesrage()){ return this.username.compareTo(o.getUsername()); } return -1; }
老师,在这里重写Users类中的compareTo方法中,第二个return中的o.getUsername() 和o.Username有什么区别
它的意思就是a对象不变,重新生成了另外一个不同的对象,是这样吗?
这个里面提示没有方法,这个方法应该在那里创建呢?
package com.bjsxt.config.shiro; import com.bjsxt.domain.User; import com.bjsxt.service.UserService; import com.bjsxt.vo.ActiverUser; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.authz.SimpleAuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.util.ByteSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; /** * @Author: GHP * 自定义 realm 去匹配用户名和密码 */ public class UserRealm extends AuthorizingRealm { @Autowired @Lazy private UserService userService; @Override public String getName() { return this.getClass().getSimpleName(); } /** * 做认证 --就是登陆 * @param token * @return 45 * @throws AuthenticationException */ @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { //得到用户登陆名 String phone=token.getPrincipal().toString(); //根据电话查询用户是否存在 User user = userService.queryUserByPhone(phone); if(null!=user){//说明用户存在,但是密码可能不正确 //组装存放到 reids 里面的对象 ActiverUser activerUser=new ActiverUser(); activerUser.setUser(user); //匹配密码 SimpleAuthenticationInfo info=new SimpleAuthenticationInfo( activerUser,user.getPassword(), ByteSource.Util.bytes(user.getSalt()),this.getName() ); return info; }else{ return null;//代表用户不存在 } } /** * 做授权 --登陆成功之后判断用户是否有某个菜单或按钮的权限 * @param principals * @return */ @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { ActiverUser activerUser= (ActiverUser) principals.getPrimaryPrincipal();//身份得到的就是上一个方法的返回值的值 第一个参数 activerUser SimpleAuthorizationInfo info=new SimpleAuthorizationInfo(); return info; } }
老师我改utf-8的界面和老师的不一样,这样该怎么办
from threading import Thread from queue import Queue #导入队列,保证数据安全 from time import sleep #生产者 def producer(): num = 1 while True: print(f'生产了{num}号加菲猫') mq.put("第{}号加菲猫".format(num)) num += 1 sleep(1) #消费者 def cousmer(): while True: print("购买了{}".format(mq.get())) sleep(2) if __name__=="__main__": #创建一个共享容器 mq = Queue() #创建线程 t1 = Thread(target=producer) t2 = Thread(target=cousmer) #t3 = Thread(target=cousmer) #开启线程 t1.start() t2.start() #t3.start()
老师,为什么我的生产1号和2号是生产就购买呢?从3号开始才是两个生产一个购买?
老师,对于服务端的主函数的代码这样子写可不可以呢
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637