Standalone Angular Viewer

Somehow the error resolved when I create a new instance of the object by using the code ss119.PNG (89.0 KB)
. But now I face the error of NullPointerException when calling loadDocumentProperties . ss120.PNG (13.9 KB). I just convert the codes from Spring project but it does not work. Can you share the complete ViewerService.java file for jaxrs because only loadConfig wont work for the viewer and I have no idea on how to actually configure the settings.

@danishPersys

As I see, in method loadDocumentRequeat you just have created empty object of class LoadDocumentRequest. But you don’t fill it’s fields. All it’s fields must be filled with data, that was sent by UI.
NullPointerException is thrown because guid field is null in the object.

I can recommend you to run Spring sample in Debug mode, set breakpoints in each handler method and check which fields are set and what is the data there. In your project the same fields must be filled with according data.

@vladimir.litvinchik

Hello,

I tried to test spring with just the /loadConfig function and the application can run and does not call for other functions but why is the war file request for other functions such as “/loadTreeFile”.

Here is the console for spring file with just loadConfig . ss121.PNG (12.7 KB)

Here is the console for the war file which just loadConfig. ss122.PNG (126.7 KB)

@danishPersys

There are a number of methods that should be implemented to support all the features that the UI is providing. As an example loadTreeFile should be implemented in case you’re going to enable file browsing. All the methods that should be implemented can be found in ViewerController.java in our Spring demo.

I see. Right now I already rendered file to pdf in a local folder. So what method should I include if I want to display the pdf in the viewer with a toolbar for navigating pages and zooming. Also is it possible to disable the calls for the method?

@danishPersys

To display the PDF you going to implement loadDocumentDescription and loadDocumentPage methods. Sure, you can disable the calls for the methods in your controller for example.

Yes as we can see that spring got the LoadDocumentRequest from @RequestBody but jaxrs dont have requestBody. From debugging it seems that they already have a value. How do I retrieve the value in JAXRS?
Here is my result from my debugging ss123.PNG (4.7 KB)

@danishPersys

I believe that you’re looking for official documentation for JAXRS.

Yes . Because our version of Websphere does not support Spring framework that is why I have to work with JAXRS.

@danishPersys

Got it, please check the public documentation for JAXRS.

Where can I find it? I only see spring and dropwizard

@danishPersys

We do not provide examples in JAXRS but you can use Spring or Dropwizard examples to build the app using the technology you prefer. In one of the previous comments, @aleksey.permyakov has already provided the sample application that you can use to develop your own application.

1 Like