Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Browser.setUrl(String, String, String[]) not sending post data(That method does not send POST data properly)
Browser.setUrl(String, String, String[]) not sending post data [message #1696785] |
Thu, 28 May 2015 14:37 |
Pepe Lotas Messages: 2 Registered: May 2015 |
Junior Member |
|
|
Hi!!
Using the "setUrl(String, String, String[])" function in the "org.eclipse.swt.browser.Browser" class does not send POST data
I have a class with this code:
public class PruebaPost {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(2, true));
final Browser browser;
try {
browser = new Browser(shell, SWT.NONE);
} catch (SWTError e) {
System.out.println("Could not instantiate Browser: " + e.getMessage());
display.dispose();
return;
}
GridData data = new GridData(GridData.FILL_BOTH);
data.horizontalSpan = 2;
browser.setLayoutData(data);
browser.setUrl("http://localhost:8080/test/test.jsp?paramOne=One¶mTwo=Two");
//browser.setUrl("http://localhost:8080/test/test.jsp","paramOne=One¶mTwo=Two",null);
shell.setBounds(10,10,600,600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
I have an Apache tomcat with the "test" project, with the "test.jsp" page, which just has inside something like:
Param One:<input type="text" value="<%=request.getParameter("paramOne")%>"/>
Param Two:<input type="text" value="<%=request.getParameter("paramTwo")%>"/>
When I launch it, it works flawlessly, however, when I change this lines:
browser.setUrl("http://localhost:8080/test/test.jsp?paramOne=One¶mTwo=Two");
//browser.setUrl("http://localhost:8080/test/test.jsp","paramOne=One¶mTwo=Two",null);
so the data is sent using POST method, it does not work, I mean, the "test.jsp" page is called and it loads, but, the params are null.
I use "httpanalyzer" as a http traffic sniffer, and I can see there that the parameters are being sent!!! It is SO weird!!
I tried it using:
- Eclipse Helios (which uses the "org.eclipse.swt.win32.win32.x86_3.6.0.v3650b.jar")
- Eclipse Luna (the latest release, which uses "org.eclipse.swt.win32.win32.x86_3.103.2.v20150203-1351.jar")
- Eclipse 3.2 (which uses "org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.jar") but this one does not support POST data
However, I tried this example here:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet330.java
And it does work... but that is not a JSP, it is a CGI...
Is there a way I can use it receiving through POST the parameters in a JSP ?
Thaks a lot in advance!!
[Updated on: Fri, 29 May 2015 06:43] Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 13:34:26 GMT 2024
Powered by FUDForum. Page generated in 0.02971 seconds
|