| 3303 |
rajveer |
1 |
package in.shop2020.serving.mappers;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.serving.services.SpecialPageConfigurer;
|
|
|
4 |
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
|
|
5 |
import org.apache.struts2.rest.RestActionMapper;
|
|
|
6 |
|
| 3320 |
rajveer |
7 |
/**
|
|
|
8 |
*
|
|
|
9 |
* @author rajveer
|
|
|
10 |
*
|
|
|
11 |
* Saholic mapper will allow us to dynamically map the urls with action. We will be able to create the pages dynamically in cms.
|
|
|
12 |
*/
|
| 3303 |
rajveer |
13 |
public class SaholicMapper extends RestActionMapper{
|
|
|
14 |
|
|
|
15 |
@Override
|
|
|
16 |
public org.apache.struts2.dispatcher.mapper.ActionMapping getMapping(javax.servlet.http.HttpServletRequest request, com.opensymphony.xwork2.config.ConfigurationManager configManager){
|
|
|
17 |
ActionMapping mapping = super.getMapping(request, configManager);
|
|
|
18 |
if(SpecialPageConfigurer.isValidSpecialPage(mapping.getName())){
|
|
|
19 |
mapping.setName("special-page");
|
|
|
20 |
}
|
|
|
21 |
return mapping;
|
|
|
22 |
}
|
|
|
23 |
}
|