我想创建一个这样的网址abc.com/firstName.lastName.how我在我们的项目中实现了这个可以帮助我。
我检查过你在WebConfigurer.java类中的过滤器
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/");
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/index.html");
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/images/*");
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/fonts/*");
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/scripts/*");
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/styles/*");
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/views/*");
staticResourcesProductionFilter.setAsyncSupported(true);
如果我将我们的网址更改为abc.com/profile/firstName.lastName,那么它对我来说会很好,因为我已经编写了自己的过滤器
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/profile/*");
但是,如果我想像这个网址的abc.com/firstName.lastName那样,我必须更改
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/");
到
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/*");
然后它给了我一个例外请给我任何方式,比如回归。
提前致谢。
答案 0 :(得分:0)
您希望将其作为UI网址或api调用来获取用户对象吗?
如果您希望将其作为api调用,则需要添加com.ubnt.japi.web.rest.UserResource.getUser(String)
之类的内容。
如果您希望它成为UI路径,则需要在/src/main/webapp/scripts/app/app.js
中更改AngularJS路由器提供程序。我没有使用生成的角度文件,但你可能最好在潜入之前熟悉Angular中的路由。有很多教程可以提供帮助。