cancel
Showing results for 
Search instead for 
Did you mean: 

Webclient URL after page refreshes

frederick
Champ in-the-making
Champ in-the-making
Hello,

I recently added a new jsp file to Alfresco containing a Wiki engine. This page should work similar to browse.jsp and forums.jsp.

There seems to be a problem with the URL however: the webclient opens the wiki.jsp page using a navigation rule, but the contents of that page (relative hyperlinks, images etc) do not work.
The address in my browser also still shows browse.jsp instead of wiki.jsp. Only by triggering a page refresh (eg. by collapsing the clipboard) does the correct URL show, and will the images and links work.

Is this a known issue, and if so, does a workaround exist?

Many thanks,
Frederick
3 REPLIES 3

kevinr
Star Contributor
Star Contributor
This is an artifact of the MyFaces JSF UI component implementation we are using. It might be worth taking a look at the Apache MyFaces documentation or posting to their mailing list to see if there's a way around this.

Thanks,

Kevin

frederick
Champ in-the-making
Champ in-the-making
Thanks for the information Kevin!

After looking around for a while, I found and edited a piece of Javascript which solves my problem: it reloads the page once using URL rewriting.

<script>
   var reloaded = false;
   var loc=""+document.location;
   loc = loc.indexOf("reloaded=")!=-1?loc.substring(loc.indexOf("reloaded=")+9,loc.length):"";
   loc = loc.indexOf("&")!=-1?loc.substring(0,loc.indexOf("&")):loc;
   reloaded = loc!=""?(loc=="true"):reloaded;
   
   function reloadOnceOnly() {
      if (!reloaded){
         var loc=""+window.location;      
         var url = loc.replace("browse/browse.jsp","wiki/Wiki.jsp");
         if (url.indexOf("?")!=-1){ url += "&reloaded=true"; }
         else { url += "?reloaded=true"; }
         window.location.replace(url);
      }
   }
   reloadOnceOnly();
</script>

kevinr
Star Contributor
Star Contributor
Thanks for posting that, it may be useful for others also.

Kevin