Wicket 6 JavaScript引用不在脑海中

时间:2016-08-22 15:02:46

标签: javascript migration wicket-6

我正在努力将应用程序从Wicket 1.4迁移到Wicket 6.一个页面没有响应,我认为这是由于缺少JavaScript文件引起的。

该文件存在于Java包中。在原始应用程序中,该文件将在同一包中的向导步骤中添加。出于调试目的(我不确定丢失的文件是否会导致问题)我转而调用另一个包中的应用程序抽象页面。

以下调用添加到 protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //i'm using a datatable for storing all the data DataTable dt = new DataTable(); string query = "select * from Course inner join textBooks on textBooks.CourseID = Course.CourseID"; //wrapping in 'using' means the connection is closed an disposed when done using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["HUTDMSConnectionString"].ToString())) using (SqlDataAdapter adapter = new SqlDataAdapter(query, connection)) { try { //fill the datatable with the contents from the database adapter.Fill(dt); } catch { } } //save the datatable into a viewstate for later use ViewState["allBooks"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); } } 的覆盖中。其中已包含正确添加且包含renderHead的文件。

super.renderHead

脚本标记存在于html体中而不是头部中。

我检查过脚本是否存在于script-tag中链接的位置。但似乎不可能在html-head中呈现它。

1 个答案:

答案 0 :(得分:1)

结果是使用了JavaScriptFilteredIntoFooterHeaderResponse和wicket输出中的错误,因为wicket处于DEVELOPMENT模式而不是DEPLOYMENT模式。当wicket处于DEPLOYMENT模式时,代码已正确添加到页脚,并且它也正常工作。