• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to run java web application offline?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a web application built on java/jsp technology. This web application generates most of the client side files at the initial launching time.

Now, we need add a new functionality to let user download all the client side html/javascript source after launching the application, so user can access our application by viewing the downloaded html files offline.

We need add a button saying "DOWNLOAD" in the web application, when user click the button, we captures all the current client side content and saved it to user's local disk. Since it has multiple frames, we will need capture the source for all the frames.

Can someone shed light on how to achieve that?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well this isn't going to have a JSP solution, so I've moved this to the Servlets forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do all the pages makes sense in a vacuum? In other words, not depending on user input via forms links or the like that need server processing?

I'm having a hard time envisioning how anything that needs to be written as a web app can operate in an environment without a server. If it could, why not just use static HTML pages to begin with?
 
Michael L. Zhang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In our case, all the client html pages are being generated at the very beginning when the user launches this jsp application. We only need access backend server at the initial launch time, then we do not need the server any more. So, that is why we like to run it offline as a pure html collections application if the user downloads it.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using a web app as a templating engne in this way is a bit weird. I'd have used something you could automate with ant, perhaps XSLT.

In any case, I guess you could set up a filter and a response wrapper that could write the resulting responses to the file system, and then have a script that traverses every page on the site.

Search for "filter" and "response wrapper" in the forum for previous discussions of their usage.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or...

Write a small Java app that uses HttpClient to hit every page and capture the response.

Or...

Write the above as an Ant task.
[ October 13, 2006: Message edited by: Bear Bibeault ]
 
Michael L. Zhang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear, thanks. But it did not work out here.

I think I need explain my situation more specifically.

I am working on a jsp based course player. Whenever user login or logout, we keep the track of the status of the course user accessed. So we know how many items the user already visisted, and we bring the user back to the previous page he/she last visited when he/she log back in.

Now, some users like to play a course offline. The idea is adding a "download" button at our current jsp appliation. Because by the time of user clicking "download", the server already generated all client side source (html/javascript) and downloaded to user's browser.

I know there are some commercial software, like Htmlsource Viewer can catch all the client side source when you move the mouse to IE browser. But I just do not know how to do that by using a button at our web application. Is there a way to go back to server side and get all the source initially generated for this course when user click the "download" button?
 
Ranch Hand
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your LMS compliant to SCORM (Shareable Content Object Reference Model).

If not please google it you may find something for your situation.
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Setup a filter which will capture all user's request responses and store them in a temporary storage. When user selected DOWNLOAD, then zip the storage and send to the user. You may have something on client side as offline player or something like that. We use TJWS for that. Live search for it.
 
Michael L. Zhang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Patel, Rog

Thanks for your reply.

I am now using a html form to post back all the frames' html source from client side to a servlet, and then on the server side, I write to a file/folder/zip to let user to download. Is this a good solution?

BTW, Patel, we are using SCORM for our course player.
 
reply
    Bookmark Topic Watch Topic
  • New Topic