cancel
Showing results for 
Search instead for 
Did you mean: 

Sending parameters to server error page?

oscar_san
Explorer
0 Kudos
149

Hi there

I'm using preconfigured servererror.jsp page in web.xml. I'm aware I cannot use hybris context here. How can I inject some variables like userName and other custom variables? Do I need to implement an annotated method inside a controller? Do you have an example? 

Thanks

View Entire Topic
TravisBrowne
Newcomer
0 Kudos

@oscar_sancompassmobile wrote:

Hi there

I'm using preconfigured servererror.jsp page in web.xml. I'm aware I cannot use hybris context here. How can I inject some variables like userName and other custom variables? Do I need to implement an annotated method inside a controller? Do you have an example? 

Thanks


You can pass custom variables like userName by implementing a controller with an annotated method to handle exceptions. Then, forward the request to your servererror.jsp page with the desired parameters. This allows you to inject variables as needed.