Recent Notes

Displaying keyword search results 91 - 100
Created by Fang on August 03, 2010 19:50:51    Last update: August 03, 2010 19:50:51
The tags <fmt:message> Writes out a formatted message for the current locale and resource bundle, or stores the resulting message to a scoped variable (when the var attribute is specified). Syntax: <fmt:message key="messageKey" [bundle="resourc... Or, with parameters in body: <fmt:message key="messageKey" [bundle="resourc... <fmt:bundle> Creates a resource bundle for the contained body. Syntax: <fmt:bundle basename="basename" [prefix="prefi... <fmt:setBundle> Sets a resource bundle in a scoped variable, which may be used later by <fmt:message> . Syntax: <fmt:setBundle basename="basename" [var="varNa... <fmt:param> This is used inside a <fmt:message> tag to specify a replacement parameter. <fmt:param value="theParameterValue"/> or <fmt:param>The Parameter Value</fmt:param> Test it Make these additions to the expanded test application : Create 3 resource bundles and place them under src\main\resources . messages_en.properties : label.login=Login label.username=User Name ... messages_es.properties :...
Created by voodoo on July 30, 2010 14:53:33    Last update: July 30, 2010 14:54:52
The -d switch for cURL sends HTTP POST with data from the command line. To verify the data being posted, this is a CGI script that echos the data back: #!C:/perl/bin/perl.exe ## ## echo -- echos ... Examples: POST data from command line: C:\>curl -d input1=value1^&input1=value2 http://lo... POST data from stdin (with @ before the - symbol): C:\>curl -d @- http://localhost/cgi-bin/echo.pl ... POST data from a file (with @ before the - symbol and input redirect): C:\tmp>cat data.txt abcd 1234 xyz ... For some reason, @ with file name didn't work as expected: C:\tmp>curl -d @data.txt http://localhost/cgi-bin/... One thing to notice is that cURL removes the new line characters when posting (thus the echo back is only one line instead of three). This can...
Created by voodoo on July 11, 2009 15:14:55    Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. It's really easy to see HTTP headers with curl: C:\>curl --head http://www.google.com HTTP/1.0 ... or, headers and page together (dump headers to stdout): $ curl --dump-header - http://www.google.com HTTP/... Download openssl from openssl.org: curl http://www.openssl.org/source/openssl-0.9.6m.... C:\>curl --help Usage: curl [options...] <url> ...
Created by voodoo on July 21, 2010 16:10:47    Last update: July 21, 2010 16:10:47
Google news RSS does not like curl: C:\> curl --dump-header - -o NUL http://news.googl... Switch the agent to HotJava with the -A option: C:\> curl -A "HotJava/1.1.2 FCS" --dump-header - -...
Created by Fang on April 04, 2010 04:12:14    Last update: July 21, 2010 14:52:58
The tags <c:if> The <c:if> tag may be used with or without body content: <!-- Without body content, used to export vari... In my opinion, the version without body content is pretty much useless (the <c:set> tag is a lot more meaningful for this purpose). If body content exists, it is inserted into the page if the testCondition is true . Optional attributes var and scope may be specified. If var is specified, a variable whose name is the value of var is exported to the associated scope ( pageScope if no scope is specified). The type of the exported variable is Boolean and its value is the value of the testCondition . <c:choose>, <c:when>, <c:otherwise> These tags imitate the Java control structure if...else...
Created by Fang on July 17, 2010 03:16:53    Last update: July 17, 2010 03:18:25
This error happens when the ordering of elements in web.xml is not correct. For example, in a <servlet> declaration, <servlet-name> should come before <servlet-class> . If you switch the order of <servlet-name> and <servlet-class> , you'll get this error. This was my stack trace in JBoss when I declared <load-on-startup> before <init-param> for a servlet: DEPLOYMENTS IN ERROR: Deployment "vfszip:/C:/...
Created by meiu on July 07, 2010 15:16:34    Last update: July 07, 2010 15:17:08
Example: <%@ taglib prefix="fmt" uri="http://java.sun.com/j... Full attributes: Attribute Meaning value Date object to be formatted type Format time only ('time'), date only ('date'), or both date and time ('both')? dateStyle Style to format date, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat) timeStyle Style for format time, e.g., default, short, long, full etc (c.f. JavaDoc for java.text.DateFormat) pattern User defined pattern, e.g., MM/dd/yyyy timeZone Which time zone to display the date for? var If the var attribute is specified, then a String value containing the formatted date is assigned to the named variable. Otherwise, the <fmt:formatDate> tag will write out the formatting results. scope When the var attribute is present, the scope attribute specifies the scope of the resulting variable. .
Created by James on June 30, 2010 19:04:45    Last update: July 03, 2010 21:24:33
Technically, file upload cannot be handled by Ajax, because XMLHttpRequest (XHR) does not handle file inputs. All techniques not using Flash rely on an invisible iframe as the upload form submit target. JavaScript then grabs the response content from the iframe and present it, giving the same illusion as Ajax. webtoolkit AIM The technique by webtoolkit is very simple. It involves 3 simple steps: include the AIM script, implement the start/finish JavaScript functions, and add an onsubmit handler to the normal file upload form. The hooked up form looks like: <head> <script type="text/javascript" src="webt... The AIM script is also quite simple: /** * * AJAX IFRAME METHOD (AIM) * http... The above code only supports HTML responses. In order to support JSON responses, the above...
Created by James on June 30, 2010 20:14:28    Last update: July 03, 2010 18:41:12
The HTML page <!DOCTYPE html> <html> <head> <title>jQu... Client Side Code // called before upload submit function sta... Server Side Code Using Apache Commons FileUpload as example. Upload code (responds to fileUpload.do ): final HttpSession session = httpServletRequest... Progress code (responds to uploadProgress.do ): HttpSession session = httpServletRequest.getSe...
Created by James on June 24, 2010 22:04:19    Last update: June 24, 2010 22:04:19
Start with this page: <!DOCTYPE html> <html> <head> <title>jQu... When you click "Submit", the form submits fine. Now turn the form to a jQuery dialog: <head> <title>jQuery UI Dialog</title> ... When you click "Submit", the form no longer submits! Why? When you convert the contents of the form into a dialog, the form becomes empty! The "Submit" button is no longer associated with the form. Conclusion: you should always put the form tag inside the element you are converting to a dialog.
Previous  5 6 7 8 9 10 11 12 13 14 Next