After seeing many hidden features about programming language, i would like to know hidden features of Spring "de facto" framework. As you know, Spring documentation hides many features and would be nice to share it.
And you: what hidden feature of Spring framework do you know ?
...
Ok, I want to make my program print out the date: 1/1/2009
But this is what it prints out:
Thu Jan 01 00:00:00 EST 2009
From this code
GregorianCalendar startDate = new GregorianCalendar(2009, Calendar.JANUARY, 1);
public void setStart()
{
startDate.setLenient(false);
Date date = new Date(startDate.getTimeInMillis());
Sy...
I have a query, I want that if a user is already logged in to a web page and again he Relogins from same or different machine then his previous session should be killed and automatically he gets log out to main page. I'm using jquery at client side and servlets at backend. I'm using tomcat 6 as web server and jdk1.6 compiler. I just wan...
I have a typical enterprise/business application that I am developing that includes orders, salespersons, contacts, reference data, etc... There will be at least 100 or more users on the system at a time who are entering new data, changing data, etc. I need to provide search capability across the application for almost all tables.
O...
I was reading Joshua Bloch's "Effective Java Programming Language Guide".
He explains static factory methods could be used to avoid unnecessary duplicate objects.
I haven't quite understood this.
Could anyone explain?
...
I have a situation where i need to send commands to a running java application, now i am using tcp/ip socket to send commands to the application using a internet explorer context menu item. But as soon as the application starts virus scanners complain that the application started listening, although i am only listening for local connecti...
GregorianCalendar startDate = new GregorianCalendar(2009, Calendar.JANUARY, 1);
SimpleDateFormat sdf = new SimpleDateFormat("d/m/yyyy");
public void setStart()
{
startDate.setLenient(false);
System.out.println(sdf.format(startDate.getTime()));
}
When I run this code, I get 1/0/2009. I also get the same thing when I change the ...
I recently read the blog posts on Pushing Pixels that describe how to achieve native transparency and translucency with pure Java. The needed classes reside on com.sun.awt namely com.sun.awt.AWTUtilities.
I was wondering how i could include the needed classes (not just this one) into my distro since the classes are available only when y...
Hi,
I am implementing a functionality in my web app such that a client can generate the report by entering some data and clicking on the submit button.
The problem is that report generation takes lot of time and the report might not generate if the user entered data is wrong.
The complete report generation task has many sub-tasks and ...
I have a program that needs to start on 1/1/09 and when I start a new day, my program will show the next day.
This is what I have so far:
GregorianCalendar startDate = new GregorianCalendar(2009, Calendar.JANUARY, 1);
SimpleDateFormat sdf = new SimpleDateFormat("d/M/yyyy");
public void setStart()
{
startDate.setLenient(false);
...
I want to implement a autmatic billing systen for one cybercafe.MEasning when some one want to surf net in my cafe he goes to attendent and attendent allocates him the pc and gives him the passswd which is generated by the applciation and the passswd will be valid for specific time(session of 1 hr or so depending on customer needs).Now ...
public class Order
{
static Customer cust = new Customer();
string sEmpty = "";
public static void main(String args[])
{
int iTotal = 10;
string sProductName = "Salt";
Ship shp = new Ship();
}
}
At the above code, which object and reference is created in the which part of memory? (I mean Hea...
Hi,
Thanks for your answers. I'm still having a fault saying manifest file does not contain a file/object attribute, after I had created my jar file for my application. I'm doubting maybe I didn't know what exactly the main-class represent in a manifest file while writing the code. please illustrate taking an example from the HelloWorld...
In Java, static final variables are constants and the convention is that they should be in upper-case. However, I have seen that most people declare loggers in lower-case which comes up as a violation in PMD.
e.g:
private static final Logger logger = Logger.getLogger(MyClass.class);
Just search googleor SO for "static final logger" ...
When I enter a string that it not in the list, I get this error in my enum CrimeType
class: IllegalArgumentException, no enum const class CrimeType.a(in java.lang.Enum).
What does it mean and how can I fix this?
public void enterCrime()
{
Crimes crimes = new Crimes();
System.out.print("\t\tEnter crime: ");
crimeName = In...
Hi,
for a project that targets embedded systems (such as a NAS) I am looking for an embedded Java VM that would support Java 5 and up. Currently, Java 1.4 is supported by VM like IBM's J9. But since Java 1.4 has reached its end-of-life I would be interested whether there are alternatives available, open source or commercially.
Any idea...
hi
i find out that i must write a policy file to grant permission for my applet...
but i really confused with it... :(
i want to write a applet that is a map viewer, i need to save image tiles on client that run my applet to locally access tiles for gain speed and time safely viewing map which is benefit to user...
so, the applet nee...
When logically something seems as if it would be dead simple, then it turns out to be completely convoluted,
I have not used Java much, so please forgive my ignorance. Here is what I am trying to do:
I have a nice clean algorithm in one .java file, and I want to feed it from an initialized array. The array contains over 40,000 elements...
I have managed to run my jar file with a command prompt, but its always giving me a reponse of : could not find the main class:XX. Program will exit. Please help me out?
Thanks
...
When I enter a string that it not in the list, I get this error in my enum CrimeType
class: IllegalArgumentException, no enum const class CrimeType.a(in java.lang.Enum).
What does it mean and how can I fix this?
public void enterCrime()
{
Crimes crimes = new Crimes();
System.out.print("\t\tEnter crime: ");
crimeName = In...