Recent Notes

Displaying keyword search results 51 - 61
Created by Dr. Xi on December 22, 2007 22:20:08    Last update: July 07, 2009 23:23:45
This page provides techniques to center things with CSS: http://www.w3.org/Style/Examples/007/center Some examples: P { text-align: center } H2 { text-align: c... When you specify " margin-left: auto " and " margin-right: auto ", the thing that gets centered is actually the block . So you have to limit the width of the block to see the centering effects (" width: 6em " for P.blocktext above). For Internet Explorer (IE), this works only when you have the doctype header in the HTML: <!doctype html public '-//W3C//DTD HTML 4.01//EN' ... Otherwise, IE is in quirks mode and wouldn't recognize the CSS directives.
Created by Dr. Xi on April 30, 2009 23:26:13    Last update: May 01, 2009 17:08:49
ApplicationResources.properties contains these keys: test.key.1 = Test Key One test.key.2 = Test Key... Struts (struts-el): <%@ page contentType="text/html;charset=UTF-8" lan... JSTL <%@ page contentType="text/html;charset=UTF-8" lan... However, the values for one and two must be passed in from pageScope , requestScope , sessionScope , etc. Values defined by struts bean:define are not interpreted. Important: JSTL tags work with servlet spec 2.4 only. So your web.xml must start with this: <?xml version = '1.0' encoding = 'windows-1252'?> ... Not this: <?xml version = '1.0' encoding = 'windows-1252'?> ... However, the latter does work with struts-el tags.
Created by Dr. Xi on March 10, 2009 23:42:59    Last update: March 10, 2009 23:44:56
It seems that dt , dd doesn't exactly line them up either. With this HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... I got this for IE:
Created by James on March 10, 2009 21:11:18    Last update: March 10, 2009 23:01:24
iretuotiowur, The reason I used block to render the labels is to avoid long labels from flowing underneath the checkbox. I'm not sure I understand your proposed solution. As far as I know, text-indent only applies to the first line of a paragraph. And I just found that Firefox does not honor it for label s (IE indents the first line as usual). For example, this page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... renders like this in Firefox:
Created by James on February 22, 2009 00:12:50    Last update: February 23, 2009 02:55:31
This note records my struggle to get a checkbox aligned with its label in Firefox and IE. Starting HTML code. Use default attributes. Both checkbox and label float to the left. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric... IE looked OK. Firefox is messed up. Long label shifted to the next line. IE 7: Firefox 3.0.6: Set width of label to that of the containing DIV: <style type="text/css"> label { display:... Both IE and Firefox shift the label to the next line. That's reasonable because the DIV isn't wide enough to contain the label and the browser tried its best to render the label properly. IE 7 and Firefox 3.0.6: Set width of label to be less than the containing DIV: <style type="text/css"> label { display:......
Created by Dr. Xi on October 23, 2008 03:54:04    Last update: October 23, 2008 03:57:44
Add validator plugin in struts-config.xml <struts-config> . . . ... Set validate="true" on action form <struts-config> <!-- ========== Form Bean De... Add validation rules in validation.xml <?xml version='1.0' encoding='windows-1252'?> <... If you override validate , make sure super.validate is called. package com.example; import javax.servlet.h... Read the documentation: http://struts.apache.org/1.2.4/userGuide/dev_validator.html
Created by Dr. Xi on August 21, 2008 22:35:24    Last update: October 16, 2008 02:27:59
import java.net.*; import java.io.*; pub... An example for POSTing from Java is available from here: http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
Created by Dr. Xi on October 15, 2008 21:49:22    Last update: October 15, 2008 21:49:22
Follow these steps to prevent form double submission in struts: In the action class leading to the display of the form, call saveToken(request) In the action class handling the form submission, check the validity of the token by calling isTokenValid(request) . If token is valid, reset the token by calling resetToken(request) , then continue processing the form submission. Otherwise, skip form processing since it's double submission. How doe it work? saveToken generates a unique token and saves it in the session under the key org.apache.struts.action.TOKEN . When the form is rendered, the struts html:form tag generates a hidden field named org.apache.struts.action.TOKEN . Upon form submission, isTokenValid compares the token stored in the session with that submitted from the form. If they are equal, return true....
Created by Dr. Xi on October 09, 2008 18:49:14    Last update: October 09, 2008 18:51:59
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Trans...
Created by Dr. Xi on August 13, 2007 21:40:47    Last update: August 13, 2007 22:29:32
This page loads text messages from messages.properties under WEB-INF/classes and uses them within the page: <%@ taglib uri="http://java.sun.com/jsf/core" pref... Contents of messages.properties : title=Weight Watcher greetings=Good morning {0}...
Created by Dr. Xi on August 13, 2007 22:28:37    Last update: August 13, 2007 22:28:37
<%@ taglib uri="http://java.sun.com/jsf/core" pref...
Previous  1 2 3 4 5 6 Next