This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I need a user list on an input form that shows the possible directory names where a file will can be located in our network system. Should I gather the directory names into an array and present them in a list or do I create a data file which holds the possibilites and pull this record set into an array? If the first is the best choice can you help me with code to pull directory names?
Originally posted by Steve Dyke: I need a user list on an input form that shows the possible directory names where a file will can be located in our network system.
Which part of this are you having a problem with? Generating the user list, getting the directory listing, or both? What server side technology are you using? Servlets/JSP?? You told us what you want to do but you told us nothing of your environment.
I am using JSF to present the user a form. On the form there will be a static list control of main folders where a drawing will be stored. When the user selects an item from this static list I need another list control to be populated with a list of subfolders that is located within the main folder.
Joined: Jun 27, 2002
So you're making an async request.
Are you using JSON, HTML, or XML?
if you are using HTML, you can insert some innerHTML from the success response.
This isn't the right place to be discussing server-side operations. Once you get formatted HTML to the client, the innerHTML trik works just fine.
Are you using Ajax to fetch the information?
What are you using on the server? Servlets/JSP? Other?
Joined: Nov 16, 2004
Since your last post I have got this far. However, in my servlet the last line(just tring to check the array to see if it has any values) generates an error(NullPointerException). Note: This same line of code placed in my class will give a valid value. After I get my array to work can't I use ajax in my JSF to populate my list without reloading the page? If so I may need some help with this.
But my next challenge is how to get my servlet to return the array in a way that it will populate my list on my JSP.
There's no need to do the list processing on the client. Have your servlet forward to a JSP that will take the list and format into an HTML fragment that you can use on the calliing page via innerHTML.