custom-error-pages

How to get Prestashop current user id?

本秂侑毒 提交于 2019-12-22 05:31:19
问题 I used the below code to try to get the current user ID in prestashop.. am placing this code in another php file in my module directory and call it through by the module file. $id = $this->context->customer->id_customer; but its not working for me.. am using prestashop 1.5 .. 回答1: I certainly couldn't get it to work in my test either. However, you can try $id = (int)$this->context->cookie->id_customer; which works for me. I'm not at all sure that this is the best way to do it though. 回答2:

Asp.net 4.0 : How to get exception details in custom error page?

痴心易碎 提交于 2019-12-22 05:05:00
问题 We are using custom error provided by asp.net config setting. In entire application (PL/BLL/DAL) we are not using any try catch. So for any exception in any layer application redirect user to custom error page set in custom error setting in config file. Now we want to log following information in log file before showing error page: - Date & time - Exception message & strack trace. - Page Name - Method Name - Method Parameter & values. Please help me how to collect above information in custom

How to access HTTP StatusDescription in custom error page

岁酱吖の 提交于 2019-12-21 21:29:30
问题 When an action (asp.net mvc 5) cannot find something in the database, the user must see a page with a short custom error message e.g. "Invoice 5 does not exist" . Also, the response must have a 404 HTTP code. Another example: when the action is improperly called, the user must see e.g. "Parameter 'invoiceId' is required" . Also, the response must have a 400 HTTP code. I tried to store the custom messages in the HTTP status description and to display them in custom error pages. There are two

Is it possible to submit a form that has been rendered from a JSF page location in WEB-INF?

…衆ロ難τιáo~ 提交于 2019-12-20 07:28:36
问题 The JSF 2.2 web based application I am developing makes use of various error pages which are located in the WEB-INF directory and are displayed when an HTTP error or Java exception is encountered based on the configuration in the web.xml file. On some error pages I would like to include a form which allows the user to report the issue and include various attributes that would be helpful when investigating the issue such as the request URI and the error message. The issue I've got is when the

Python flask web application with multilanguages support by host and prefix

天涯浪子 提交于 2019-12-18 05:17:08
问题 I have one server with flask application instance and have several domain which mapped to this server by DNS. My site must support several languages by host and prefix: mysite.com - english mysite.com/fr - franch mysite.ru - russian mysite.ru/by - belarusian localhost or other unknown host without language prefix - default language (english) I implemented it with double route registration /endpoint and /<lang>/endpoint and reloaded url_for function and it work, but now I must implement custom

<error-page> tag in web.xml doesn't catch java.lang.Throwable Exceptions

狂风中的少年 提交于 2019-12-17 20:28:19
问题 I have a web-app developed with servlet & JSP. I configured my app to throw an IllegalArgumentException if I insert bad parameters. Then I configured my web.xml file in this way: <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.jsp</location> </error-page> When I rise a 404 error , then it works and calls error.jsp , but when I rise a java.lang.IllegalArgumentException ,

Configuring custom ASP 404 page with redirect for IIS7 website

被刻印的时光 ゝ 提交于 2019-12-17 17:08:02
问题 We're migrating an existing website from IIS6 to IIS7, but are experiencing some difficulty in setting up the 404 error page. Our 404-errorpage works like this: A custom ASP-page checks the URL against a short list of 'special' URLs (e.g. http://example.com/limited-offers). If the URL is known, it redirects to the actual URL of that page. Otherwise the visitor is redirected to a static errorpage with a 404-statuscode. With IIS6 this worked as advertised, but with IIS7 some things have changed

Rewrite URL after redirecting 404 error htaccess

不想你离开。 提交于 2019-12-17 06:28:08
问题 So I know this may seem a little strange but I for sake of consistency, I would like all my urls to appear in this form: http://domain.com/page/ So far I have gotten the regular pages working but I cannot seem to get the error pages working properly. If the user visits a page or directory that does not exist, I would like the browser to hard redirect to: http://domain.com/404/ This directory, however, will not actually exist. The real location of the error page will be under /pages/errors/404

How to specify the default error page in web.xml?

不羁岁月 提交于 2019-12-16 21:19:21
问题 I am using <error-page> element in web.xml to specify the friendly error page when user encounters a certain error such as error with code of 404: <error-page> <error-code>404</error-code> <location>/Error404.html</location> </error-page> However, I want that if the user does not meet any error code specified in <error-page> , he or she should see a default error page. How can I do that using the element in the web.xml ? 回答1: On Servlet 3.0 or newer you could just specify <web-app ...> <error

htaccess file deny from all, redirects to 404 not found on 403.shtml but no custom error pages defined

耗尽温柔 提交于 2019-12-13 12:15:21
问题 I'm setting up a quick internal project in a new addon domain in cPanel. This particular one has an SSL cert installed. I was building my .htaccess up and added a <Files config.php> directive to deny from all so that my config.php file isn't accessible. I realise that storing it outside of the web root is the ideal but I can't in this case. Normally I would expect that when going to www.domain.com/config.php in a browser that I would get Apache's default 403 Forbidden page. This is what