logout to expire page on webclient

Forum to discuss the Web client version of Servoy.

logout to expire page on webclient

Postby Harjo » Thu Oct 21, 2010 10:45 am

In Servoy 3.5 we have logout method that works great:

Code: Select all
function logout()
{
   var serverUrl = '/servoy-webclient/templates/default/expired.html'
   application.showURL(serverUrl)
   application.exit()
}


the user can really logout his session, and will be directed the expired.html page. On that page, we have login, button so he can login back again.
So the customer has total control, over how many licenses he uses, so far so good.

In Servoy 5 webclient, this function is working differently!
after pressing this logout button, the browserpage where you see the solution, gives a message in red: Error calling server, and the expired.html is force to upen in a popup! (with all the warning issue about popups, that comes with firefox, safari, chrome, etc..)

Anyone know how to solve this?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: logout to expire page on webclient

Postby jcompagner » Thu Oct 21, 2010 2:30 pm

application.showURL(serverUrl, "_self")

default is "_blank"
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: logout to expire page on webclient

Postby Harjo » Thu Oct 21, 2010 2:33 pm

ah! thanks, will try that!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: logout to expire page on webclient

Postby Harjo » Thu Oct 21, 2010 2:53 pm

and working! :-)

Thanks Johan.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: logout to expire page on webclient

Postby bobpee » Tue Nov 02, 2010 3:27 pm

Hi Johan,

I am having a similar situation like Harjo had, except that doing something like :

Code: Select all
if (application.getApplicationType() == APPLICATION_TYPES.WEB_CLIENT) {
      application.showURL('http://www.mydomain.nl', "_self");
      application.exit();
   }


as suggested doesn't work for me. I am instead getting the following server error on my Admin 'Server Log' :

org.mozilla.javascript.WrappedException: Wrapped com.servoy.j2db.Zgf: Application exit (myappl_exit_method#377)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1828)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:199)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at script.audit_auditlogout_write_applicationtype(myappl_exit_method:377)
at script.onClose(onClose:10)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196)
at com.servoy.j2db.Zwb.Za(Zwb.java:741)
at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
at com.servoy.j2db.Zcc.Za(Zcc.java:1)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:156)
at com.servoy.j2db.server.headlessclient.dataui.Zzd.onEvent(Zzd.java:7)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:286)
at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at com.servoy.j2db.server.servlets.Zk.doGet(Zk.java:4)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Caused by: com.servoy.j2db.Zgf: Application exit
at com.servoy.j2db.scripting.JSApplication.js_exit(JSApplication.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
... 42 more


It looks like a call to 'application.exit()' is doing something unexpected. I can't tell what's happening - we've used this code over and over again and it worked fine until recently. We're still using 'Servoy 5.1.4 - build 964', but I don't suppose that that is the issue. Or?
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Re: logout to expire page on webclient

Postby bobpee » Tue Nov 02, 2010 3:40 pm

I am further getting the following in addition on my Admin 'Server Log' :
2010-11-02 14:02 http-8088-2 INFO com.servoy.j2db.util.Debug DECODE an ajax request url: servoy-webclient/?x=4x*3uyWTU*w44UFADQgZkWqlPm8ChilAwEVC8lHTOf2-1RMCM2e0dqh8ZHK2midM&ignoremp=true&random=0.7843796104761412 with session: 72E5D75C10BEF3EE7CD8C74B39B54715 Aborting.
2010-11-02 14:02 http-8088-4 INFO com.servoy.j2db.util.Debug DECODE an ajax request url: servoy-webclient/?x=4LYoBxWg0qaiO2W*69LuVefquHIj-bqu&random=0.778295247730609 with session: 72E5D75C10BEF3EE7CD8C74B39B54715 Aborting.


First, the logout - application.exit() - was not successful, and then it was followed by the above logging.
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Re: logout to expire page on webclient

Postby jcompagner » Tue Nov 02, 2010 3:47 pm

exit() is doing exactly what it should do an throw an exception
you shouldnt get that in the log (it should be ignored completely)

what is what the client gets?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: logout to expire page on webclient

Postby bobpee » Tue Nov 02, 2010 3:55 pm

The client is expected to goto the URL http://www.mydomain.nl, but this time around, it doesn't do it - the client just stays in the solution. I occasionally see a 'server error..' (something like that) , flash on the webclient and then thats it, the redirection to 'http://www.mydomain.nl' doesn't happen anymore.
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Re: logout to expire page on webclient

Postby jcompagner » Tue Nov 02, 2010 4:02 pm

can you test your solution with 5.2.2 to see if it works?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: logout to expire page on webclient

Postby bobpee » Tue Nov 02, 2010 6:25 pm

Thnx Johan, for the feedback. l shall do a test with a ver. 5.2.2 - most likely tomorrow - and see what happens - I shall post back thereafter.
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Re: logout to expire page on webclient

Postby bobpee » Wed Nov 03, 2010 4:44 pm

Hi Johan,

Unfortunately, I am unable to use any of Servoy's latest installers (both the .exe and the .jar) to install Servoy 5.2.2 on a Windows Server 2003, in order to test this issue of

Code: Select all
application.showURL('http://www.mydomain.nl', "_self");
and
Code: Select all
application.exit();
not working.

There seems to be issues with the current Servoy installers working on a Windows Server 2003, unless there is something I am missing - the installers are unable to create db files/sub-folders in the "\application_server\database" folder after an install - the later work fine at least on Vistas and XP machines. The experience I have been writing about here was realized on a Windows Server 2003 machine - that would be the right place to do a test run with a 5.2.2.

Would appreciate a feedback, 10q.
Last edited by bobpee on Thu Nov 04, 2010 11:30 am, edited 1 time in total.
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Re: logout to expire page on webclient

Postby jcompagner » Thu Nov 04, 2010 10:47 am

in what directory do you install servoy in 2003?
c:\program files?

dont do that. it has to be out of the program files dir so some other dir that it has full read and write rights.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: logout to expire page on webclient

Postby bobpee » Thu Nov 04, 2010 11:13 am

I used to install in 'C:\Program Files\Servoy\', you are right. However,I just changed that to 'C:\Servoy\' after an uninstall and a fresh install
- the behavior is still the same on a Windows Server 2003. The ''C:\Servoy\application_server\database'' folder is still empty after the install.

It looks like the install script is breaking somewhere on this OS.
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Re: logout to expire page on webclient

Postby lvostinar » Thu Nov 04, 2010 11:22 am

Do you have the right to write in that folder (database)? Do you have any error in application_server\postgres_db\postgres_log.txt ?
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: logout to expire page on webclient

Postby bobpee » Thu Nov 04, 2010 11:37 am

Yes,i have access right to the 'database' folder. This is the message in the "\application_server\postgres_db\postgres_log.txt" file after the install
postgres cannot access the server configuration file "C:/Servoy/application_server/database/postgresql.conf": No such file or directory
Bob Prah,
[Servoy 5.2.4 - build 1006]
User avatar
bobpee
 
Posts: 81
Joined: Tue Mar 04, 2008 1:05 pm

Next

Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 20 guests

cron