Hi Friends...
i have a little question..
how to handle the java.lang.NullPointerException..
iam sorry if this is probably common question first..
example i have made 2 Actions class..
its named NewCategory, and InsertCategory..
NewCategory is Parent Class, which provide all properties, example
private
String categoryCode;
private String categoryName;
..
InsertCategory is Sub Class
in the NewCategory i just write code like this :
and in the InsertCategory, i override validate method and execute method, example..
i configure both of NewCategory and AddCategory, so i just call them like this one :
http://localhost:8080/MyApplication/Category/newCategory.action -> (For NewCategory Action)
http://localhost:8080/MyApplication/Category/insertCategory.action -> (For InsertCategory Action)
when i go to URL
http://localhost:8080/MyApplication/Category/newCategory.action, and the Form displayed..
then i submit.. its run well..
but..
when i direct go to URL
http://localhost:8080/MyApplication/Category/insertCategory.action, and the Message Error (NullPointerException) displayed..
is it any way to handle the NullPointerException?
example i want to if any error happened i want to redirect it to some page..
Thanks in advance..