問題タブ [requesthandler]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
1348 参照

asp-classic - 従来の ASP: 実際の .asp ファイルを処理する前に、すべての要求の開始時にいくつかのコードを実行します。

これは従来の ASP であり、IIS 8.5 で実行されます。

これらの *.asp ファイルへのすべての Http 要求の開始時に、すべての *.asp ページに共通の VBScript を実行する必要があります。

現在#include、すべての *.asp ファイルの先頭にタグを使用しています。実行したいコードを含むファイルを参照します。

これはうまく機能しますが、見苦しく危険です。*.asp ファイルの 1 つに#includeタグがない場合、コードは実行されません。

すべての *.asp ファイル内にコードを記述せずに、すべての *.asp 要求に対してコードを実行する方法はありますか?

In ASP.NET we have the HttpApplication.BeginRequest event. What I'm looking for is something equivalent to that, but in Classic ASP. I need to run some VBScript that is able to access the Classic ASP objects at the beginning of every *.asp request.

Edit: as per @Kul-Tigin request, this is the reason that I want to do it: My *.asp files are encoded in ANSI. But the URL requests comes encoded in UTF-8, which generate problems.

If I do nothing, the ASP engine decodes the url (and query strings) as if they were in ANSI. For instance: a query string ?value=ç will be sent by the browser as ?value=%C3%A7. C3A7 are the bytes for 'ç' encoded in UTF-8. But the ASP engine reads the 2 bytes as 2 separate ANSI chars. So, if I do nothing, the Request.QueryString("value") will be a string with length 2, with the content "ç".

To fix this, I created the following workaround, which WORKS:

I don't care about the "foo" query string, it may not even exist. I just do that to "touch" the ASP Query String deserialization engine. Aparently it decodes the all the query string values at the first time it is used during the request processing. So, even after setting the CodePage back to 1252, in my previous example, if I read the concrete query string Request.QueryString("value") it will be a length 1 string containing "ç", as intented.

I have put the workaround code in a workaround.inc file, and have included it at the beginning of most of my *.asp files, which solved the problem for now. But there are more than a thousand *.asp files, and more yet to be developed. It's impossible to make sure all of them are including the workaround.inc, that's why I wanted to run the code for all *.asp requests regardless of an include tag.

I appreciate your concern for my problem. If you can present a better solution I would be really happy. Thank you!

0 投票する
1 に答える
527 参照

python - トルネード ループ スタートを実行せずに torando Request Handler 関数を呼び出しますか?

アプリケーションの外部から tornado サーバーを実行する前に、リクエスト ハンドラーの get 関数の出力を保存する必要があります。

例:-

クラス Test(RequestHandler):

外部からトルネード ループ サーバーなしで get 関数を呼び出す必要があります。出来ますか ?折り返しはありますか。助けてください。

ありがとう

0 投票する
2 に答える
1055 参照

python - フラスコを使用したマルチリクエストの並列処理

上記のプログラムでは、実行後に最初のリクエストと 2 番目のリクエストが実行されます。しかし、フラスコなどを使用して、特定の時間に複数のリクエストを並行して受け入れ、実行し、応答するようなサーバーを作成したいと考えています。

これはどうやって作るの?

0 投票する
1 に答える
78 参照

json - Solr でのファイルの送信

Request-Handler が/updateの場合にドキュメントを Solr に送信しているときに、csv ファイルと json ファイルは送信できませんが、xml ファイルは送信できます。

Request-Handler を/update/extractに変更しました。csv、json、xml ファイルを送信できるようになりました。しかし、問題は、クエリを実行すると、ファイル内のものではなく、ファイルに関する情報が表示されることです。

出力を確認できます: https://ibb.co/eoTQaF

今、csv、json、xml ファイルを送信したいのですが、ファイルの内容も見たいです。何か考えはありますか??