springmvc设置method=RequestMethod.POST如何拦截get请求抛出的异常

springmvc开发,方法设置method = RequestMethod.POST,浏览器地址栏请求,抛出HTTP Status 405 - Request method 'GET' not supported。如何拦截请求方法异常,HandlerInterceptor无法拦截到?

3个回答

if(Context.Request.HttpMethod.ToLower()!="post"){
return "不是post请求"
}else{
正常访问其他代码
}

这不是异常,这是WARN,就像404一样,

拦截请求方法异常?是可以设置异常转到的页面,每个异常都有一个对应 的错误码

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring MVC 中的@RequestMapping(method = RequestMethod.OPTIONS)无法拦截

Spring MVC 中的@RequestMapping(method = RequestMethod.OPTIONS)无法拦截,貌似这个注解不能拦截OPTIONS方法,get,post,put都能,为什么这个不能,有什么解决办法

SpringMVC出现 Request method 'POST' not supported 错误

![图片说明](https://img-ask.csdn.net/upload/201610/14/1476451398_851931.png) ![图片说明](https://img-ask.csdn.net/upload/201610/14/1476451893_490488.png) ![图片说明](https://img-ask.csdn.net/upload/201610/14/1476451912_555477.png) ![图片说明](https://img-ask.csdn.net/upload/201610/14/1476451932_774744.png) ![图片说明](https://img-ask.csdn.net/upload/201610/14/1476451963_715213.png)

ajax的POST请求到springmvc

ajaxPOST请求代码: function loginBtn(){ debugger; $.ajax({ type: "POST", url: "/doLogin", //把form表单做了一个序列化 data: $("#loginForm").serialize(), success: function(msg){ debugger; if("success"== msg.result){ // window.location.href="/mainPage"; // location="/mainPage"; location.href="/mainPage"; }else{ alert("错误!!"); } }, error: function(msg){ debugger; alert(msg); } }); } Controller代码 @Controller public class LoginController { @RequestMapping(value = "/login", method = RequestMethod.GET) public String login() { return "login"; } @RequestMapping(value = "/doLogin", method = RequestMethod.POST) public @ResponseBody Map<String, String> doLogin(Login login) { System.out.println(login.getUsername() + "" + login.getPassword()); Map<String, String> map = new HashMap<String, String>(); map.put("result", "success"); return map; } ![图片说明](https://img-ask.csdn.net/upload/201711/04/1509797908_164619.png) 请问这个怎么处理?,还有就是我在浏览器点击后退时,怎么刷新页面(不带参数)

springmvc ajax请求 返回 map 与model.asMap的区别

@RequestMapping(value = "ajax1", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public Map<String, Object> ajax1(HttpServletRequest request, Model model){ return model.asMap(); } ajax请求报404错误 @RequestMapping(value = "ajax2", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public Map<String, Object> ajax2(HttpServletRequest request, Model model){ return new HashMap<String, Object>(); } ajax请求正常 翻看源码 发现 model实现linkedhashmap ,而linkedhashmap 继承hashmap model.asMap与new HashMap有什么区别呢 求大神

SpringMVC html无法post到后台,提示404

html里面点击提交按钮,原本是想试一下ajax看看前后台能不能通,但是点击的时候,出现404。 初学者想请各位帮忙看看原因 ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586828340_899772.png) html代码 ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586828356_453339.png) controller代码,后面没有截全 @RequestMapping(method = RequestMethod.POST,produces = "application/json,charset=UTF-8",value = "/printHello") ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586828388_713351.png) springdemo-servlet.xml ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586828455_479273.png) ============================================================= 根据两位大佬的回答,把url改成localhost:8080/xxxx 或者是修改为/springdemo/printHello都可行。修改以后出现 ![图片说明](https://img-ask.csdn.net/upload/202004/14/1586844513_913949.png) 在调试中并没有进入到printHello方法,我想问一下这个是原因。。我根据网上的方法修改了tomcat的conf文件也没有生效 ============================================================= 问题已解决,根据前面修改了controller和url的基础上,再修改了一下ajax,就可以成功交互了 ![图片说明](https://img-ask.csdn.net/upload/202004/15/1586921196_37448.png)

SpringMVC接入为微信,GET可接收数据,配置成功,但是POST无法接收请求。

我使用SpringMVC做微信公众号开发, GET可接收微信请求,同时显示配置成功, 但是POST却怎么也接收不到微信的消息,看配置好像没有什么问题, 不知道该如何解决,请问各位有遇到此类问题吗? 希望能有高人帮忙处理一下,谢谢。 ``` @Controller @RequestMapping("/weicon") public class WeiChartConnectAPI { /** * 微信链接API * * @return */ @RequestMapping(value = "/weiapi", method = RequestMethod.GET) @ResponseBody public void weiChartConnectionAPI(String signature, String timestamp, String nonce, String echostr, HttpServletRequest req, HttpServletResponse res) { try { res.setCharacterEncoding("UTF-8"); System.out.println(" === Enter api, method = get"); String returnMsg = checkWeiChartConnection(signature,timestamp,nonce,echostr); PrintWriter out = res.getWriter(); out.print(returnMsg); out.flush(); out.close(); } catch (Exception e) { e.printStackTrace(); } } /** * 接收微信交互 * * @return */ @RequestMapping(value = "/weiapi", method = RequestMethod.POST,produces = "application/xml;charset=UTF-8") public String weiChartMsgApi(HttpServletRequest req,HttpServletResponse res) { try { res.setCharacterEncoding("UTF-8"); System.out.println(" === Enter api, method = post"); String returnMsg = ""; String weiStrMsg = convertInputParamToString(req); System.out.println("MSG = " + weiStrMsg); WeiChartMsgHandleServices mhs = new WeiChartMsgHandleServices(); returnMsg = mhs.weiChartMessageDispitch(weiStrMsg); PrintWriter out = res.getWriter(); out.print(returnMsg); out.flush(); out.close(); } catch (Exception e) { e.printStackTrace(); } return null; } } ```

Spring getHandlerInternal 返回错误handler问题

问题如下: 我在某个controller里的某个方法的RequestMapping有如下定义: ``` @RequestMapping( value = "query.action", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaTypes.JSON_UTF_8, method = RequestMethod.POST ) ``` 当我试图从外部访问这个接口,但是没有在request的header里加"content-type:application/json"时, AbstractHandlerMethodMapping返回了另一个controller里定义的方法,它的@RequestMapping是这样定义的: ``` @RequestMapping(value = "/login.action", method = RequestMethod.POST, produces = MediaTypes.JSON_UTF_8) ``` 我的本意是想让服务器返回404这样的错误,但是通过追踪spring源代码,发现在 AbstractHandlerMethodMapping.getHandlerInternal的方法里返回了一个所谓的"BestMatch"的handler,这段代码如下: ``` Match bestMatch = matches.get(0); if (matches.size() > 1) { Match secondBestMatch = matches.get(1); if (comparator.compare(bestMatch, secondBestMatch) == 0) { Method m1 = bestMatch.handlerMethod.getMethod(); Method m2 = secondBestMatch.handlerMethod.getMethod(); throw new IllegalStateException( "Ambiguous handler methods mapped for HTTP path '" + request.getRequestURL() + "': {" + m1 + ", " + m2 + "}"); } } ``` 纠结了好久不知道怎样通过配置来避免这个问题,现在在想是不是要去重写下AbstractHandlerMethodMapping类。

android 调用springMVC接口传值问题

我后台框架是springMVC 现在android端调用接口的时候,参数值为空,name接收不到值,下边是后台接口示列,求高手解答 @ResponseBody @RequestMapping(value = "/editPhotos", method = {RequestMethod.POST,RequestMethod.GET}) public Response editPhotos(String name) { System.out.print(name); Response response = new Response(); response.getResult().setResult("1"); response.getResult().setMessage("操作成功"); return response; }

SpringMVC程序中的IllegalArgumentException

http://blog.csdn.net/sujiangchichu/article/details/16962231 抛出的的异常: [java] view plaincopyprint?在CODE上查看代码片派生到我的代码片 严重: Servlet.service() for servlet baobaotao threw exception java.lang.IllegalArgumentException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:65) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:707) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:371) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:4295) at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:186) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:134) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:995) at org.hibernate.loader.Loader.doQuery(Loader.java:874) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) at org.hibernate.loader.Loader.doList(Loader.java:2438) at org.hibernate.loader.Loader.doList(Loader.java:2424) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2254) at org.hibernate.loader.Loader.list(Loader.java:2249) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1248) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at com.baobaotao.dao.UserDao.findUserByUserName(UserDao.java:34) at com.baobaotao.service.UserService.findUserByUserName(UserService.java:22) at com.baobaotao.web.LoginController.loginCheck(LoginController.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:662) [java] view plaincopyprint?在CODE上查看代码片派生到我的代码片 [java] view plaincopyprint?在CODE上查看代码片派生到我的代码片 User.dao: [java] view plaincopyprint?在CODE上查看代码片派生到我的代码片 package com.baobaotao.dao; import java.util.List; import org.hibernate.Query; import org.hibernate.Transaction; import org.springframework.stereotype.Repository; import com.baobaotao.domain.User; @Repository //通过spring注解定义一个dao public class UserDao extends BaseDAO{ public int getMatchCount(String userName, String passWord){ String hql = "from User user " + " where user.userName = ? " + " and user.passWord = ? " ; Query queryObject = getSession().createQuery(hql); queryObject.setParameter(0,userName ); queryObject.setParameter(1, passWord); @SuppressWarnings("unchecked") List <User> list=queryObject.list(); return list.size(); } public User findUserByUserName(final String userName) { String hql = "from User user " + " where user.userName = ? "; Query queryObject = getSession().createQuery(hql); queryObject.setParameter(0,userName); User user=(User)queryObject.list().get(0); System.out.println(user); return user ; } public void updateLoginInfo(User user) { Transaction ts=getSession().beginTransaction(); getSession().update(user); ts.commit(); } } LoginController [java] view plaincopyprint?在CODE上查看代码片派生到我的代码片 package com.baobaotao.web; import java.util.Date; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import com.baobaotao.domain.User; import com.baobaotao.service.UserService; //标注一个springmvc的Controller @Controller public class LoginController { @Autowired private UserService userService; //负责处理index.html的请求 @RequestMapping(value="/index.html") public String loginPage(){ return "login"; } //负责处理loginCheck.html的请求 @RequestMapping(value="/loginCheck.html") public ModelAndView loginCheck(HttpServletRequest request, LoginCommand loginCommand){ boolean isValidUser = userService.hasMatchUser(loginCommand.getUserName(),loginCommand.getPassword() ); if (!isValidUser) { return new ModelAndView("login", "error", "用户名或密码错误。"); } else { User user = userService.findUserByUserName(loginCommand.getUserName()); user.setLastIp(request.getLocalAddr()); System.out.println(request.getLocalAddr()); user.setLastVisit(new Date()); System.out.println(new Date()); userService.loginSuccess(user); // request.getSession().setAttribute("user", user); // return new ModelAndView("main"); ModelAndView mv = new ModelAndView(); mv.setViewName("main"); mv.addObject(user); return mv; } } } UserService [java] view plaincopyprint?在CODE上查看代码片派生到我的代码片 package com.baobaotao.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baobaotao.dao.LoginLogDao; import com.baobaotao.dao.UserDao; import com.baobaotao.domain.LoginLog; import com.baobaotao.domain.User; @Service //将userbean标注为一个服务层的Bean public class UserService { @Autowired private UserDao userDao; @Autowired private LoginLogDao loginLogDao; public boolean hasMatchUser(String userName, String passWord){ int matchCount = userDao.getMatchCount(userName, passWord); return matchCount>0; } public User findUserByUserName(String userName){ return userDao.findUserByUserName(userName); } public void loginSuccess(User user){ user.setCredits(5+user.getCredits()); LoginLog loginLog = new LoginLog(); loginLog.setUserId(user.getUserId()); loginLog.setIp(user.getLastIp()); loginLog.setLoginDate(user.getLastVisit()); userDao.updateLoginInfo(user); loginLogDao.insertLoginLog(loginLog); } } login.jsp [html] view plaincopyprint?在CODE上查看代码片派生到我的代码片 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <html> <head> <title>hehe</title> </head> <body> <c:if test="${!empty error}"> <c:out value="${error}" /> </c:if> <form action="<c:url value="loginCheck.html"/>" method="post"> 用户名: <input type="text" name="userName"> 密 码: <input type="password" name="password"> <input type="submit" value="登录" /> <input type="reset" value="重置" /> </form> </body> </html> 求教,异常如何处理呢? 求教,异常如何处理呢?

springMVC对静态资源的拦截问题

无论我怎么陪web.xml的拦截。/或者/uc/*我的静态资源都被拦截了。 <servlet-mapping> <servlet-name>yinhex</servlet-name> <url-pattern>/uc/*</url-pattern> </servlet-mapping> 配置为: < mvc:resources mapping="/javascripts/**"location="/javascripts/"/> <mvc:resources mapping="/themes/**" location="/css/" /> <mvc:resources mapping="/upload/**" location="/upload/"/> 访问路径为: http://localhost:8080/yinhex/index/javascripts/jquery.bgiframe.js index为controller的注解.为什么还是被拦截了呢???导致静态资源不可用 @Controller @RequestMapping("/index") public class IndexController{ @Resource(name="userService") private UserService userService; @RequestMapping(value = "index", method = { RequestMethod.GET, RequestMethod.POST }) public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView mav = new ModelAndView(); System.out.println("---======11111我进来啦TestController"); User user = userService.login("liujiebinhe@126.com", "liuxuejin"); System.out.println("==============="+user.getUserName()); mav.addObject("test", "hello world!"); mav.setViewName("main"); System.out.println("---======11111我进来啦TestController"); return mav; } 然后访问: http://localhost:8080/yinhex/uc/index/index 的时候 } http://localhost:8080/yinhex/uc/index/javascripts/jquery.bgiframe.js 静态资源就无法获得!求大神解释

spring mvc中使用post方式请求返回405

后台处理方法 ``` @RequestMapping(value="/doLogin", method=RequestMethod.POST) public ModelAndView doLogin(HttpSession session){ logger.info("user login."); session.setAttribute("USER", "admin"); //return "superMain.html"; return new ModelAndView(new InternalResourceView("/view/superMain.html")); } ``` mvc配置 ``` <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="order" value="1"/> <property name="contentNegotiationManager" ref="contentNegotiationManager"/> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/view/" /> </bean> </list> </property> <property name="defaultViews"> <list> <bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"/> </list> </property> </bean> ``` 页面html代码 ``` <form action="doLogin" method="post"> <div class="form-group"> <div class="input-group"> <div class="input-group-addon"><i class="fa fa-user"></i></div> <input class="form-control" placeholder="Username" type="text" /> </div> </div> <div class="form-group"> <div class="input-group"> <div class="input-group-addon"><i class="fa fa-asterisk"></i></div> <input class="form-control" placeholder="Password" type="password" /> </div> </div> <div class="row"> <div class="col-xs-4"> <div class="form-group text-right"> <button class="btn btn-success text-uppercase" type="submit">Sign In</button> </div> </div> </div> </form> ``` 错误信息 11:54:35.105 [http-apr-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'springMvc' processing POST request for [/cbos-web-1.0/doLogin] 11:54:35.118 [http-apr-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /doLogin 11:54:35.133 [http-apr-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public org.springframework.web.servlet.ModelAndView com.gtstar.cbos.web.controller.LoginController.doLogin(javax.servlet.http.HttpSession)] 11:54:35.137 [http-apr-8080-exec-3] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'loginController' - user login. 11:54:35.181 [http-apr-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.InternalResourceView: unnamed; URL [/view/superMain.html]] in DispatcherServlet with name 'springMvc' 11:54:35.183 [http-apr-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Forwarding to resource [/view/superMain.html] in InternalResourceView 'null' 11:54:35.183 [http-apr-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'springMvc' processing POST request for [/cbos-web-1.0/view/superMain.html] 11:54:35.189 [http-apr-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /view/superMain.html 11:54:35.194 [http-apr-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/view/superMain.html] 11:54:35.209 [http-apr-8080-exec-3] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns for request [/view/superMain.html] are [/view/**] 11:54:35.226 [http-apr-8080-exec-3] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - URI Template variables for request [/view/superMain.html] are {} 11:54:35.238 [http-apr-8080-exec-3] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Mapping [/view/superMain.html] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/WEB-INF/view/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@783c52dc]]] and 1 interceptor 11:54:35.245 [http-apr-8080-exec-3] DEBUG o.s.w.s.m.a.ResponseStatusExceptionResolver - Resolving exception from handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/WEB-INF/view/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@783c52dc]]]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported 11:54:35.250 [http-apr-8080-exec-3] DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolving exception from handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/WEB-INF/view/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@783c52dc]]]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported 11:54:35.257 [http-apr-8080-exec-3] WARN o.s.web.servlet.PageNotFound - Request method 'POST' not supported 11:54:35.275 [http-apr-8080-exec-3] WARN o.s.w.s.m.s.DefaultHandlerExceptionResolver - Handler execution resulted in exception: Request method 'POST' not supported 11:54:35.282 [http-apr-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'springMvc': assuming HandlerAdapter completed request handling 11:54:35.316 [http-apr-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request 11:54:35.317 [http-apr-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request 望大师指导!!

初学springmvc 报错 求助

JSP页面表单信息: <form action="springmvc/testmodelattribute" method="post"> id:<input type="hidden" name="id" value="1"> <br> username: <input type="text" name="username" value="miwa"> <br> email:<input type="text" name="email" value="abc.miwa"> <br> age:<input type="text" name="age" value="20"> <br> <input type="submit" value="submit"> springmvc handler 相关代码: @Controller @RequestMapping("/springmvc") public class gloomy { @ModelAttribute public void getUser(@RequestParam(value="id ",required = false) Integer id,Map<String , Object> map ){ if(id != null){ User user = new User("miwa", id, "123456", "abc.miwa", 20); System.out.println("获取一个对象"+user); map.put("user", user); } System.out.println("我在这里"); } @RequestMapping("/testmodelattribute") public String testmodelattribute( User user){ System.out.println("修改"+user); return "success"; } } POJO代码: public class User { private String username; private Integer id; private String password; private String email; private int age; private Adress adress; public User(String username, Integer id, String password, String email, int age) { super(); this.username = username; this.id = id; this.password = password; this.email = email; this.age = age; } public User(String username, String password, String email, int age) { super(); this.username = username; this.password = password; this.email = email; this.age = age; } public Adress getAdress() { return adress; } public int getAge() { return age; } public String getEmail() { return email; } public Integer getId() { return id; } public String getPassword() { return password; } public String getUsername() { return username; } public void setAdress(Adress adress) { this.adress = adress; } public void setAge(int age) { this.age = age; } public void setEmail(String email) { this.email = email; } public void setId(Integer id) { this.id = id; } public void setPassword(String password) { this.password = password; } public void setUsername(String username) { this.username = username; } @Override public String toString() { return "User [username=" + username + ", id=" + id + ", password=" + password + ", email=" + email + ", age=" + age + "]"; } 异常信息: 严重: Servlet.service() for servlet [springDispatcherServlet] in context with path [/SpringMVC] threw exception [Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.gloomy.springmvc.pojos.User]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.gloomy.springmvc.pojos.User.<init>()] with root cause java.lang.NoSuchMethodException: com.gloomy.springmvc.pojos.User.<init>()

SpringMVC 实体接收不到至

public class UserVo { private Integer id; private String userName; private String passwrod; private String birthday; 纯基础类型也不行! 只传了 userName和password 方法是 @RequestMapping(value={"/login"},method= RequestMethod.POST,params = {"username","password"}) public ModelAndView login( String userName,String password, HttpServletRequest request, ModelMap modelMap){ # 这种正常!!! 换成 UserVo 就接收不到 全部是null怎么办 课堂上 老师演示的时候是可以接受的 request能获取到参数 username 和 password 写String username String password也能 唯独实体类不行 什么鬼啊

Spring MVC WEB工程中前后台post传值事该不该用@RequestBody?

最近在做一个项目,BS架构用的SpringMVC,在做前后台交互时用post将前台的数据发送到后台,对action里面的@RequestBody有点迷糊,求教各位大神。 ``` @RequestMapping(value = "/something", method = RequestMethod.POST) public void handle(@RequestBody User user, Writer writer) throws IOException { writer.write(body); } ``` 这样用AJAX提交时必须是下面这种才能成功 ``` var user={'name':name,'passwd':passwd} $.ajax({ url : "http://localhost:8080/something", type : "POST", contentType: "application/json", data : JSON.stringify(user), dataType : "json", success : function(result) { }, error:function(msg){ } }); ``` 如果后台action里面取掉@RequestBody,就像下面这样 ``` @RequestMapping(value = "/something", method = RequestMethod.POST) public void handle( User user, Writer writer) throws IOException { writer.write(body); } ``` 前台post数据的时候直接这样就行了 ``` var user={'name':name,'passwd':passwd} $.ajax({ url : "http://localhost:8080/something", type : "POST", data : user, success : function(result) { }, error:function(msg){ } }); ``` 这样就可以收到前台传过来的值,但是按照前面的就不行了。 这个里面@RequestBody到底有什么作用,我的本意是后台直接接收一个User对象,如果按照第一种方法,感觉像是我前台先创建一个User对象,然后把它转成了JSON串再post到后台,然后通过@RequestBody再将JSON串转换成User对象,这感觉有点多此一举。而第二种方法感觉就是直接把对象传到后台的。那么这里@RequestBody的作用是什么。感觉第二种更加的方便,可是我看了一些人说的和一些项目中例子,用的第一种的比较多,这是为什么,百思不得其解?

spring mvc 为什么不能访问

我写了一个类UserController: [code="java"] import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.itech.model.User; @Controller @RequestMapping("/user") public class UserController { private Map<String, User> users=new HashMap<String,User>(); public UserController() { users.put("huhuawen1", new User("huhuawen1","29", "123", "123@163.com")); users.put("huhuawen2", new User("huhuawen2","28", "456", "456@163.com")); users.put("huhuawen3", new User("huhuawen3","20", "789", "789@163.com")); } @RequestMapping(value="/users",method=RequestMethod.GET) public String list(Model model) { model.addAttribute("users",users); return"user/list"; } //链接到add页面时是GET请求 @RequestMapping(value="/add",method=RequestMethod.GET) public String add(@ModelAttribute("user") User user) { return"user/add"; } //具体添加用户时是post请求 @RequestMapping(value="/add",method=RequestMethod.POST) public String add(@Validated User user,BindingResult br ) {//一定要紧跟Validated之后写验证结果 if(br.hasErrors()){ //如果有错,就跳转到add视图 return "user/add"; } users.put(user.getUserName(), user); System.out.println("123"); return"redirect:/user/users"; } @RequestMapping(value="/{userName}/update" , method=RequestMethod.GET) public String update(@PathVariable String userName,Model model){ model.addAttribute(users.get(userName)); return "user/update"; } @RequestMapping(value="/{userName}/update",method=RequestMethod.POST) public String update(@Validated User user,@PathVariable String userName,BindingResult br ) {//一定要紧跟Validated之后写验证结果 users.put(user.getUserName(), user); System.out.println("123"); return"redirect:/user/users"; } @RequestMapping(value="/{userName}/delete" , method=RequestMethod.GET) public String delete(@PathVariable String userName,Model model){ users.remove(userName); return"redirect:/user/users"; } @RequestMapping(value="/userlogin" , method=RequestMethod.POST) public String login ( String userName,String password,HttpSession session){ // session.setAttribute('session', arg1) return"redirect:/user/users"; } @RequestMapping(value="/{userName}" , method=RequestMethod.GET) public String show(@PathVariable String userName,Model model){ System.out.println("userName="+userName); model.addAttribute(users.get(userName)); return "user/show"; } } [/code] login.jsp: [code] <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <form action="user/userlogin" method="post"> userName<input type="text" name="userName"><br> password<input type="text" name="password"><br> <input type="submit" name="提交"> </form> </body> </html> [/code] 现在这里面的show方法和login 有一点冲突,因为我在地址栏输入的user/userlogin 它当作了show方法的userName参数了,有什么方法避免吗?

Spring mvc kaptcha验证码 报错

十月 11, 2016 11:17:57 上午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [SpringMVC] in context with path [/yiposi] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/jhlabs/image/RippleFilter] with root cause java.lang.ClassNotFoundException: com.jhlabs.image.RippleFilter at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at com.google.code.kaptcha.impl.WaterRipple.getDistortedImage(WaterRipple.java:32) at com.google.code.kaptcha.impl.DefaultKaptcha.createImage(DefaultKaptcha.java:44) at com.controller.CaptchaController.getCaptchaImage(CaptchaController.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) ``` ``` package com.controller; import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import com.google.code.kaptcha.Constants; import com.google.code.kaptcha.Producer; /** * 验证码相关的接口 * * @author gaowei.cheng */ @Controller @RequestMapping(value = "/captcha") public class CaptchaController { private static final Log log = LogFactory.getLog(CaptchaController.class); @Autowired private Producer captchaProducer; /** * 页面入口 * @param model * @return */ @RequestMapping(value = "/getCaptcha", method = RequestMethod.GET) public String getCaptcha(Model model) { model.addAttribute("timestamp", System.currentTimeMillis()); return "captcha"; } /** * 生成带验证码的图片 * @param model * @param request * @param response * @param timestamp * @return * @throws IOException */ @RequestMapping(value = "/getCaptchaImage", method = RequestMethod.GET) public ModelAndView getCaptchaImage(Model model,HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "timestamp", required = false) String timestamp) throws IOException { if (StringUtils.isEmpty(timestamp)) { //System.out.println("没有时间戳\ttimestamp:" + timestamp); model.addAttribute("timestamp", System.currentTimeMillis()); } else { //System.out.println("有时间戳\ttimestamp:" + timestamp); model.addAttribute("timestamp", timestamp); } response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); response.addHeader("Cache-Control", "post-check=0, pre-check=0"); response.setHeader("Pragma", "no-cache"); response.setContentType("image/jpeg"); String capText = captchaProducer.createText(); request.getSession().setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); log.info("======生成了一个验证码,内容为:" + capText); BufferedImage bi = captchaProducer.createImage(capText);// 这里报错-------------------------------------------------- ServletOutputStream out = response.getOutputStream(); ImageIO.write(bi, "jpg", out); try { out.flush(); } finally { out.close(); } return null; } /** * * @param timestamp * @param code * @param request * @return true或fasle,ture表示验证成功,false表示验证失败 */ @RequestMapping(value = "/checkCaptcha", method = RequestMethod.POST) @ResponseBody public String checkCaptcha(@RequestParam(value = "timestamp", required = false) String timestamp, @RequestParam(value = "code", required = false) String code,HttpServletRequest request) { boolean returnStr = false; String original =(String) request.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); log.info("======用户输入的验证码:" + code); log.info("======正确的验证码:" + original); if (!StringUtils.isEmpty(code)) { if (code.equalsIgnoreCase(original)) { returnStr = true; } } log.info("======验证结果" + returnStr); return returnStr + ""; } } ``` ```

SpringMVC重定向传参的问题:addFlashAttribute

``` @RequestMapping(value = "/test", method = RequestMethod.POST) public String test(@Validated SysUser sysUser, BindingResult result, RedirectAttributes attr) { try { if (result.hasErrors()) { Map<String, String> errors = buileValidatedMessage(result); attr.addFlashAttribute("errMsg", errors); } } catch (Exception e) { e.printStackTrace(); } return "redirect:/index.jsp"; } ``` 我这样写好,在页面无法获取到数据呀 ``` <form action="${CTX}/test.do" method="post"> <input name="fdUsername">${errMsg.fdUsername}<br> <input name="fdPassword">${errMsg.fdPassword}<br> <input type="submit" value="提交"> </form> ``` 在controller里可以正常打印错误,就是跳到页面无法获取。

关于REST风格的SpringMVC Controller 传递多个参数的问题

关于REST风格的SpringMVC Controller 传递多个参数的问题 [code="java"] /** * * * Description: 预更新操作根据用户名查询用户信息 然后数据交给携带体 展示到视图 REST风格: /更新的用户的用户名/update * @param username @PathVariable修饰 表示形参同URL中的请求参数 * @param model 携带数据的Model * @return 视图页面/WEB-INF/jsp/user/update页面 * */ @RequestMapping(value="/{username}/update",method=RequestMethod.GET) public String update(@PathVariable String username, Model model){ System.out.println("获取到传入的参数值为:" + username); model.addAttribute(users.get(username)); return "user/update"; }[/code] 当传递多个参数时 如何设置controller 难道就是设置多个@PathVariable

springmvc接收参数老是为null

后台代码: @RequestMapping(value="/login",method=RequestMethod.POST) @ResponseBody public Map<String,Object> login(String username,String password,HttpServletRequest request,HttpServletResponse response){ return null; } username 和 password一直为null 前台参数:(是用jemeter提交的) Content-Type:application/json;charset=UTF-8 { 'username':'admin2', 'password':'123' }

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

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

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

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

百度工程师,获利10万,判刑3年!

所有一夜暴富的方法都写在刑法中,但总有人心存侥幸。这些年互联网犯罪高发,一些工程师高技术犯罪更是引发关注。这两天,一个百度运维工程师的案例传遍朋友圈。1...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

实时更新:计算机编程语言排行榜—TIOBE世界编程语言排行榜(2020年6月份最新版)

内容导航: 1、TIOBE排行榜 2、总榜(2020年6月份) 3、本月前三名 3.1、C 3.2、Java 3.3、Python 4、学习路线图 5、参考地址 1、TIOBE排行榜 TIOBE排行榜是根据全世界互联网上有经验的程序员、课程和第三方厂商的数量,并使用搜索引擎(如Google、Bing、Yahoo!)以及Wikipedia、Amazon、YouTube统计出排名数据。

立即提问
相关内容推荐