Re: [Xsltforms-support] Problem using submission
Brought to you by:
alain-couthures
From: Javier D. <jd...@ge...> - 2009-11-20 11:27:54
|
Hello, we have changed the constructURI javascript function to create relative uris correctly: constructURI : function(uri) { if (!uri.match(/:\/\//)) { var relativ = document.location.href; var pos = relativ.indexOf("?"); relativ = relativ.substring(0,pos); pos = 0; if (uri.indexOf("/")==0) { for (i=0;i<3;++i){ pos = relativ.indexOf("\/",pos); ++pos; } uri = relativ.substring(0,--pos)+uri; }else { uri = relativ.replace(/[^\/]+$/,"") + uri; } } return uri; } If uri starts with /, we generate the url with the "protocol://host:port/" + uri, and if not, we do the same you were doing but taking out the query part of the uri. I hope it may be useful for anybody. Best Regards, Javier Javier Díaz escribió: > Hello, > My answer, below. > > COUTHURES Alain escribió: >> Hello Javier, >>> Hello, >>> >>> I have a xform with the following submission: >>> >>> <xf:submission id="s01" method="post" replace="all" >>> action="*/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM*"> >>> <xf:message level="modeless" >>> ev:event="xforms-submit-error">Submit error.</xf:message> >>> </xf:submission> >>> >>> That is get through the following url: >>> >>> https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms >>> >>> When I use the submit that triggers the action of above, I get that >>> the page that is requested is: >>> >>> https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/*/nucleo?FILE=pruebas/entornoReq.xml&GEREMIAS_RESPUESTA=whitehtml&XML=XFORM >>> >>> *¿Is this a bug or a feature? >> This is clearly not yet supported to have an action attribute value >> starting with / ... Have a look at constructURI method of Core class >> to add this feature (this should not be difficult in fact!) and I >> will integrate your fix in XSLTForms. > Ok, I will investigate with constructURI. > > But I think the behaviour of the construction of the uri is also a bit > strange in the case that action does not start with / and is a > relative one. I mean, I you have an url like this: > > https://tuerca:8080/nucleo?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms > > to construct the relative path to send a submit should be used taking > out the query part of the url, in this case > "?FILE=pruebas/javi/xforms/pai-ip.xml&GRM_RESPUESTA=xsltforms", so the > url constructed (without taking into account the initial /) should be, > from: > > nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM > > the following: > > https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM > > or in case you have subdirectories, from > "https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM", > the absolute uri of > "nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM" > should be: > > "https://tuerca:8080/subdir1/subdir2/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM" > _ > _In this last example, if we had as relative uri > "/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM", > the absolute uri should be: > > "https://tuerca:8080/nucleo?FILE=pruebas/entornoReq.xml&GRM_RESPUESTA=whitehtml&XML=XFORM" > > Am I missing something? I will try to change constructURI to have this > behaviour, I suppose it fits better with RFC 3986 > <http://tools.ietf.org/html/rfc3986> (see section 5.2). > > Best Regards, > Javier >> >> Thanks! >> >> -Alain >> > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > ------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |