File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to map multiple url patterns using spring annotations

 
Paranidharan Selvaraj
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my project we are using struts1.2 integrated with springs2.5 using DelegatingActionProxy.. Now we would like to use annotations instead to get rid of context xml files. We are facing an issue while converting to annotations when there are multiple url to the same action class.

/* works */

@Controller("/url")
public class MyAction extends ApplicationAction{

@Autowired @Qualifier("myService")
private MyServicemyService;
// code

}


/* doesnt work */

1.

@Controller("/url1,/url2")
public class MyMultipleURLAction extends ApplicationAction{

@Autowired @Qualifier("myService")
private MyServicemyService;
// code

}

2.

@Controller
@RequestMapping({"/url1","/url2"})
public class MyMultipleURLAction extends ApplicationAction{

@Autowired @Qualifier("myService")
private MyServicemyService;
// code

}

Is there a way for doing it?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic