视频中在pojo类中已经写了tostring方法,是不是在控制器中就不用在写tostring,会自动调用
public ModelAndView addUsers5(Users user){ ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("/index.jsp"); modelAndView.addObject("user",user.toString()); modelAndView.addObject("address",user.getAddress().toString()); return modelAndView; }
老师,在IDE中启动Tomcat时输出的这个html在哪里?
分享一下我学习JVM的笔记:https://blog.csdn.net/weixin_43246215/article/details/108989559
分享一下我整理的Docker知识点笔记:https://blog.csdn.net/weixin_43246215/article/details/108934216
老师,Jinja2过滤器文档里面的format有点问题
文档:
{{ "%s" - "%s"|format('Hello?',"Foo!") }}将输出:Helloo? - Foo!
我发现会报错
实际上应该是
{{ "%s - %s"|format('Hello?',"Foo!") }}将输出:Helloo? - Foo!
是pycharm版本问题吗?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> *{ margin: 0; padding: 0; } ul{ background-color: #eaffea; list-style: none; font-size: 14px; width: 150px; display: block; position: relative; cursor: pointer; /*把鼠标变成小手*/ display: none; z-index: 999; } li{ padding-left: 20px; line-height: 25px; } li:hover{ background-color: #fffdef; } </style> </head> <body> <ul> <li>查看网页源代码</li> <li>刷新网页(F5)</li> <li>离开网页</li> <li>跳转到百度</li> <li>根据文本框内容搜索</li> <li>输入内容搜索</li> </ul> <div style="margin: 20px auto;width: 500px;position: relative"> <span>搜索内容:</span><input type="text" style="width: 300px;"> </div> <script> window.onload=function(){ var ul=document.querySelector('ul'); //系统右键菜单禁用事件【contextmenu】 document.oncontextmenu = function (eve) { return false; };//return false表示事件禁用 document.onmouseup=function (eve) { // console.log(eve.button);//查看鼠标哪个键被点击 左键0 滑轮1 右键2 if (eve.button==2){ ul.style.display='block'; ul.style.left=event.clientX+'px'; ul.style.top=event.clientY+'px'; }else { ul.style.display='none'; } } //事件委托 ul.onmousedown=function (eve) { // console.log(eve.target.innerHTML);//根据这个来判断是哪一个li if (eve.button==2||eve.button==0){ if (eve.target.innerHTML=='查看网页源代码'){ alert('我不告诉你!!!'); ul.style.display='none'; } else if (eve.target.innerHTML=='刷新网页(F5)'){ window.location.reload(); } else if (eve.target.innerHTML=='离开网页'){ var a=confirm('Do you sure 要离开网页?????'); // console.log(a); if (a){ window.close(); } else { ul.style.display='none'; } }else if (eve.target.innerHTML=='跳转到百度'){ window.location.replace('http://www.baidu.com'); }else if (eve.target.innerHTML=='根据文本框内容搜索'){ var resukt=document.getSelection().toString(); window.open('http://www.baidu.com/s?wd='+resukt); } } } } </script> </body> </html>
老师,当点击鼠标右键的时候,ul的display属性取值为block或inline-block ,都会使得我本来设置的文本框向下移动;请问老师怎么设置能够使文本框在ul出现时依旧保持之前的位置
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script> var ul=document.createAttribute('ul'); ul.style.listStyle='none'; ul.style.padding='0'; var arr=["首页","军事","娱乐","历史","政治"]; for(var i=0;i<arr.length;i++){ var li=document.createAttribute("li"); li.style.cssText="display:inline-block;width:100px;height:30px;line-height:30px;" + "text-align:center;margin-left:5px;background-color:skyblue"; li.innerHTML=arr[i]; ul.appendChild(li); li.onmouseenter=function(){ this.style.backgroundColor="blue"; } li.onmouseleave=function(){ this.style.backgroundColor="pink"; } } document.body.appendChild(ul); </script> </head> <body> </body> </html>
listStyle出错,onmouseenter和onmouseleave是我手动敲出来的,编辑器没有自动提示,我的webstrom版本是10.0.3
老师_call_方法和直接定义一个函数有什么区别呢 def 函数名:表达式 ,不太明白这个两个,感觉_call_反而更多余
老师,我这该启动的都启动了,完全按步骤配置的(配置文件,端口都检查了,没问题,环境和老师一样),但是在访问的时候,不报错,也不显示,这是什么原因呢?
老师您好,使用Thread.yield和Thread.sleep(0),这两个有区别么?我知道sleep(0)会进入runnable状态,但是下次获得CPU执行权的可能还是这个线程,yield是在CPU没有忽略这个命令的情况下才进入Runnable状态和sleep(0)一样?如果忽略了就相当于没调用么?
老师 ,你好 有最新版的pycharm的安装包吗 ,然后我们学习用的是社区版 还是专业版 ,社区版 好像不能做网页开发,可以给我们提供 专业版的pycharm吗
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>cookie前台操作</title> </head> <body> <script> /*var expires = new Date(new Date().getTime()+1000*1000); document.cookie="username=taozi;expires="+expires; //获取cookie的值 //1.将cookie得到的字符串转为对象或,split()为分割,用=为分隔符 var tempArr = document.cookie.split("="); //2.创建一个空对象,用来接收分割后的键和值 var tempObj = {}; //3.利用下标来接收,=左边为0,=右边为1 tempObj[tempArr[0]] = tempArr[1]; console.log(tempObj); console.log(tempObj.username); */ //删除一条cookie var expires = new Date(new Date().getTime()+1).toGMTString(); document.cookie = "username=taozi;expires="+expires; //获取cookie console.log(document.cookie); </script> </body> </html>
老师 我想问问我的为什么时间还有 而且时间还是不对的呢
老师您好,通过类创建对象的过程中,内存本质是什么样的或是怎么实现的?
比如:
class test1: def __init__(self,name,score): self.name = name self.score = score def student(self): print('{0}的分数是:{1}'.format(self.name,self.score)) s1 = test1('gaoqi',90)
既然UserDao 这个接口中的方法,不用与对应xml文件中的sql语句的方法一致,那么这接口有什么用?为什么要多加这么一个接口,完全没有使用到。
老师,运行语句时一直卡着没有出结果,VSCODE有类似juypter中断服务的按钮嘛?
df[['Rating','Age']].plot(kind='bar')
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637