Skip to Content
avatar image
Former Member

Invalid URL Exception while opening a file using external window in webdynp

I am trying open an URL ythru external window on click of button in my webdynpro.

This is the URl I am trying to open

File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG

if I try to open from a from the browser it works fine but thru webdynpro it is throwing the error.

mww is another system where the file is residing.

But I am using the same techniue in other component where I am able to open file from an external window.

File://mww/Documents/Attachments/2008/10/56254/some.jpg

The only difference in the URL is {FD803B0D-157F-47F9-A5A8-C687E1DC6B96}Since this URL is generated by another system I do not have any other aletrnative but I have live with this URL.

can some body please give some idea how to fix this

if I use java.net.URLEncoder.encode() then I am not getting any error , buit file is not opening in the browser( external window)

below is the error stack I am getting.

com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG

at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.checkURL(AbstractURLGenerator.java:699)

at com.sap.tc.webdynpro.services.sal.url.core.URLGeneratorInternal.checkURL(URLGeneratorInternal.java:390)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createNonModalExternalWindow(ClientComponent.java:1037)

at com.gis.dcww.findsrch.AttachmentView.onActionOpen_Attachement(AttachmentView.java:179)

at com.gis.dcww.findsrch.wdp.InternalAttachmentView.wdInvokeEventHandler(InternalAttachmentView.java:203)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)

thanks

PK

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 11, 2009 at 04:40 PM

    Well, i think you are trying to open an image from a Internet in a external window, well try with this code

    IWDWindow window = wdComponentAPI.getWindowManager()
                                                  .createNonModalExternalWindow(
                                                  "http://fabricadoenmexico.blogspot.com",
                                                  "Josue Cruz Blog");
                      window.show();
    

    2

    change "http://fabricadoenmexico.blogspot.com" with the url you want

    Regards

    Josué Cruz

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 11, 2009 at 04:53 PM

    You have to explicitly allow opening URLs with "file" protocol. This can be done using the administration tool of your server.

    Armin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 12, 2009 at 05:10 AM

    Plz look at the below link

    parameter-passing-to-external-window-wo-url

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Armin, Josue

      Thanks for the reply

      Please note I am able to open an external window( browser ) thru my code with "File" protocol.

      I have no issue opening an external window or using File protocol.

      I am able to open an image/doc with a normal URL as follows

      File://mww/documents/image.jpg

      or

      File://mww/document/temp.csv

      But My URL has some system( thru Other applications ) generated charaters in it , I need get the path from DB( which I have done ) and pass this URL to the ExternalNonModalWindow as paramter.

      MY code is opening successfully the external window for any URL .

      but for URL which has these character { } is throwing the invalid URL error

      for the below URL, I am getting the error

      File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG

      thanks

      PK

      because of the flower bracket it is throwing the error.

      thansk

      PK

  • avatar image
    Former Member
    Feb 12, 2009 at 09:53 AM

    Hi,

    sample usage for D:\{New}.txt

    is

    file:///D:/%7BNew%7D.txt

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      using

      java.net.URLEncoder.encode() fixed the problem.

      Actually the image folder in the server were moved to some other folder , hence could not fetching the file and was failing

      thanks for all

      pk