Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用自己的类型将Camel与springmvc集成_Spring_Spring Mvc_Apache Camel - Fatal编程技术网

使用自己的类型将Camel与springmvc集成

使用自己的类型将Camel与springmvc集成,spring,spring-mvc,apache-camel,Spring,Spring Mvc,Apache Camel,我正在尝试使用邮件向SpringMVC应用程序发送包含邮件内容的通知。此外,我不希望只调用一个方法,还希望通过对象传递内容,这样我就可以使用@Valid 我想将Camel与springmvc集成 在控制器方面,我得到: @RequestMapping(value="/messages/notify", method=RequestMethod.POST) public void executeNotifyPost(@Valid Email email, HttpServletRequest re

我正在尝试使用邮件向SpringMVC应用程序发送包含邮件内容的通知。此外,我不希望只调用一个方法,还希望通过对象传递内容,这样我就可以使用@Valid

我想将Camel与springmvc集成

在控制器方面,我得到:

@RequestMapping(value="/messages/notify", method=RequestMethod.POST)
public void executeNotifyPost(@Valid Email email, HttpServletRequest request,HttpServletResponse response){...}
我的骆驼路线是

<camel:from
            uri="imaps://{{mail.imapserver}}?username={{mail.username}}&amp;password={{mail.password}}" />          
        <camel:to uri="http://localhost/messages/notify" />
公共类电子邮件转换器{

@Converter
public static Email toString(MimeMultipart mime, Exchange exchange){ ... } }
我想知道是否有一个组件将camel与springmvc集成为to端点,或者我必须使用InputStream


致以最诚挚的问候,

电子邮件是哪种类型的?这是某种自定义类吗?是的。它只是一个自定义类,所以我不会将整个mimultipart发送给控制器。
@Converter
public static Email toString(MimeMultipart mime, Exchange exchange){ ... } }