Greetings. I hope I have selected the correct forum to post this
thread. If not I'm sure the sheriff will correct my ways.
We've heard the adage: Be carefull what you ask for as you just may get it. Well, its happend to me.
I took a position as a contractor for a large company and now I find myself working on a project whereby I have limited technical experience or it has been several years since I last used the technologies required (see title of this thread for the technologies I am referring to). To make matters worse I have very little time to complete the task. On the good side, I am finally working with the technologies that I've wanted to work with for some time now.
I am writing this thread because I could really use some consultation with my task. Here are the specifics. The task as a whole is quite simple. Picture a completely blank web page. Now split that web page in two vertically down the middle. On the left hand side of this web page will be about twenty something text fields for the user to enter all sorts of numeric and text data. On the right side of the web page there will exist a checkbox treeview control from which the user can click on certain checkboxes. The objective of this web page is to build an XML file which will contain data from all of the entries made on the left hand side of the page and all of the nodes that were selected in the checkbox treeview control on the right hand side of the page. The user simply enters all of the fields on the left hand side of the page and clicks on the desired elements in the checkbox treeview control on the right side of the page that are to be included in the XML file. The user then clicks a "Go" or "Apply" or "Submit" button and the web page will build the XML file and park it in some directory on the server to be used downstream.
Technically, here is what I am doing. The checkbox treeview control is a very nifty one written in Javascript. It provides exactly the service that I need. Within this control there exists code whereby clicking on a link I am delivered selected attributes of the nodes that were clicked on. I need that function. I have allready embedded this checkbox treeview javascript control and mapped out all of the text boxes and buttons on a
JSP page. I decided to build this web page as a JSP because I know I can implement the combined HTML code and that javascript checkbox treeview control as well as other javascript code needed to validate all of those enterable text fields, and I can call one or more
java classes to build the output XML file, using a JSP.
I hope I've made my task clear as well as my build out strategy. Now here is where I could really use some technical consultation. See that checkbox treeview control needs to be populated
before the page is rendered. The data that is to populate that control will come from a web service request. I have never coded a web service request but in my research I see that this can be done using java classes. Ok, so can my JSP page embed some java code that will call a java class that will invoke that web service? I'm thinking that that java class will invoke that web service request which will return some XML data. Then that java class will build a temporary XML file from the data returned from the web service request. This same temporary XML file built by this java class will then be accessed by that javascript checkbox treeview control and populate itself with that data.
So, here are my questions. First, am I on the right track with the technologies I have selected to complete this task? I'm sure you can combine javascript on a JSP page but I am confused about something. When you have a JSP page that includes javascript and embeds calls to java classes what is the sequence whithin which the page renders out? In other words does the web application server build the web page reading commands found in the jsp page from top to bottom? If so, in my JSP page, can I simply embed a java call to my java class that calls the web service to get the data required to populate that treeview control
before (or above) the lines of javascript code that populates and displays the checkbox treeview control? Is this OK? If not, or if there is a better, simpler, more efficient way to complete my task then please advise. I am certainly open to alternatives to this approach.
Thank you all for your time in reading this lengthy post and addressing my questions. My humble apologies if this is something that is so elementary. As stated, either I lack the skill or it has been quite some time.
Please help. Gary