为了账号安全,请及时绑定邮箱和手机立即绑定

jsp表单提交数据老是报错:404,求正解

jsp表单提交数据老是报错:404,求正解

WentworthPeach 2018-03-29 17:40:52
jsp部分:<form action="onsend" method="post">                  MessageText:<textarea name="message">${time }</textarea>                  <input type="submit" value="提交" />     </form>       controller部分: @RequestMapping(value="/onsend",method=RequestMethod.POST)     public ModelAndView producer(@RequestParam("message") String message) {         System.out.println("------------send to jms");         ModelAndView mv = new ModelAndView();         producer.sendMessage(demoQueueDestination, message);         mv.setViewName("welcome");         return mv;     }     配置文件:web.xml     <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee"             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee            http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"           version="3.0">   <display-name>Archetype Created Web Application</display-name>      <!-- 加载spring的配置文件,例如hibernate、jms等集成 -->   <context-param>         <param-name>contextConfigLocation</param-name>         <param-value>           classpath:spring-root.xml;          classpath:activemq.xml;      </param-value>     </context-param>      <listener>       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>   </listener>      <servlet>         <servlet-name>springMVC</servlet-name>         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>         <init-param>             <param-name>contextConfigLocation</param-name>             <param-value>classpath:spring-mvc-dispatch.xml</param-value>         </init-param>         <load-on-startup>1</load-on-startup>     </servlet>     <servlet-mapping>         <servlet-name>springMVC</servlet-name>         <url-pattern>/</url-pattern>     </servlet-mapping>        <!-- 处理编码格式 -->     <filter>           <filter-name>characterEncodingFilter</filter-name>           <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>           <init-param>               <param-name>encoding</param-name>               <param-value>UTF-8</param-value>           </init-param>           <init-param>               <param-name>forceEncoding</param-name>               <param-value>true</param-value>           </init-param>       </filter>       <filter-mapping>           <filter-name>characterEncodingFilter</filter-name>           <url-pattern>/*</url-pattern>       </filter-mapping> </web-app>
查看完整描述

3 回答

?
weixin_慕数据3229144

TA贡献1条经验 获得超0个赞

请问解决了吗???我现在也遇到这种问题??

查看完整回答
反对 回复 2020-05-31
?
WentworthPeach

TA贡献9条经验 获得超0个赞

求大佬帮忙啊

查看完整回答
反对 回复 2018-03-30
?
大咪

TA贡献785条经验 获得超332个赞

producer这个方法上面没有路径了吗?比如类上?

查看完整回答
反对 回复 2018-03-29
点击展开后面12
  • 3 回答
  • 0 关注
  • 2275 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信