Hi,
We created a method in the form to get the parameters sent by other application. We can access this method via “http://host/servoy-webclient/solutions/solution/iglass/method/acceptURLparams/argument/123” (“iglass” is the servoy application name, “acceptURLparams” is the method name and “123” is the parameter). After typing this url in the browser it will go to the servoy application login page first then load the main form if the user name and password are correct.
As we don’t want to type the real url(mentioned above) to access, we wrote a servlet to redirect the request. We want to type an url like “http://host/iglass?id=123” then the servlet can catch this url and then forward it to the real url using java code:
But this proxy servlet failed after it forwarded the request. In the generated servoy web page there are some included javascript files, such as "src=“resources/wicketevent/…”. After the servlet forwarded the request, these javascript files’ url changed to “http://host/resources/wicketevent/…”, which should be “http://host/servoy-webclient/resources/wicketevent/…” so that the resources cannot be found due to the wrong path.
There is no way to change the servoy web page content in java code to work around this problem. Can someone tell us how to make this working?
Last week we did something like a redirect to a deeplink via a very small & simple php page which runs from a subfolder in our website…
If you’re interested I could drop you some codesnippets for this.
Thank you for your reply.
Our problem is that an external application will launch our servoy application using “POST” on their side. They would have a http form and post a string(could be very long. This is the reason we need use “POST”) in the request.
Now our servlet can catch this request but we cannot forward it successfully due to the path change.
If you have done the similar thing I would appreciate your help.
What we wanted to do is have an external login form, so that once people get to that webpage they wouldn’t automatically enter the Servoy solution. This would cost us a license each time.
So basically this is code for the login form:
Unfortunately I don’t know anything about jsp, but when you can open a webpage with some sort of command and stick to the way a deeplink should be formatted, it shouldn’t be any problem…
This is the actual execute from the redirect, using a deeplink.
happytigger:
you POST the request or “GET”? This is important to us.
As you can see in the first part of the code (the html form), the form fields are send to the second part of the code using ‘post’ method.
The second code catches all the information being send with ```
$solution = $_POST[“solution”];
This could be done using the 'get' method as well.
This is the actual execute from the redirect, using a deeplink.
> happytigger:
> you POST the request or "GET"? This is important to us.
As you can see in the first part of the code (the html form), the form fields are send to the second part of the code using 'post' method.
The second code catches all the information being send with ```
$solution = $_POST["solution"];
This could be done using the ‘get’ method as well.
Although the initial request is made via POST, when you are doing a redirect by using the Location header in PHP the second HTTP request will be made using a GET. As happytigger pointed out a GET won’t work for the case when you’re passing in many arguments (ie. an array) which exceeds the URL length limit (somewhere just over 2000 characters.)