File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes how to map multiple url patterns using spring annotations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "how to map multiple url patterns using spring annotations" Watch "how to map multiple url patterns using spring annotations" New topic
Author

how to map multiple url patterns using spring annotations

Paranidharan Selvaraj
Greenhorn

Joined: Mar 19, 2010
Posts: 17
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?

 
Consider Paul's rocket mass heater.
 
subject: how to map multiple url patterns using spring annotations