Google Maps in JSP Document - google-maps

Could anybody direct me to an example of JSP code displaying a google map? I've got some javascript that works but ideally I would like to feature a map in my pre existing JSP pages.
Many Thanks

Just put it in a HTML file. Once you got it to work, then rename .html to .jsp whenever you want to replace some static content by backend-controlled dynamic content with help of EL (those ${} things).
Do you now see the point of JSP?

Related

Is there anyway to convert full Html page to excel file

I would like to ask about converting html page to excel. I have searched on the google and stackoverflow but I could not find any library or fully worked code. I am meaning while saying "html page", not only html table but also "div" tags and other html tags (with visualization on the page). For this how can I do or is there any library to do this. I am using java on background and vue js for frontend.
Thank you in advance..

Obtaining a Snippet of HTML code from an App Script

It appears that when one uses HtmlService.createTemplateFromFile(), the html code that is in the file is just a snippet. The method packages the snippet in an html wrapper which adds things like the DTD, and html, head, and body tags to form a complete html document. The documentation (https://developers.google.com/apps-script/guides/html/) suggests that HtmlService.createHtmlOutputFromFile() works differently. It suggests that in the later case the relevant file contains the ENTIRE html code and the method does not add a wrapper. Experimentation reveals that the later works like the former in that a wrapper is added. My question is this: Is there some way to return a snippet of html code (i.e., no wrapper) from an app-script? The reason that I ask is that I would like to be able to use AJAX to insert a snippet of code from an app-script into some point in the DOM structure. Thanks for any input.
... doug
P.S. I realize it's probably going to be a separate issue; but, it would be nice if the snippet could include a scriptlet.
In general, I can think of 5 basic strategies:
Static HTML from within an Apps Script project
Static HTML from a file outside of Apps Script
Dynamic HTML created from server side code
Dynamic HTML created with JavaScript in the browser, with data retrieved from somewhere.
Retrieve HTML from some other website's page.
You want to use a scriptlet, which is dynamic HTML, triggered from the front end. If it's dynamic HTML, the HTML can be dynamically changed from Javascript in the browser, or you could formulate HTML from the server, and then return a string of HTML. I guess there are multiple strategies for how this could be done.
You can call a Google Apps Script from another website, and use Apps Script as server side code without directly returning any output to the screen. You would use Content Service to do that.

JSP include prefixes the project name in the link

I have a html file in a share folder (ie, out of web server location) and I have to include it in a jsp using
<jsp:include page="//TestFolder/Sample.html">.
While running the application the following error appears on the page:
The requested resource (/projectName//TestFolder/Sample.html) is not available
Here the application name (/projectName) is being prefixed with the target path. How to get rid of the application name so that the html can be included within the jsp?
Any clarifications would be appreciable.
Thanks.
The jsp:include action can be used only within the same servlet context. It accepts only relative url(either page-relative or application-relative)
Based on your comment, what you are trying to achieve is not possible with jsp inclued tag nor jsp include directive. This is because, at the end of the day, all JSPs become servlets. And a servlet with dependency outside of it's WAR (or any other packaging) would be quite tricky, now, wouldn't it?
I imagine, however, that you could create your own tag that would dynamically read a static HTML file and include it's contents in response. Just put into account that bypassing this limitation will put your application at risk of this HTML not being available unless you prepare your tag for that.

Safari Extension : retrieve full HTML code from a page

i'm trying to create a safari extension and i'm stuck with something.
I have my global.html on my extension and i've been searching the web for like 3hours on how to retrieve the full html code without success.
I tried:
document.getElementsByTagName('html')[0].innerHTML (when i alert i only see the code that i have inside my global.html)
document.documentElement.innerHTML (nothing happens)
etc...
I used safari.application.activeBrowserWindow.activeTab.url to retrieve the url but i cant get the html code.
Any help?
Thank you
You can't get the HTML of a web page from your extension's global page. You have to use an injected script and then, if you want, you can pass the web page's HTML to your global page using safari.self.tab.dispatchMessage. See this chapter in Apple's documentation.

Converting Web Page with Google map into PDF

I am using iTextSharp library for converting my .aspx page into PDF. I am using Table, labels and Google map in my page. Every thing converts into PDF except Google map. In PDF file it shows Google map code instead of showing Map. I could not understand, how to fix this problem ?
Any help to fix this
So you're using iTextSharp to parse HTML, right? Unfortunately iText and iTextSharp's HTML parsers are still in their infancy and Google's maps use both iframes and JavaScript, neither of which are supported in the parser. You can see a list of supported HTML tags here. I would not be surprised if adding a JavaScript interpreter is not even on the to-do list.