This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!

Dustin Platter

+ Follow
since Sep 26, 2012
Dustin likes ...
Eclipse IDE C++
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dustin Platter


I wrote a test application using JAAS to provide login authentication and some basic role based authorization. However, we are now looking to incorporate Struts 2.0 into our application. However, my attempts to combine the code from their respective web.xml has not panned out. It seems I can use the JAAS security constraints or the struts filter, but not both. Does anyone have any experience with this or can point to a good resource for guidance. I have a basic understanding of Struts and am very new to the whole security aspect.

If it helps we are using a Wildfly 8 web server.

Thank you
5 years ago
Thank you. Knowing that I can't assign to a table, and rather should be assigning to a Div allowed me to make progress. I've posted what I did below in order to help others.

Bear- Please understand some people will come here with questions after looking for answers elsewhere, and may not be sure exactly where to start (code wise). If they have code great, but if they state that they aren't sure how to do it or where to start it would be helpful to give them a starting point. Had you said early on that '.innerHTML = "<table>...</table>" can't work with a Table element, but rather a Div element it would have made my path forward much more clear. That would have given me a starting point and if it didn't solve my problem outright (which it did), it would have at least allowed me to write some actual code that could then be diagnosed.

Unfortunately that is the extent of the error message I receive. I am unable to use "Firebug", as I'm not at liberty to install software on my development machine (as I said I'm pretty restricted).

While I appreciate the many little tips, I don't feel you've address the primary question of 'what is the proper way to reassign a table using the document.getElementById'. You've stated I should go back and 'fix' my original issue, but provided no indication as to if I was even trying to do it correctly. I've explained the two ways I've attempted to do it, and came here for advice from those more knowledgable then I. Yet I have not seen anything as to the 'correct' way to do this.

...(To head this off, the missing tag '>' was an error while editing my post. My code is closed properly)

1) I misspelled the text I posted in my original but the case was accurate in my code. That is what I was trying to point out. The error is not my capitalization but rather the code itself.
2) With regards to the error message, what I am able to retrieve is 'Unexpected runtime' error on line "....innerHTML = "<TABLE>...</TABLE>". My background is in desktop applications with the Microsoft languages so debugging via browser is new to me (I'm attempting to learn this as I go with little to no guidance, so feel free to suggest improvements).
3) Although I'm not against JQuery, as Java/JSP/Javascript are all new to me I am trying to focus on a limited set of new skills in order to better focus my training and ease my ability to locate an error. As it is when something doesn't work I have 3 languages which could have a syntax error. Adding JQuery would make it 4.

If you have any thoughts on how I would correctly do this I would appreciate it. The "code" below is the only thing I know to try, other then what I did (removing and adding rows) which you pointed out is not best practice.

Eric- The text posted was sample text, hence the case not being completely accurate.
Bear- No, I'm unable to run through a debugger as it is a web application, and I am unable to set up a local host environment due to computer restrictions.

I finally resigned myself to deleting the table rows, altering (heavily) my table build code, and adding the new table rows one by one. I've posted it below in case others come across this issue.

Hi all,

I have a JSP page which displays some information, including a table that is generated on an external JavaScript page. I am looking for a function to replace the existing table with a new one. I've tried 'innerHTML = "<TABLE><\TABLE>";' without success. My goal is to be able to call a function via the SelectBox.onChange event, and have it generate a new table to replace the old. I'm fairly new to JavaScript/Java/JSP, but have worked with C# for ~5 years.


User sees table for StudentX.
User changes selection activating selectBox.onChangeEvent
onChangeEvent calls function replaceTable()

function replaceTable()
document.getElementByID("MyTable").innerHTML = myNewTable;
Hello Moose Saloon,

I'm trying to teach myself several new Java centered technologies (due to my new position). However, my co-workers are under deadline so I'm on my own to get up to speed. I've been creating a test application to become more familiar with JSP and Servlets. This is what brings me here.
I have a SelectBox (I've read that it is NOT to be called a combobox :), with students names. Below several Text boxes, etc is a table which displays the students class schedule (built when form is submitted). The table is being created through the use of JSP and session variables. What I'd like is to determine which student is currently selected in the SelectBox and use that value in my JSP code that builds the table. Ultimately what I want is that when the selected student changes the table is rebuilt, displaying the newly selected students schedule.

Code snippets below

//I do something along these lines
SchoolSchedule allSchedule = Session.getAttribute("schoolSchedule");
SchoolClass myclass = allSchedule.getClass(studentname); //This is currently hardcoded. Need a way to base this off the selectBoxes value

Then I loop through myclasses building the <TABLE> as needed

1) How do I simply display selected value(ie 'newStudent2') on the screen? (I've tried 'request.getAttribute("studentCB")' but just get null)
2) How can I build a <TABLE> to be displayed within my 'onChange' function?
7 years ago