Thank you, it works now :handshake:
For reference, my Input class now includes:
@Inject
private RequestGlobals requestGlobals;
@OnEvent(value = "onMobileSubmit")
public StreamResponse onMobileSubmit()
{
HttpServletRequest request =
requestGlobals.getHTTPServletRequest();
this.username = request.getParameter("username");
this.password = request.getParameter("password");
//etc... manually reading out the parameters the "normal" form
on this
page would have set
String result = "";
try
{
onValidateForm();
onSuccess();
result = "OK";
}
catch (ValidationException v)
{
onFailure();
result = v.getMessage();
}
final String answer = result;
return new StreamResponse()
{
public String getContentType()
{
return "text/html";
}
public InputStream getStream() throws IOException
{
return new
ByteArrayInputStream(answer.getBytes());
}
public void prepareResponse(Response arg0)
{
}
};
}
which i can call directly as localhost:8080/xxx/input:onMobileSubmit from my
mobile app while posting the parameters.
Howard Lewis Ship wrote:
>
> If you use a Form component, you need the t:formdata.
>
> If you don't use Form (and therefore, don't use TextField, Select,
> etc.) you can easily submit directly into a component event handler
> method; it's a step back towards servlet-style coding, where you
> inject the Request and pull parameters out to do with as you please.
>
--
View this message in context:
http://www.nabble.com/T5%3A-how-to-circumvent-t%3Aformdata-tp21668917p21681883.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]