How to set up the conditions to test web pages for HTTP status codes 403, 404, 500, 503 - http-status-code-404

I developed a web application with Java (Struts 2) and Web Experience Toolkit (WET - https://github.com/wet-boew/wet-boew), which is running on the WebLogic 12c server.
When any one of the HTTP status codes 403, 404, 500, 503 occurs, my web application will display a corresponding web page.
e.g. When the HTTP status code 503 occurs, my web application will display the web page 503.html.
How to set up or simulate the conditions to test my web application web pages for HTTP status codes 403, 404, 500, 503?
i.e. simulate the HTTP status codes 503, etc so as to test my web application UI to ensure that 503 is handled properly, assuming that the webserver works properly.

Related

What HTTP status code to use for 'account required' pages?

I run a site where some pages require a free account to access. I'm noticing a large number of soft 404s in Webmaster Tools coming from these pages. What is the correct status code to pass for these pages?
I would recommend that a '403: Forbidden' status code would be the most acceptible in this situation. Wikipedia says
"A typical request that may receive a 403 Forbidden response is a GET
for a web page, performed by a web browser to retrieve the page for
display to a user in a browser window. The web server may return a 403
Forbidden status for other types of requests as well."

Error Uploading image to google cloud storage from Google app engine php app

I am trying to upload images to Google cloud storage using CKeditor4.3.3 image2 plugin from google engine app (php).
POst method return 303 status.
GET returns:
Request URL:http://temporary-blobstore-error.appspot.com/
Request Method:GET
Status Code:500 Internal Server Error
Request Headersview source
I get the following error displayed fromhttp://temporary-blobstore-error.appspot.com/:
Error: Server Error
The server encountered an error and could not complete your request.
Please retry your last submission.
If the problem persists, please contact the person responsible for the application you're using, or, if you are that person, report your problem and mention this error message and the query that caused it.
Following is the Request URL:
[http://v01.mysite.appspot.com/_ah/upload/?aa=ask&cat=2/AMmfu6aYRdoHF3NpG27hJRWyx-RH_Vo5r6NhzqyIK-3YRw7I3OHv_zq6SUYElQKg3phbtFu6GIG_MnltZjS03xNPSDKfA-dmsabvdvdmavdmavmvamdsvmdVMDVAMVmadva-e_rmabsmdvdmsdbmsdbmabdmasbdmasbdmsmdYR2MuM7rBb6dEttPzPYVylmw9/ALBNUaYAAAAAUy-nio2CLZdkumm87rKdUq9oOz1hVJgN/&CKEditor=content&CKEditorFuncNum=0&langCode=en][1]

Status Code 503, Requested service is not available yet

I am using spring mvc(annotations). I have written backends. When tasks start running,
retry count goes on increasing, It shows status code '503' and message 'service unavailable'.
When I hit backend url into browser, I got the same error after hitting many times then getting correct response.
Is there any solution for this..?

Reading file from GDrive (on Google App Engine) httperror 500

Trying to read file from GDrive (api v2) on (Google App Engine) and getting error:
HttpError: <HttpError 500 when requesting https://www.googleapis.com/drive/v2/files?alt=json&key=XXXXXXXXXXXXXXXXXXXXXXX-anao2UgM returned "">
Yesterday (2014-01-22) all worked fine but today getting error. Anyone had same issue?
check for mixed message content error i.e. that is when you send the data from secured site to non-secured site means data passing from https to http site although very few browser have that capability .
Do reply if it helps you

A simple Cron job on frontend servers and no backends. Fails

I configured a simple cron job available at secure(admin only) path /cron?method=sendMail to send an email once daily. The servlet at the endpoint of the url is a jsp file which has the code to send the email.
This is tested through the frontend with the full url and it works.
I do not have any backend servers configured. Only frontend instances with 1 resident and dynamics.
The issue is that cron triggers successfully but the request fails with the following message.
0.1.0.1 - - [17/Nov/2013:01:07:44 -0800] "GET /cron?method=sendMail HTTP/1.1" 503 364 - "AppEngine-Google; (+http://code.google.com/appengine)"
This request is getting retried continuously and keeps failing.
The complete url however works. What is wrong with the setup? what am I missing?
Also, how do I stop the retries?
The cron entry I use goes like
<cron>
<url>/cron?method=sendMail</url>
<description>Send mail</description>
<schedule>every mon,tue,wed,thu,fri,sat,sun 11:30</schedule>
<timezone>Asia/Calcutta</timezone>
</cron>
The issue was resolved using the following tip from the documentation to secure the url
Requests from the Cron Service will also contain a HTTP header: X-AppEngine-Cron: true
The X-AppEngine-Cron header is set internally by Google App Engine. If your request handler finds this header it can trust that the request is a cron request. If the header is present in an external user request to your app, it is stripped.

Resources