-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #246: Header must be fetched from jakarta.ee #293
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
@autumnfound, I can submit a patch to https://github.com/jakartaee/jakarta.ee for the changes required in the templates for you to review? |
If you feel comfortable submitting a patch, absolutely! Otherwise, you can create an issue and we can triage and take care of it in the near future as well. |
@kito99, this PR is functional and maybe reviewed now. @m-reza-rahman while this PR addresses the issue of fetching the headers/footers, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be done every time? It looks like this is static. Why can't be do this in the Maven build too? Also, why can’t we just directly include the file if it can be valid XHTML?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first time seeing this PR. My first impression is that using the JSF Facelets <ui:include>
feature is an easier way to accomplish what the FetchHtmlUtility
is doing.
At a very high level, using Java code to generate markup is an anti-pattern. A more current (but certainly not the only) way to do it is to keep in XHTML as much as possible and use Expression Language elements in the XHTML to pull in the parts that need to be dynamic.
This is a StackOver Flow question that talks about this. https://stackoverflow.com/questions/8947425/how-to-conditionally-include-a-file-in-my-template-using-jsf-and-facelets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some existing XHTML code present in the topbar.xhtml which was needed along with the html code fetched from the url, some parsing along with placing the code inside ui:composition tag made me think of the above approach as it was a bit straightforward but as Reza mentioned I did not take into the consideration the performance issue of doing the above repeatedly.
I'll try to find some out of the box feature present in maven plugins which does the above so that all of this can be done during the build itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this now ready to merge? If so, can you address the question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR for #246
This PR addresses changes required for fetching the header/footer html fragments from: https://jakarta.ee.