How to visualize the complete xhtml page (assembled from multiple fragments)? - java

I am currently debugging a JSF application based on XHTML (still on myfaces 1.1 if you are curious).
But our faces are an assembly of many XHTML fragments and sometimes, for the purposes of debuging, it would help a lot knowing how the whole thing looks once all the fragments have been put together.
Do you know any way of visualizing those?
Thanks in advance

Related

Should I use webpack or just html imports when building a single page app (large scale)

I have been reading this tutorial about html imports. However I became more confused after it. I'm coming from an Angular 1 & 2 background with some React recently. I have been progressing trough all the stages of javascript evolution. Using scripts in the header than require.js than system.js and now I've been doing just fine with webpack.
Reading about these imports it becomes a bit fuzzy. I don't have a clear image when to or not to use them. If webpack is used, do I still need html imports (probably for 3rd party stuff)? Certainly I love typescript and I definitely don't want to build the js artefacts myself using the command line like in the early days. I feel webpack is a must-have.
I know this question can be viewed as vague and closed, but I'm really stuck. Right now resources on web components are few and I can't manage to find my way towards a clear and confident answer.
P.S I want to use vanila components, not polymer stuff.
Some of the major browsers(i.e. Firefox) are not planning to ship HTML imports, ever.
Quoting from https://hacks.mozilla.org/2014/12/mozilla-and-web-components/
Mozilla will not ship an implementation of HTML Imports. We expect that once JavaScript modules — a feature derived from JavaScript libraries written by the developer community — is shipped, the way we look at this problem will have changed.
It will still be good to learn about the standard though, because of its unique feature of HTML parsing, which won't be possible with any representation of HTML in JS modules(which are being pioneered as replacement for HTML imports)
But for now, it seems like HTML imports are not getting anywhere, until something comes out of HTML Modules proposal, which plans to rebuild HTML Imports functionality using the ES Modules.

Existing JSP Pages need to be responsive

I need to make the existing JSP pages responsive. I handled the plain HTML files to make it responsive using the bootstrap framework. But with JSP's how it can be achieved effectively as the environment is different. Do I need any extra set up ? any example or link that can help me.
Please suggest me the best way to get it done.
Thanks in advance !!

Is it advisable to use 'include' tag of jsp for setting the general structure of the website?

I am making a website with around 20 pages in it. Now almost all the pages have same general layout like the menu bar, header, footer etc. I've made a jsp page which contains this common contents and then with the help of 'include' tag I'm using it for the other pages. So is it advisable to follow this technique? Kindly inform me about the pros and cons of using this technique.
Thanks in advance.
Remember that with each #include tag,the whole jsp thing will be converted to a servlet and then it will work as required HTML format as compiled by the browser. So there is no doubt that for a large application it will create unnecessary performance issue.
Instead of doing this you may use iframe tag which is now widely used in web development.
You may modify the iframe source code as u want........
So it's totally depends on which way you want to proceed and your application context.there is no fixed rule that you must have to use this or that technoque

Spring MVC. Rendering layout

I'am new to Java Spring MVC. Official documentation is very poor and i've got a lot of questions about rendering pages in Spring.
I have page and top block with menu. This menu must be dynamic and must be displayed on all pages. In PHP frameworks this is very common and very easy task. But Spring makes my brain explode.. How can i separate rendering of this menu in some peace of logic and tell spring to render it all the time? For example in JSP. Shoud I use beans or other stuff?
Thanks for your answers!
Official documentation is very poor
No it isn't. Its the one place I always refer back to.
I use a jsp include and yes pass a java bean to the jsp from the controller. The included jsp will be cached the first time it is included. In other places I connect to a controller using jquery and ajax, which dynamically updates the page.
I'd suggest the official tutorials, and krams as good starting points.
You won't find much information about this in the Spring documentation because it's out of the scope of Spring.
You can use JSP includes just as you would do PHP includes. This will however force you to repeat the page layout and the include in each and every page of the application :
<jsp:include page="/menu.jspf" />
Or use a templating engine, like Sitemesh or Apache Tiles (see http://static.springsource.org/spring/docs/3.1.0.RC1/spring-framework-reference/html/view.html#view-tiles for Tiles integration in Spring).
The easiest way would be to use <jsp:include page="/menu.jsp" /> where "/menu.jsp" is a path to your menu jsp.
There are other solutions like using tiles, but <jsp:include> should do.

Can I draw State-Transition diagrams in JSF2 Web App?

I'm looking for a way to draw state-transition diagrams in my JSF2 project.
I would like to be able to load state and transition data and transform them in a graph that can be displayed on my web page.
I haven't found a way to do that yet. Charts available with Primefaces or MyFaces projects (I'm using the 1st one) are dedicated to statistics. In addition, it's probably possible to do that in javascript but I didn't found any example of that in the Google's API's for example.
Any suggestion or help would be appreciated.
Thanks a lot.
Clément
I doubt there are components that display graphs using plain html, but you might look for a library that generates an image which you can display in your page. That library wouldn't necessarily be JSF specific though.
Edit: maybe JUNG might be of interest for you.
In addition PrimeFaces' dynaImage might help you with displaying the generated graph image.

Categories

Resources