摘要: 引言 ApplicationContext ioc = new ClassPathXmlApplicationContext("beans.xml"); Monster monster01 = (Monster)ioc.getBean("monster01"); 这是我们接触spring时接触的第一 阅读全文
posted @ 2024-08-03 20:33 尤所不同 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 自动放入request域中 springmvc 会自动把获取的 model 模型,放入到 request 域中 验证代码 后端获取了master对象,这时就自动的把对象传到request域中了,为了验证这个猜想,我们需要从前端的jsp中看是否可以在request中取到master。 //验证自动放入 阅读全文
posted @ 2024-03-23 11:08 尤所不同 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 获取参数值@RequestParam @RequestParam表示会接收参数,value="name"表示接收的参数名为name,,required = false表示该参数可以没有,默认为true package com.ysbt.requestparam; import org.springf 阅读全文
posted @ 2024-03-23 11:08 尤所不同 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 前的浏览器只支持 post/get 请求,因此为了得到 put/delete 的请求方式需要使用 Spring 提供的 HiddenHttpMethodFilter 过滤器进行转换(只能转换post). 前端代码 <%-- Created by IntelliJ IDEA. User: YRX Da 阅读全文
posted @ 2024-03-23 11:07 尤所不同 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1.类上与方法上都可以 @RequestMapping("/user") @Controller public class requesttest { @RequestMapping(value = "/registe",method = RequestMethod.GET) public Stri 阅读全文
posted @ 2024-03-17 21:15 尤所不同 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 学习springmvc的时候的一个入门功能,登录功能。配置好web框架,导入需要springjar包和springmvc需要的两个jar包,就可以编码了,首先写了登录需要的jsp页面 <%@ page contentType="text/html;charset=UTF-8" language="j 阅读全文
posted @ 2024-03-13 13:22 尤所不同 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 当时出现这个错误以为是代码写错了,结果改了半天也没有用。原来是@Controller就没有被解析。这时在spring配置文件中加入扫描包。 <context:component-scan base-package="com.ysbt.requestmapping"/> 又是被自己蠢哭的一天,呜呜呜 阅读全文
posted @ 2024-03-09 08:53 尤所不同 阅读(62) 评论(0) 推荐(0) 编辑
摘要: add framework support如果有的话就很简单,鼠标右键然后点击这个选项,再把web模块选上。如果没有也不要慌,我们还可以通过别的方法建立。 在file-->Project structure-->Modules-->web添加web模块 在Artifacts中生成带有模块的war包 阅读全文
posted @ 2024-03-03 09:08 尤所不同 阅读(1128) 评论(1) 推荐(1) 编辑
摘要: 好看壁纸 图标 书的封面 阅读全文
posted @ 2023-09-15 09:42 尤所不同 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 继续以起点小说为例子,我们要做的就是把对象存储到item(类似于一个字典)中,在通过pipelines持久化到txt文件中。 之前我们在运行爬虫的后面加“-o 爬虫名称” 这样很方便,但是也有很多的弊端,比如只能存为特定的格式,像txt这种就不可以。同时在使用pipelines存储前可以写一些存储前 阅读全文
posted @ 2022-09-24 11:55 尤所不同 阅读(49) 评论(0) 推荐(0) 编辑