0

Getting values of textbox in Javascript

In javascript, do not use, document.getElementById("ID"); to get value from the input elements. It works in IE but not in FF.

so use like

var value = doucment.forms[0].txtName.value;

|
1

Using Kaptcha in JSP page within WEB-INF folder

Since our JSP page in inside WEB-INF folder, we need to give path starting from the context path.

in JSP page

instead of <img=kaptcha/>

place

<img=<%request.getContextPath()%>/kaptcha/>

|
0

Java ClassPath Problem

If NoClassDefFoundError occurs when we execute a class, it might be a classpath error.

It can be solved by placing .; before each path

where '.' refers that classpath is accessible from any folder

|
0

load-on-startup (load-on-startup tag) in Servlet

Used to decide whether servlet will be " lazily " or " eagerly " loaded.
Specified in web.xml file. If the value is not specified or is a Number < 0 then it means " lazy loading "

What " lazy loading " means is that servlet is NOT loaded by container on startup Servlet in this case is loaded on the first client request - so the first client can experience poor performance

" Eager " loading means that the servlet is initialised on container startup If there are two servelts A & B with values 0 & 1 than it means that Servlet A ( having value = 0 ) will be loaded first So if there are more than one servlet this element specifies the order of loading - lower integer values ( including zero ) are loaded first

If you specify this element but do not provide the value - even then the servlet will be the first servlet that gets loaded

To ensure that servlet follows " lazy loading " - do not provide this entry at all in web.xml file OR provide a negative number

|
0

IllegalStateException : Error: Attempt to clear a buffer that is already been flushed

Sometimes <logic:forward/> give IllegalStateException: including error message like

Error: Attempt to clear a buffer that is already been flushed


This is related to the buffer overflow error. To solve this error, you can just set the page directive parameter autoflush to true or increase the buffer size by setting the buffer parameter.
By default the buffer size is 8K, and all the HTML output is stored in this buffer before JSPWriter flushes it to the output. If the content size exceeds this default size, then there will be an exception, like the one you are getting.
If the value of "autoflush" parameter is true, then whenever the buffer is full then the contents of this buffer will be automatically flushed.

|

Copyright © 2009 So That I Can Remember All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.