How to set HTTP status code with JSF?

拜拜、爱过 提交于 2019-12-08 00:25:18

问题


I use Apache Myfaces 2.2 on WebSphere Application Server.

I have a JSF page, which "test" the conenction to filesystem and database.

When the connection fails, I want to return another HTTP Status Code. How can I do this with JSF?


回答1:


Try response.setStatus();

for more details this link will be helpful :

http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Response-Status-Line.html



来源:https://stackoverflow.com/questions/11428686/how-to-set-http-status-code-with-jsf

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