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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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?

 
jQuery in Action, 2nd edition
 
subject: how to map multiple url patterns using spring annotations
 
Similar Threads
spring - autowire="constructor"
clarity required on spring annotations
What is the Prototype for Main method in java
Reading a file using a relative Path
apache HttpClient make connection for url1 ,if url1 failed connect url2