Message Boards
How to get http response status code into theme?
How to get http response status code into theme?
Junior Member Posts: 44 Join Date: 12/18/19 Recent PostsHi
I use liferay 7.4
I would like to get status code
inside theme (portal_normal.ftl) on user request for web page (like
200, 404 etc).
Session errors object is empty on theme level (it
is weird, because on liferay 7.4 it contains data I need)
Any
ideas how to get status code?
Inside
html/common/themes/body_top.jsp or whatever page status code can be
got like that : <%= response.getStatus() %>
Help
please
Or maybe I need to create some additional module, get
status code there and inject it in theme somehow?
RE: How to get http response status code into theme?
Liferay Legend Posts: 6396 Join Date: 9/23/08 Recent PostsThe way you'd typically operate is to create a specific 404 page, on
which you don't need to check for the error code.
The
code can heavily depend on server-side caching (e.g. 500 can be
triggered after half a page, if the response is not yet flushed to the
client. So you're not even guaranteed to get the correct value back.
What are you trying to achieve?
RE: RE: How to get http response status code into theme?
Junior Member Posts: 44 Join Date: 12/18/19 Recent PostsI'm trying to create custom 404 page
This question is connected
to the https://liferay.dev/ask/questions/development/session-errors-are-not-visible-inside-portal_normal-ftl