Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Submitting a form using POST
Submitting a form using POST [message #1232135] Thu, 16 January 2014 04:40 Go to next message
Devesh Mishra is currently offline Devesh Mishra
Messages: 20
Registered: June 2013
Junior Member
Requirement:

1) Create a form with user id and password in HTML file say login.html
2) The submit button should submit the form using POST method.

<form name"login" method="post" action="http://localhost:8080/MyApp/rwt">
	<input type =text name=userid />
	<input type =password name=password />
	<input type="submit" />
</form>


Expected Output:
Form should be submitted with the data.

Actual Output
org.eclipse.rap.json.ParseException: Unexpected end of input at 1:0
	org.eclipse.rap.json.JsonParser.error(JsonParser.java:316)
	org.eclipse.rap.json.JsonParser.expected(JsonParser.java:310)
	org.eclipse.rap.json.JsonParser.readValue(JsonParser.java:74)
	org.eclipse.rap.json.JsonParser.parse(JsonParser.java:33)
	org.eclipse.rap.json.JsonValue.readFrom(JsonValue.java:88)
	org.eclipse.rap.json.JsonObject.readFrom(JsonObject.java:99)
	org.eclipse.rap.rwt.internal.protocol.ProtocolUtil.getClientMessage(ProtocolUtil.java:66)
	org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.isSessionShutdown(LifeCycleServiceHandler.java:227)
	org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:77)
	org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:66)
	org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:119)
	org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:106)
	org.eclipse.rap.rwt.engine.RWTServlet.doPost(RWTServlet.java:99)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
	com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
	com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
	com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
Re: Submitting a form using POST [message #1232139 is a reply to message #1232135] Thu, 16 January 2014 04:52 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1794
Registered: July 2009
Senior Member
Hi,
which RAP version are you using. RAP application can't be started with a
POST request - see:
416445: Adding ability to start RAP application with HTTP POST request
https://bugs.eclipse.org/bugs/show_bug.cgi?id=416445
Currently, all POST request to RAP application *must* contain JSON
protocol message [1].
Since RAP 2.1.1 (including 2.2) POST request that have a content-type
different than "application/json" will lead to HTTP 400 response. See:
413668: Cross Site Request Forgery vulnerability (aka CSRF/XSRF)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=413668

[1] http://wiki.eclipse.org/RAP/Protocol
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Submitting a form using POST [message #1232148 is a reply to message #1232139] Thu, 16 January 2014 05:05 Go to previous message
Devesh Mishra is currently offline Devesh Mishra
Messages: 20
Registered: June 2013
Junior Member
Thanks, I am using the RAP 2.1. Do we have a workaround ?

Previous Topic:How to make custom widgets themeable?
Next Topic:RAP Protocol question
Goto Forum:
  


Current Time: Fri Aug 29 01:43:29 EDT 2014

Powered by FUDForum. Page generated in 0.01654 seconds