I do a POST submit from a non-wicket page, but when I do:
IRequestParameters iRequestParameters = RequestCycle.get().getRequest().getPostParameters();
all the parameters are null
Why? how can it be possible?
This is my class that extends WebApplication:
public class CnsbApplication extends 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);
}
If I call my page without final slash (ex. ...localhost/cnsb) my application cann't get post parameters, if I submit to ...localhost/cnsb/ all works
this is my form:
<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>
This is the initial code of EntryPage:
public EntryPage() { LOGGER.debug("EntryPage");
String userTitolareCNS = null;
String cfUserEaco = null;
String note= null;
IRequestParameters iRequestParameters = RequestCycle.get().getRequest().getPostParameters();
iRequestParameters parameters are empty or full, depends how I call the url where I submit the form