Enumeration keys = session.getAttributeNames();
while (keys.hasMoreElements())
{
String key = (String)keys.nextElement();
out.println(key + ": " + session.getValue(key) + "");
}
menu navigation
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Tuesday, January 10, 2012
Struts html select tag
To default a selection:
<html:select name="defaultValue" property="value">
<html:optionsCollection name="myKey" value="value" label="label"/>
</html:select>"
Replace select "name" and "value" with the names and values of the HTML struts. You have now selected default HTML struts.
<html:optionsCollection name="myKey" value="value" label="label"/>
</html:select>"
Replace select "name" and "value" with the names and values of the HTML struts. You have now selected default HTML struts.
Wednesday, December 28, 2011
Java Style of If
C programming style: if (a > b) {
max = a;
}
else {
max = b;
}
Java style:
max = (a > b) ? a : b;Wednesday, December 7, 2011
Working with old Java codes
I had been task a project to implement additional features to an old java LMS (Learning Management System) portal. By first look, the portal is at least 10 years old.
Working in this project is simply nightmare,as a lots of new code cannot be implemented due to the limited support. I wasted a few hours before realizing that the project is using servlet api 2.3, which explained why JSTL simply doesn't work.
Lucky enough to come across this website which solved my headache eventually.
http://www.mularien.com/blog/2008/04/24/how-to-reference-and-use-jstl-in-your-web-application/
Working in this project is simply nightmare,as a lots of new code cannot be implemented due to the limited support. I wasted a few hours before realizing that the project is using servlet api 2.3, which explained why JSTL simply doesn't work.
Lucky enough to come across this website which solved my headache eventually.
http://www.mularien.com/blog/2008/04/24/how-to-reference-and-use-jstl-in-your-web-application/
Subscribe to:
Comments (Atom)