"What if? Why not? Challenge the Convention! Let's do some incredible things!" More Quotes
Home
About/Contact
Twitter
Aspire/J2EE
Github
Pro Android 4
Our Android Books
Lookup Meaning
look up
more ..
Stuff I used to do
java.net Blog
At O'Reilly
Articles
Humanities
Humanities Current
Humanities 2007
Telugu related
Shells
Books
Music
Letters
Recipes
Jax Restaurants
Java
J2SE/J2EE/JSP
Portlets
Research
OSCON 2004
Download OSCON 2004 Presentation
OSCON 2003
Magazines
Dotnet
FTP
Industries
Supply Chain
Health
9-Sep-20
Eclipse shortcuts
6-Sep-20
Java integration notes
How to get a list of files from a directory
/* ******************************************************** * GetFiles ******************************************************** */ List FileUtils.GetFiles(String directory) { File dir = new File(directory); return ConvertArrayToList(dir.list()); }
Java API and references 2020
1-Sep-20
Regex XRef
19-Aug-20
working with regular expressions in Java
14-Aug-20
Working with date and time
13-Aug-20
Expression language notes
12-Aug-20
json and java
Working with JUnit
11-May-19
Language files
19-Jun-17
Concurrency and Hashmaps in Java
18-Jun-17
StringWriter s = new StringWriter(); PrintWriter out = new PrintWriter(s); ...write something to out StringBuffer output = s.getBuffer();
Click on the item above to see more.
15-Jun-17
jaxb 2.x architecture supports metadata based marshalling and unmarshalling of xml. This makes xsd optional unlike the jaxb 1.x architecture
The project is a simple project where an xml file is marshalled and unmarshalled using jaxb 2.x. All of the files needed to accomplish this are provided on the right hand side of the menu.
14-Jun-17
public static String getSystemTempDirectory() { return System.getProperty("java.io.tmpdir"); }
What is the state of Java Serialization in Java 8 and up?
On Guava
whats up with go?
Future of IDEs? Eclipse?
4-Oct-14
Java coding guidelines
30-Aug-14
Dynamic Proxies
29-Aug-14
How to work with arrays
27-Jul-14
What is a static java class?
5-Jul-14
What is volatile in Java?
23-Jun-14
You can use this reference page as a cheatsheet while programming in java
6-Jun-14
Java enums
9-May-14
For some time now Java compilers allow you indicate some methods in your class definition as overridden methods.
You do this by annotating the method signature with a code snippet such as
@Override public void somemethod(){}
By doing so you tell the compiler to see if this annotated method exists in base classes or in the inheritance hierarchy. If it is, nothing happens. If it isn't you, the programmer, have made a mistake, because you expected it to be there. So perhaps misspelled it.
In JDK 1.5 this annotation will throw an error if the method is abstract in the base class.
Either it is corrected or deemed more useful in later JDKs and you can now safely provide this annotation on methods whose baseclass representations are abstract.
this annotation will also guard against some of the base class changes where a method is removed which is overridden in derived classes. You now will know that that happened.
this protection is especially important in frameworks where lot of callbacks are used like the container managed Android components.
bottom line, say @override if you expect this method to be in the base class and you are overriding it.
13-Apr-14
Understand javax.activation.DataSource etc...
Why is it not a bad idea to delete things at garbage collection time!
3-Nov-13
A computer language must pass its teach-ability test to a middle school-er!!
Does a default constructor call the baseclass constructor?
Be wary of constructors invoking virtual methods directly or indirectly!
31-Oct-13
Coordinated flight pattern for Objects
Build health monitors into your source code
22-Oct-13
Multiple class inheritance in Java
19-Oct-13
Pattern of constraining an object construction
A construction pattern for dependent objects
31-Oct-12
29-Sep-12
What are the Java projects in Apache?
14-Aug-12
What is a weak reference?
19-Jun-12
What is Refinery CMS?
What is Stripe?
9-Jun-12
I have a medium to a large enterprise. The software we are producing is buggy. It is brittle. It often fails. It is often down. It often allows me to delete things that I shouldn't be able to. It takes too long to respond. It is slow. It gives unexpected results. It doesn't stop me from shooting myself in the foot. Why does this happen and how can I improve the state of code quality in my enterprise?
7-Jun-12
windows azure cloud
26-May-12
Life and Careers
17-May-12
Whats up with Cloud IDEs?
Whats up with OpenData?
So where are the java clouds
12-May-12
Java string substitution/formatting
5-May-12
In bouts of romanticism (I am prone) and expediency I do like type less languages, but for maintenance and sure-footing and transparency typed languages like Java, when paired (may-be-must) with a right tool like eclipse, are a pleasure to program in.
There will be times in the near future one may be able to see objects as both typed or open ended structures (such as type less arrays) to provide just-in-time objects.
23-Apr-12
http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html
A very nice document on the usage and motivations behind assertions in JDK 1.4
16-Apr-12
what does Azure has for Java?
9-Apr-12
14-Apr-11
Java memory settings
2-Jan-11
walking through java enumeration
28-Dec-10
Jar finder
Pretty neat
An example to find org.apache.xpath.XPathAPI.
23-Dec-10
Java and Browsers
28-Jul-09
jsp caching expire tag
27-Jun-09
Sample code for arrays
12-Dec-08
How to explore android source code
Where is the source code web site? Can I get java source for just the android.jar? Can I browse sources online? How can I debug into android java source code from eclipse?
Click on the link above for full details and other helpful links.
16-Aug-08
http://java.sun.com/developer/technicalArticles//Collections/Using/#toi
source:sun complexity:medium depth:medium style:verygood
11-Aug-08
how to use thread local in java
3-Jul-08
Research notes on Master Data Management, Common Data Models, Customer Data hubs.
24-May-08
Available from IBM IT Skills Development center the following link provides a number of collected articles across the web. I am planning on reading them in my spare time.
See the list of articles.
I must warn you however that there is a couple of years old article from me that made the list. That should make this list suspect to its profoundness :). However there seem to be other topics of weightyness that I feel comfortable with the recommendation.
29-Apr-08
These notes illustrate an interesting way of developing and using capture tags in jsp to accomodate masterpages or tiles. This specific example talks about how this is done in AspireWeb but the ideas can be easily extended to any java based server side framework.
The notes will explore a) how to define a jsp page in response to an incoming url in an MVC fashion b) it then goes into identifying a tiles or masterpage pertaining to that URL c) an example of the master page d) an example of the jsp page with capture tags e) the resulting out put combining the master page and the url specific jsp page. f) what the incoming url will look like
25-Apr-08
1. How can I enable a site for crawling better?
2. How to use jsp forward?
3. How can I pass parameters to a forward?
4. How can I retrieve parameters from a forward?
5. what is the odd behavior of a request when it is forwarded?
6. Can I forward between two contexts?
7. How to simulate a forward between contexts?
<jsp:forward page="<%=targeturl%>"/>
8-Nov-07
private int getNumberOfParameters(String ps) { int count=0; StringCharacterIterator sci = new StringCharacterIterator(ps); for(char c=sci.first();c != CharacterIterator.DONE; sci.next()) { if (c == '?') { count++; } } return count; }//eof-function
29-May-07
Notes to help with CVS
11-May-07
public static String htmlEncode(String inHtmlString) { String fromCharString="<>&"; String[] toStringArray = { "<", ">", "&" }; return encode(inHtmlString, fromCharString, toStringArray); }
Escape Special Characters from Java Best Practices
15-Jan-07
How can I access a local java class or a soap representation of it at run time with out using any stubs. Assuming I have the interface of the class and the domain objects for it.
Need you help. What is a good approach for accessing java interfaces remotely and in a transparent fashion?
What is a good approach for accessing java interfaces remotely? The answer seems too obvious. Use EJB session beans, or web services or RMI. is that the best way? Could I not use dynamic proxies and not use any client side or serverside skeletons and stubs? Can I not do this by not generating any thing? Would some one recommend WSIF to do this? What else is out there?
Phrased differently, if I have a jar file that contains an interface and the domain objects that support that interface, can I access one of its implementations that is sitting on a remote machine using a dynamic proxy. The protocol can be SOAP or EJB or just a plain homegrown over http for that matter.
Stated differently, if I were to implement a service layer using plain java interfaces and implementations, can I break that layer apart at deployment time with out involving any compile time changes. Such an option will give me the ability to multi-tier an application with very little fan fare. Programmers need even not know about SOAP or EJB etc.
For instance WSIF (web services invocation framework) seem to advertise a functionality that is similar in intent. But someone expereienced with WSIT comment on whether all you need is interfaces and domain objects? Also WSDL seem to be necessary for WSIF to work. Can it work with out any xml artifacts and assume a certain SOAP implementation and provide a dynamic proxy for it.
I am hoping someone out there looked into this before and I would like to hear from them. Either you can post the answer here or if you don't have an account, could you email me your opinion? My email is "satya at activeintellect.com".
Thanks in advance for considering this.
29-Dec-06
java time slice duration performance
2-Oct-06
Class baseClass; Class derivedClass; if (baseClass.isAssignableFrom(derivedClass)) { System.out.println( "derviedClass is derived from baseClass" + "or assignable a bit more precisely"); }
11-Aug-06
Wonder if you have come across these lines before:
"I fix myself an Omelete, sir, Of fluffy clouds, and sky ... I sew myself a warm cloak, sir, of hope and daffodils."
Unlike this fanciful dilemma of "Poor Angus" of Shel Silverstein, in large IT corporations HTML prototypes can play a much more significant role. They can aid faster development times. They can secure budgets. They can encourage good architecture. They can directly lead to a number of development artifacts such as data models, and business services. I think prototypes offer another important aspect to the modern development process along with the Extreme Programming and RUP.
3-Aug-06
Originally by Chris Adamson...
Copied and posted here by Satya Komatineni
See instructions from Chris Adamson...
18-Jul-06
8-May-06
4-Apr-06
Both of the following do the same
Given the following String somestring; void dosomething(){}
Consider the following code
if (somestring!=null&&!"".equals(somestring)) { //if the string is not empty dosomething(); }
Create a function as follows
boolean isValid(String somestring) { if (somestring == null) { //the string is null. so it is not a valid string return false; } //the string is not null //eliminate empty characters at both ends String newstring = somestring.trim(); if (newstring.equals("")) { //the string is an empty string //an empty string is (not) valid return false; } //it is a valid string because it is not null, it is not empty return true; }
Then you can do
if (isValid(somestring)) { //if the string is not empty dosomething(); }
if (somestring!=null&&!"".equals(somestring)) { //if the string is not empty dosomething(); } if (isValid(somestring)) { //if the string is not empty dosomething(); }
4-Mar-06
Notes to help with JSP
24-Jan-06
Majority of the JSF controls have a "rendered" property. If you set this to false, then that component and its children JSF components will not be rendered. Here is an example
While programming in JSF one may need access to the request object and also its attributes. The managed beans of JSF are also available in the request or the session objects. The following utility class allows you work the request object and get to the managed beans directly if the need is there
10-Nov-05
Taglib examples
1-Oct-05
/* * Created on Oct 1, 2005 */ package com.ai.typefaces; import java.util.Iterator; import com.ai.common.IDictionary; import com.ai.reflection.BeanInfo; import com.ai.reflection.BeanInfoRegistry; import com.ai.reflection.FieldInfo; import com.ai.reflection.ReflectionException; /** * @author Satya Komatineni * */ public class TypeFaceFacility implements ITypeFaceFacility { public Object castTo(Class objectClass, IDictionary dictionary) throws ReflectionException { //Instantiate the object based on the class //instantiate a bean info for this object //For each public field infos // get its name // get its value from dictionary // set the value using get or directly on the field info // return the object BeanInfo bi = BeanInfoRegistry.getBeanInfo(objectClass); Object targetObject = bi.constructObject(); Iterator fieldInfoItr = bi.getFieldInfos(); while(fieldInfoItr.hasNext()) { //for each field info FieldInfo fi = (FieldInfo)fieldInfoItr.next(); Object fieldValue = dictionary.get(fi.m_name); fi.setValueUsingString(targetObject,(String)fieldValue); } return null; } }
15-Jul-05
12-Jul-05
9-Jul-05
6-Jul-05
Notes on Java JSP Logging APIs
23-Jun-05
4-Mar-05
2-Mar-05
9-Feb-05
These days j2ee applications can be developed with out necessarily resorting to writing servlets. On the easiest of the paths one can use just JSPs to write their applications. Or if one were to use servlet controllers then also one rarely needs to write a servlet. Nevertheles even in those cases you have no servlets of your own other than what the frameworks provide, you may want to make sure certain parts of your application is initialized prior to accepting any requests from the clients. The following sample code will give you everything you need to do this quickly.
12-Oct-04
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Overview5.html
11-Oct-04
@rem mystartup.bat @set CATALINA_HOME=w:\satya\i\tomcat5028 @set JAVA_HOME=c:\java142 @set exe=%CATALINA_HOME%\bin\catalina.bat @call %exe% run %1 %2 %3 %4
10-Oct-04
I am able to debug a remote process such as tomcat once the tomcat is running. How can I monitor the tomcat when it is starting up?
This is necessary to observe the behavior of startup servlets.
Or is there any way to launch a remote debugging program while it is being observed?
Weird but true
set CMD_LINE_ARGS= :setArgs if ""%1""=="""" goto doneSetArgs set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 shift goto setArgs :doneSetArgs
8-Oct-04
http://jtds.sourceforge.net/
Microsoft jdbc driver seem to be extreemly slow. This is an alternative
7-Oct-04
http://www.kpdus.com/jad.html
The gold standard
1-Oct-04
http://www.microsoft.com/downloads/details.aspx?FamilyId=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en#filelist
17-Sep-04
jawk.jar regex12.jar
set pattern1="abc" set pattern2="xyz" set tempfile=c:\temp.txt dir /b /s c:\dir\*.jsp | java com.ai.jawk.CmdSubst @call gres.bat $1 %pattern1% %pattern2% %tempfile% > execjsp.bat @call execjsp.bat
14-Sep-04
http://java.sun.com/developer/technicalArticles/Servlets/servletapi2.3/
2-Sep-04
30-Aug-04
29-Aug-04
How can I start and stop servers?
1. Web project is already there
2. The source code is assuming a different project context
3. How do you change the context name and also the directory of the context
25-Aug-04
http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.7.0/docs/api/org/apache/commons/beanutils/package-summary.html
18-Aug-04
http://www-306.ibm.com/software/awdtools/studiositedev/
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html
9-Aug-04
http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html
22-Jul-04
http://java.sun.com/webservices/docs/1.3/api/index.html
10-Jun-04
A bit of Tomcat, a bit of Aspire, and a touch of master pages: and Microsoft Access comes to life. Having developed this simple minded content management system called AKC, when I look back I am given to think how well the web complements even the simplest and readily available of relational database systems. I use this site for my web logging, classified repository of articles, online documentation tool for the open sourced Aspire product, online educational tool for young children, a research aid for new technologies.
21-May-04
http://java.sun.com/webservices/docs/1.3/tutorial/doc/Encodings.html#wp64176
us-ascii iso-8859-1 utf-8 utf-16
http://java.sun.com/webservices/docs/1.3/tutorial/doc/WebI18N5.html#wp86518
briefly explains utf-8 Request encoding Response encoding JSP encoding
20-May-04
Aspire, the product that I developed over the last few years while I was working with java, servlets, jsp and XML, is being used on some SBIR projects involving JetSpeed and a few other open source tools. I have got a call the other day indicating that one of the forms is not accepting Vietnamese input. They are getting invalid characters placed into the MySQL database. The usage is pretty straight-forward. The user will see a form in a browser and will proceed to type Vietnamese (copy/paste perhaps from a Vietnamese app). This form will then be submitted to the server. The server is expected to parse the form input into parameters. Mahaveer suggested that perhaps I should be using some kind of character encoding to retrieve the parameters.
when it comes to complicated things such as setting digital watches, programming vcrs, ordering a sub for your spouse (Who always has a very discriminating taste), ordering at a local McDonalds drive through, self checkouts at Home Depot, and ofcourse software, I am a minimalist. If something is not hampering my imagination and productivity I usually don't upgrade. To exaggerate and make a point, I would be quite happy with windows 95, Tomcat 1.x, Frontpage, Jbuilder 3 for developing server side java applications that run in any container while David prods me all the time to upgrade to XP and how wonderful it is. (you can tell I am relegated to the auto pilot windows world). Anyway having made the point I still compile Aspire with servlets 2.1 although the current release may be at 2.4. Not that I don't like the new stuff in this particular instance but I want to be as backward compatible as possible as long as it is not crippling my style :-). For the curious I did upgrade to XP because I needed a better photo printing software.
Any way back to the encoding issue. I don't remember seeing any encoding issues while trying to read form submission parameters before. I remember porting one of our web sites to Japanese with out any problem last year. Based on that assumption I have advised Mahaveer that it should not be a problem and servlets probably will figure out the necessary details to retrieve the parameters. Ofcourse I am proven wrong.
19-May-04
http://java.sun.com/webservices/docs/1.3/tutorial/doc/index.html
http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html
4-May-04
http://java.sun.com/j2se/1.4.2/docs/api/index.html
29-Mar-04
http://java-virtual-machine.net/tech-faq.html
jdk 1.2.2 earlier versions won't run with pentium 4 Requires bug fixes for 1.2.2 Problem with the jit You can disable it by deleting the symcjit.dll from the jre bin directory.
2-Jan-04
Exceptions is one area where opinions differ considerably. Not only about the usage of exceptions but also about the need and utility of checked exceptions. I hear arguments from various sides. They all seem valid in their own right. I use interfaces heavily in my coding practice. Particularly in my J2EE tool Aspire. Over time I paid dearly for not declaring exceptions on these interfaces. Primarily because I would start out thinking that this interface is too simple and not declare an exception. Subsequent implementation of these interfaces will necessitate apis calls that throw checked exceptions. With out changing the interface either I need to throw a converted chained runtime exception or change the interface to include a politically correct middle of the road exceptions suitable for that interface
9-Dec-03
http://java.sun.com/docs/books/tutorial/collections/index.html
source:Joshua Bloch coverage:very high level:expert
3-Dec-03
http://today.java.net/pub/a/today/2003/10/10/configurationblues.html
For my comments on this click on the first link
http://www-106.ibm.com/developerworks/java/library/j-prefapi.html?ca=dgr-lnxw01PrefAPI
Emphasis on storing objects Very good set of references But does not cover the implementation available for a given preference api
http://java.sun.com/j2se/1.4.2/docs/guide/lang/chained-exceptions.html
2-Dec-03
Very detailed article on sun site about various guidelines on using Java assertions.
http://java.sun.com/j2se/1.4.2/docs/relnotes/features.html
Summary of New Features and Enhancements
Important day to day programming features 1
Logging API Assertions Preferences Chained Exceptions Collections Regular Expressions
Next set of Important features
JDBC 3.0 Java Web Start Endorsed Standards Override
http://developer.java.sun.com/developer/community/chat/JavaLive/2003/jl0729.html
http://java.sun.com/docs/books/effective/toc.html
For a quick run down of the principles as laid out by Joshua Bloch
http://java.sun.com/features/2003/05/bloch_qa.html
New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 1.5: A Conversation with Joshua Bloch
Discusses
Generics Enhanced for loop Autoboxing/unboxing Typesafe enums static import Metadata
26-Oct-03
1.ctrl-mm to start recording the t-macro 2.ctrl-ms to stop recording the t-macro 3.ctrl-mp to re-play the t-macro 1. ctrl-mr to start a named macro 2. ctrl-ms to stop 3. menu to play 4. ctrl-ml to repeat the last macro
7-Oct-03
In version 1.2 of the JDK software, you can run JAR-packaged applications with the Java interpreter. The basic command is:
java -jar jar-file
To make this work the jar file must have a manifest identifying the classname to run. Click on the link above to see more details.
3-Oct-03
20-Sep-03
public class SingleFileUploadPart extends ATurbinePart { protected Object execute(String requestName, RunData rundata, Map inArgs) throws RequestExecutionException { try { String fileuploadFieldName = AppObjects.getValue(requestName + ".fileUploadFormFieldName","filename"); FileItem fi = rundata.getParameters().getFileItem(fileuploadFieldName); //Get file item details String fiName = fi.getName(); String fiFileName = fi.getFileName(); long fiSize = fi.getSize(); inArgs.put("fileitem_name",fiName); inArgs.put("fileitem_filename",fiFileName); inArgs.put("fileitem_size",Long.toString(fiSize)); String targetFilename = AppObjects.getValue(requestName + ".targetFilename_WS"); String finalFilename = SubstitutorUtils.generalSubstitute(targetFilename,inArgs); String fullFilename = com.ai.common.FileUtils.translateFileName(finalFilename); fi.write(fullFilename); return fullFilename; } catch(ConfigException x) { throw new RequestExecutionException("Error:Config error",x); } catch(Exception x) { throw new RequestExecutionException("Error:filewrite error",x); } }//eof-method }//eof-class
Java 8 api
Java EE Home
Java EE API 7
JSP notes
JDK 8 Tools/Utils
java logging api
Android home
Android Notes
Blogs
Softwarecave
Page Menu
Print
Sort by Date
Sort by Name
Titles
> Summaries
Global Menu
My Web Logs
My Library
My Home
Other libraries
Author Content
data format