0

我从非检票口页面进行 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/ 一切正常

这是我的表格:

   <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的初始代码:

公共 EntryPage() { LOGGER.debug("EntryPage");

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


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

iRequestParameters 参数是空的还是满的,取决于我如何调用提交表单的 url

4

0 回答 0