This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data 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?

 
rocket mass heater kickstarter
 
subject: how to map multiple url patterns using spring annotations