Thyagarajan Ramanujam

Greenhorn
+ Follow
since Mar 24, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Thyagarajan Ramanujam


Thanks for your reply. I added those jar. But still not able to resolve the issue.
11 years ago
Hi,

I am using eclipse Helios to develop a Struts 2 (using Struts 2.3.4.1.jar) application. I have added the jar files. I started developing as Dynamic Web Project in Eclipse. I am also using spring with the application.

When I call any action class, NullPointerException is thrown in StrutsActionProxy.java.
java.lang.NullPointerException
org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:501)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:432)

While debugging the code, I found the cause for this: It says HttpServletRequest.java cannot be resolved. It is indirectly referenced from required .class files

I feel there are 2 jar files which contains the class. I found one is in spring-web-3.0.jar. And other will be automatically included by eclipse for a dynamic web project. I could not remove the spring jar because it contains ContextLoaderListner.class

I searched for possible solution. But I could not find any.

Any help is appreciated.
Thanks.
11 years ago
HI,

I would like to redirect to login page on session time out. I looked at HttpSessionListener but I could not find any thing which does this. I looked at some examples which says to check the session whether is it new or not in the servlet. This can be checked only when the user click a link or a button. But in my case, after some period of inactivity, it should automatically redirected to login page.

Any help is appreciated..
12 years ago
It is not due to multiple object creation in the for loop.

When you have a non-static object of a class as instance variable within the class itself, you will get this exception.

when you say new BankAccount(), BankAccount object is created which itself creates another BankAccount object and this goes on happenning and eventually you will end up with StackOverFlowError.

but when you declare the object as static, you have only one object. so you dont get that exception.
13 years ago
Hi,

Can someone explain how the usage of interfaces can reduce coupling?

Thanks
15 years ago
I apologize for not using meaningful subject lines.

import java.sql.*;

public class DatabaseConnection {

public Connection getConnection() throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:database");
return con;
}

/*public static void main(String... args) throws Exception
{
Connection con = new DatabaseConnection().getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from UserDetails");

//Iterating the result set and displaying the details.

}*/
}


Yes. I mean DSN. I have set the datasource as User DSN. But if it is the case, I should not get the connection object when i run as the class as Stand Alone(calling the static main method).

Why this is happenning when the method is called from Servlet. Any way, I will try to make the datasource as System DSN and try it again.
Hi,

I have a class(DatabaseConnection.java) which has methods which do database stuff(loading database driver, creating connection to the database and executing some queries).
I am using MS access database and the datasource is created properly. "sun.jdbc.odbc.JdbcOdbcDriver" is the driver.

The problem is when i use the class from any servlet to get the connection to the datasource, the connection object is returned as null. But when i put a static main method in the same class and try to access the database, it works fine.

I could not find the reason and i could not get any help.

Any help is appreciated.
Thanks


Hi All,

I want to add a new column named version with initial value 0 for all the tables present in a database. What can be done to do this?

Any help is appreciated.
Thanks Maneesh. It worked.
15 years ago
Hi,

Is there any way to right align the text in a JCombobox and also in a JSpinner.

I tried using setAlignmentY() but it does not help.

Any help is appreciated.
Thanks
15 years ago
Hi,

How to stop printing the current page and continue from the next page?

For example, My document has 2 pages, First page is getting printed. When a part of the page is printed, the page should be skipped and the printing should resume from the next page.
16 years ago
MS word document.
16 years ago
Hi,

I am writing some data into a file along some pictures. Suppose if a file can have 50 lines and already there is some text in 30 lines. Then I have to insert a picture which has a height which will be greater than 20 lines. In this case, the image should be written in the next page in the same document.

What should be done in this case?

Thanks. Any help is appreciated.
16 years ago
Anonymous class already a sub class.(ie) it already has a superclass. In java, a class cant have more than one super class.


For example,

Father son = new Father(){ };

the anonymous class extends Father class. So no further use of extend is possible.
16 years ago
The password field does not gets focus. But if you see the console, it will be shown that the pasword field got focus and then the focus will be set back to the userfield.
16 years ago