How to retrieve HTML representation of components? - vaadin

I would like to output HTML codes of my vaadin's components at my console. I didn't find any methods for this . Can it be possible ?

It is not possible to retrieve component's generated HTML with Vaadin's server-side programming mode.
If you really need to do it, you could write your own extension what transfers component's generated HTML from browser to server after it's rendered. Writing your extension means the you need to it with GWT (GWT Web Toolkit, formerly Google Web Toolkit).

Related

Feed Electron's webview with HTML contained in a string

I want to embed an "HTML viewer" inside of my Electron app, which would be fed with HTML contained in a string. My application automatically generates HTML code, which I want to visualize rendered as it would be displayed in a web browser.
I have seen there is a component called <webview> but it loads the HTML content from an external site via URI.
Is it possible to feed this <webview> component (or any other) with HTML from a simple string to achieve my goal?
Check this in electron repository
https://github.com/electron/electron/issues/1146
You can go with data uri, if you don't need JavaScript.
If you need JavaScript, there is a workaround. You can save the html string as a html file and load the html file in electron
Once the window is closed, you can delete the html file

Why are .html file parsed rather than compiled when open them in browser such as Safari?

Why are .html file parsed rather than compiled when open them in browser such as Safari? From the internet, I learned that parser is a component of a compiler. People say .html is parsed to a web page, but why not compiled to a web page? .html file contains code that needed to be compiled so that it becomes a webpage, right?
Some possible reasons: Maybe when we say something is compiled, it has to be compiled into machine language but .html does not?
HTML does not get compiled - it simply describes how the website should be rendered.
And that is then interpreted by the browser - it doesn't end up as machine code.
It's like a map or blue prints telling the browser's rendering engine how to build the website.
The W3C defines how these "plans" should be written and the browser vendor should make sure they interpret the plans in the correct way.
Developers should make sure they use the HTML elements properly so that the HTML files make sense and the browser can construct the web page properly.
What difference does it make? You have not described a problem you are having.
The parsing of HTML is application-dependent. Each browser/parser decides how to do it.
HTML however must be dynamically modifiable. Since HTML is not executed, it is not clear what the difference is between compiling and interpreting but typically compiled code can't be easily modified.
JavaScript is by definition interpreted.

Static content separation in JSF2.0 project

I need your help on below.
I have JSF2.0 application which runs on WAS8.5. I want to separate the static and dynamic contents as we want to use WAS server only for dynamic contents and IHS to server static contents for my application. My current architecture and design as follows:
Marked file serving flag as false in ibm-web-ext.xml file (IBM config file to say whether WAS to be served static content or Not).
We’ve used core JSF2.0 tages (h:outputStylesheet, h:outputScript and h:graphicImage) and also traditional html tags some places (link, script and img) to load static contents.
My understanding/Observation is,
1. When we load static contents using JSF2.0 components (styles using h:outputStylesheet component, java scripts using h:outputScript and images using h:graphicImage), all static contents will be served by WAS server as FacesServlet is responsible for reading the component and loading the resources accordingly. According to the JSF2.0 guidelines&standard, we should use JSF tags to load the resources like js, css and images.
2. When we load static contents using html tags, all the static contents served by webserver ie IHS
Now my question is,
My application is internet channel application where we want to serve the possible as quickly as possible. Technically, I want to use Core JSF tags wherever possible and use the WAS server to serve only dynamic contents to reduce the load.
Please advice me options to meet my requirement.
Thanks,
Nanjundan Chinnasamy
We have made the following code changes to achieve our requirement.
To server all images by IHS,
Use native JSF2.0 tag with value attribute like below.
This will generate the html source like below
We used the traditional html tags (used in JSF1.X) versions to load css and java script files like below
If we use h:outputScript and h:outputStylesheet tags available in JSF2.0, we have a name attribute which marked as mandatory. We unable to make it static reference using value attribute alone. We don’t have much documentation at MyFaces site to give references to you. Mean time, you can have a look the following:
https://myfaces.apache.org/core20/myfaces-impl/tagdoc/h_outputScript.html
https://myfaces.apache.org/core20/myfaces-impl/tagdoc/h_outputStylesheet.html
If you any other suggestion/comments, please do let me know. We will revert you with an update.
Thanks,
Nanjundan Chinnasamy

Stop Umbraco form stealing internal links

Sometimes I want to write the entire link to a page, which can be good if in example a visitor wants to print the page or just copy the url from the web site. The thing is if I write http://www.mysite.com/licensing/terms ubmraco cuts that and removes the http://www.mysite.com, both from the link it self and from the text.
Ie
/licensig/terms
What i want is that it should remain as
http://www.mysite.com/licensing/terms
It does not matter if i write the link in the source editor, if i write it in the html source editor or if I use the link tool in the rich text editor.
Anyone know how to fix this?
Use umbraco.library:NiceUrlFullPath($currentPage/#id) in your XSLT to get the full domain and protocol included in your URL, or umbraco.library.NiceUrlFullPath(Node.GetCurrent().Id) in a usercontrol code-behind or binding.
HTH,
Benjamin

view Html source in chrome with delphi

is there a way to extract the viewed html source from google chrome using delphi? or script to pass info on my apps?
Maybe, but why would you use a browser? Why don't you just download the page?

Resources