从外部表单提交,丢失POST参数

时间:2014-04-02 15:11:27

标签: java null submit wicket post-parameter

我从非wicket页面提交POST,但是当我这样做时:

IRequestParameters iRequestParameters = RequestCycle.get().getRequest().getPostParameters();

所有参数都为空

为什么呢?怎么可能呢?

这是我的扩展WebApplication的类:

公共类CnsbApplication扩展了WebApplication {

public CnsbApplication() {
    // In case of unhandled exception redirect it to a custom page
    this.getRequestCycleListeners().add(new AbstractRequestCycleListener() {
        @Override
        public IRequestHandler onException(RequestCycle cycle, Exception e) {
            return new RenderPageRequestHandler(new PageProvider(
                    new ExceptionPage(e)));
        }
    });
}

@Override
public Class<? extends WebPage> getHomePage() {
    return EntryPage.class;
}

@Override
public void init() {
    super.init();
    // add your configuration here
    mountPackage("spages", it.CheckedPlafold.class);
    mountPage("/", EntryPage.class);
}

@Override
public Session newSession(Request request, Response response) {
    return new CnsbWebSession(request);
}

如果我在没有最终斜杠的情况下调用我的页面(例如... localhost / cnsb)我的应用程序无法获取帖子参数,如果我提交到... localhost / cnsb / all works

这是我的表格:

   <form action="http://localhost:8080/cnsbWeb/" method="post">
<table>
<tr>
<td>id_tx_pagamento</td><td><input name="id_tx_pagamento" type="text" value="ASDFGHJLOR01234567891234567890123456"></td>
</tr>
<tr>
<td>codice_fiscale_richiedente</td><td><input name="codice_fiscale_richiedente" type="text" value="MRNLGU76C07L736K"></td>
</tr>
<tr>
<td>tipo_pagamento</td><td><input name="tipo_pagamento" type="text" value="CONTRATTO"></td>
</tr>
<tr>
<td>id_chiamante</td><td><input name="id_chiamante" type="text" value="I_CMS"></td>
</tr>
<tr>
<td>provider</td><td><input name="provider" type="text" value="ACTALIS"></td>
</tr>
<tr>
<td>anno_richiesta</td><td><input name="anno_richiesta" type="text" value="2014"></td>
</tr>
<tr>
<td>progressivo_richiesta</td><td><input name="progressivo_richiesta" type="text" value="7282920"></td>
</tr>
<tr>
<td>sigla_provincia_emittente</td><td><input name="sigla_provincia_emittente" type="text" value="RO"></td>
</tr>
<tr>
<td>codice_fiscale_titolare</td><td><input name="codice_fiscale_titolare" type="text" value="MRNLGU76C07L736K"></td>
</tr>
<tr>
<td>numero_codici_prodotto</td><td><input name="numero_codici_prodotto" type="text" value="3"></td>
</tr>


<tr>
<td>codice_prodotto_1</td><td><input name="codice_prodotto_1" type="text" value="DKEYIWL21C11"></td>
</tr>
<tr>
<td>codice_prodotto_2</td><td><input name="codice_prodotto_2" type="text" value="DKEYIWL22C11"></td>
</tr>
<tr>
<td>codice_prodotto_3</td><td><input name="codice_prodotto_3" type="text" value="DKEYIWL22C11"></td>
</tr>
<tr>
<td>quantita_1</td><td><input name="quantita_1" type="text" value="1"></td>
</tr>
<tr>
<td>quantita_2</td><td><input name="quantita_2" type="text" value="2"></td>
</tr>
<tr>
<td>quantita_3</td><td><input name="quantita_3" type="text" value="3"></td>
</tr>
<tr>
<td>Sha1</td><td><input name="sha1" type="text" value="9a30412fdc3a7f9b04c86fee90960c1a9f5a7328"></td>
</tr>                                                   

</table>
<input type="submit">
</form>

这是EntryPage的初始代码:

public EntryPage(){         LOGGER.debug(&#34; EntryPage&#34);

    String userTitolareCNS = null;
    String cfUserEaco = null;
    String note= null;


    IRequestParameters iRequestParameters = RequestCycle.get().getRequest().getPostParameters();

iRequestParameters参数为空或满,取决于我如何调用我提交表单的网址

0 个答案:

没有答案