小编TMa*_*Man的帖子

Spring 3 MVC使用单个Controller处理多个表单提交

Spring 3 MVC处理多个表单提交控制器.

我正在开发具有多种形式的JSP页面.1)搜索客户,2)搜索产品,3)打印东西等我有一个不同的表单绑定对象绑定到每个表单,我的控制器代码看起来类似于下面

  @Controller
  @RequestMapping(value="/search.do")
  public class SearchController {

    @RequestMapping(method = RequestMethod.GET)
    public String pageLoad(ModelMap modelMap) {
      modelMap.addAttribute("productSearch", new ProductSearchCriteria());
        modelMap.addAttribute("customerSearch", new CustomerSearchCriteria());
        modelMap.addAttribute("print", new PrintForm());
    }

    @RequestMapping(method = RequestMethod.POST)
    public ModelAndView searchProducts(@ModelAttribute("productSearch") ProductSearchCriteria productSearchCriteria,
            BindingResult result, SessionStatus status) {
            //Do Product search
            return modelAndView;
    }

    @RequestMapping(method = RequestMethod.POST)
    public ModelAndView searchCustomers(@ModelAttribute("customerSearch") CustomerSearchCriteria customerSearchCriteria,
            BindingResult result, SessionStatus status) {
            //Do Customer search
            return modelAndView;
    }

    @RequestMapping(method = RequestMethod.POST)
    public ModelAndView printSomething(@ModelAttribute("print") PrintForm printForm,
            BindingResult result, SessionStatus status) {
            //Print …
Run Code Online (Sandbox Code Playgroud)

controller spring-mvc java-ee

8
推荐指数
3
解决办法
5万
查看次数

如何使用axis2-wsdl2code-maven-plugin设置-Euwc param?

我们正在使用axis2来生成Web服务客户端(我现在后悔!).使用axis2命令行工具,您可以将switch -Euwc传递给Integer,将boolean传递给Boolean,以及生成的soruces等等.这是告诉axis2 可以使某些int或boolean值在模式中可以为空的一种方法.

我的问题是如何通过POM或Maven的其他方式设置此参数以实现与生成源相同的行为?我的stackoverflow和谷歌搜索没有太多揭示.有一个Jira问题,似乎被开发人员关闭而没有指向正确的方向.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.futile.bizzareservice</groupId>
<artifactId>BizzareService</artifactId>
<version>2.0</version>
<name>BizzareService</name>
<properties>
    <wsdl.location>unfortunate-wsdls</wsdl.location>
    <axis2.version>1.5.4</axis2.version>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
            <version>${axis2.version}</version>
            <configuration>                 
                <packageName>com.futile.bizzareservice.client</packageName>
                <wsdlFile>${wsdl.location}/bizzareservice.wsdl</wsdlFile>
                <language>java</language>
                <databindingName>adb</databindingName>
                <unpackClasses>true</unpackClasses>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>wsdl2code</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>${axis2.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>${axis2.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb-codegen</artifactId>
        <version>${axis2.version}</version>
    </dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

在配置中将unwrap设置为true无济于事,因为它们是一个不同的选项.我将来会避免使用axis2,但暂时我们会坚持使用它.

autoboxing axis2 wsdl2code maven

5
推荐指数
1
解决办法
1802
查看次数

定义自定义命名空间以封装来自wsdl - Axis2 eclipse的生成文件的映射

我在Eclipse中有wsdl文件,我通过axis2插件生成客户端.

这些文件正生成到源文件夹中名为com.mycompany.stub的包中.

我想将生成的源文件的包名称更改为com.mycompany.ws.workflow

我在哪里可以在wsdl文件中执行此操作?

java eclipse axis2 webservice-client

4
推荐指数
1
解决办法
1万
查看次数