屋外でJavaベースのWebスクリプトを実行しようとしています。私の最初のステップでは、応答出力ストリームを使用して「hello world」を出力したいだけです。私が直面する主な問題は、コードが実行されていないことです。コードにブレークポイントを設定しようとしましたが、トリガーされません。結果としてプレーンftl。
abstratWebscript 応答を ftl よりも優先すべきではありませんか? 誰かが私が間違っていること、またはこれがabstractwebscriptの自然な動作であるかどうかを教えてもらえますか?
これは Java クラスです。
package com.beam.gbsprocs.tag.webscript;
import java.io.IOException;
import java.io.PrintWriter;
import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
public class GbsprocsTagWebscript extends AbstractWebScript {
@Override
public void execute(WebScriptRequest req, WebScriptResponse res)
throws IOException {
PrintWriter out = new PrintWriter(res.getOutputStream());
out.println("hello world");
out.close();
}
}
これは記述ファイルです
<webscript>
<shortname>Perform GBSprocs Tag completion</shortname>
<description>Export gives a json list of posible tag values </description>
<url>/gbsprocs/tag</url>
<authentication>user</authentication>
</webscript>
Bean 宣言 (版で追加):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<bean id="com.beam.gbsprocs.tag.webscript.GbsprocsTagWebscript.get"
class="com.beam.gbsprocs.tag.webscript.GbsprocsTagWebscript"
parent="webscript">
</bean>
</beans>
ftl は次のようになります。
Hello from ftl.
実行結果: クライアントの応答を停止します