Hello,
I'm currently trying to understand what the best approach to implement a solution is when I have a Java page that has to invoke a Java service and render content on the page.
(The solution has a limited scope so please do not mention here alternative solutions with other frameworks such as JSF, Spring, etc....).
Scenario....:
PAGE, Server-side logic reading a XML config file (no database).
> The number of requests my server-side logic that has to receive the HTTP request and reads the configuration file is : 35 millions yearly.
So:
1- I could do it with
javascript/ajax, requesting a Servlet/WS that would have to read a XML configuration file and would then return another *XML data to be parsed by the browser.
*The XML data would be a javascript function to run on the browser.
XML data (payload) to be parsed by the browser would not be larger than 20-50KB
2- Instead, I could have a
Java custom that communicates with a SimpleTag Handler implementation that reads the XML Configuration file and generates as response the expected javascript function to run on the browser.
> This solution seems to be much clearer by delivering loose-coupling without overloading the browser with client-side processing.
> However it seems that I can only run the Java custom tags on Java pages, it's not my situation
I'm now working on the advantages and disadvantages of both solutions...have here different pros and cons...could you please give me your insight regarding the ones you think that are the most important to be taken into account here ? (I will not post them here because I don't want to influence your answers)
I need to hear from you
IMPORTANT: The page that contain the Custom tag (or javascript function) does not run on the same server as the Tag Handler or Servlet/WS implementation.
Questions:
1 - With the JS solution, one of the main advantages here is that I can benefit from the Asynchronous calls without impacting the page loading as well as the response time. Is it true?
2 - In the end, would the javascript solution run faster than the Custom tag? When we think of java specially with XML (tld) we think about something that might bot be 'performant'
3- If my page is not a Java page, would there be any way to run the Custom tag? (IFRAME?)
4- What approach do you use with Custom Tags/Tag Handler implementations to see whether it's performing well ?
5- Considering the situation where I mentioned that my page that executes the Custom that might be in another server/domain than my Tag Handler, I need to understand:
- What is the protocol of communication between my custom tag and the Tag handler?
Thank you so much in advance,
Let me know if you have any questions,