URL rewrite in Wildfly?

非 Y 不嫁゛ 提交于 2019-12-08 04:44:49

问题


I built up an app using RichFaces, PrimeFaces, and Java in the back. The outcome (mysite.war) I let run within Wildfly 8.

Now my pages are like this:

  1. www.mysite.com/index.jsf
  2. www.mysite.com/report.jsf?no=1
  3. www.mysite.com/report.jsf?no=2
  4. www.mysite.com/report.jsf?no=3
  5. www.mysite.com/report.jsf?no=4
  6. www.mysite.com/legal.jsf

I would like to change that to more readable URLs. Especially the reports! Taking the example order, I am looking forward to having something like this:

  1. www.mysite.com
  2. www.mysite.com/report/turkey
  3. www.mysite.com/report/germany
  4. www.mysite.com/report/england
  5. www.mysite.com/report/spain
  6. www.mysite.com/legal

I believe I will have to concentrate on the equivalent of mod_rewrite in Wildfly 8? Does anybody know a step-by-step how to for that? Or maybe a short explanation?


回答1:


You may also want to look at Rewrite, which will be the core of PrettyFaces 4. It's more dynamic and can intercept URLs if you require login.

http://www.ocpsoft.org/java/migrating-from-prettyfaces-to-rewrite-simplicity-meets-power/

http://www.mastertheboss.com/javaee/servlet-30/rewrite-a-java-ee-url-rewriting-solution



来源:https://stackoverflow.com/questions/27064922/url-rewrite-in-wildfly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!