Regarding Login application program

Ads
 

Regarding Login application program

Hi this is shiva. iam writing a small login form using struts1.3.10 version. once iam submit the login button it shows NULLPointer Exception. I write a SOP Statement in ActionClass. in that, the values are not getting from the formbean.my formbean class name is "myform" and ActionClass is "myAction". the following code is written in myAction class.

public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse res)throws IOException

{

    myform Logf=(myform)form;
     String un1=Logf.getUn();
     String pa1=Logf.getPw();
    System.out.println(" Error  USER NAME:"+un1);
    System.out.println(" Error PASSWORD:"+pa1);
        if(un1.equals("shiva")&& pa1.equals("shiva"))
        return mapping.findForward("success");
        else
        return mapping.findForward("fail");

}

} .

The following Error is shown by JBOSS Server.

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NullPointerException org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.NullPointerException org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:289) org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:357) org.apache.struts.chain.commands.CreateActionForm.execute(CreateActionForm.java:92) org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191) org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305) org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191) org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the JBoss Web/2.1.3.GA logs.

JBoss Web/2.1.3.GA

-----------------------

is there any problem Please send to my mail id([email protected]), Thanks&Regards, Shiva s

View Answers

October 19, 2010 at 1:27 PM

Hi,

Due to some configuration issues you form is not initializing

myform Logf=(myform)form;

And while typecasting it is giving java.lang.NullPointerException exception.

Please download the login form example from:

http://roseindia.net/struts/struts-login-form.shtml

Thanks

Ads









Related Tutorials/Questions & Answers:
login application
login application  how to create login application ?   Hi, Please check the following tutorials: Video tutorial - JSP Login Logout Example Login Authentication using Bean and Servlet In JSP simple code to login user
Spring login form application
Spring login form application  Hi Please give me the Spring login form application so that i can understand its flow ?   Hi please find the link of the tutorial Spring Applications
Advertisements
login module program
login module program  hello friends i want to develop the web service using .net pls send the login ejb module .net program to my mail id
login module program
login module program  hello friends i want to develop the web service using .net pls send the login ejb module .net program to my mail id
iframe application facebook login
iframe application facebook login  Create link to facebook from iFrame application
jsp/servlet login program
jsp/servlet login program  <%@ page language="Java" import="java.sql.*" %> <HTML> <HEAD><TITLE>DataBase Search<...; </html> When I run the program, I get an error: The requested resource
Regarding connection between sqlserver 2005 and android application
Regarding connection between sqlserver 2005 and android application  hi to all, i want to know how to create webservice to connect sqlserver 2005 and android. can you please help me by providing source code for ref.. thanks
Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers
GUI application program
GUI application program  Write a GUI application program that meets the following requirements: Create an array with 100 randomly chosen integers. Create a textfield to enter an array index and another textfield to display
College Application Program
College Application Program  Please read the following carefully and submit the program code. Question # 144 A college is good if it satisfies the following conditions: Its number of students is greater than 1000. If the name
getting classnotfound exception while running login application
running the Login Application   Have a look at the following link: Spring Login Application...getting classnotfound exception while running login application  hi
About Struts 2.2.1 Login application
.style1 { margin-left: 80px; } About Struts2.2.1 login application In the most common login application there is  login form which is takes... / browser. To create an login application At first create a login page in JSP
Spring, Hibernate login and registration application
Spring, Hibernate login and registration application Spring, Hibernate login and registration application tutorial with video instruction Learn how to make fully function login and registration application in Spring and Hibernate
How to make Struts Hibernate and Spring Based Login/Registration Application?
How to make Struts Hibernate and Spring Based Login/Registration Application... Login/Registration Application. Thanks... in Hibernate. Is there any code for to make Struts Hibernate and Spring Based Login
problem in swing program for opening two windows with same login credentials
problem in swing program for opening two windows with same login credentials  I Face two problems while writing the code in swing program 1.i developed one application using swings that has username,password when i login
Computer forensic application development using JAVA program
Computer forensic application development using JAVA program  Write a computer forensic application program in Java for Recovering Deleted Files and Deleted Partitions
login program
Project of a web application that performs login logout with eclipse / tomcat
Project of a web application that performs login logout with eclipse / tomcat   Building a web application that is able to handle the log-in and log..., the home page and if'. Constraints of creation: - Use cookies to maintain login
write a program for complete JDBC based application
write a program for complete JDBC based application   thank you sir... based application where in the user supplies the following table as input and the program should have the facilities of Adding, Modifying, Viewing and Deleting
Hibernate Simple Program Using Java Application with Eclipse
Hibernate Simple Program Using Java Application with Eclipse  How to write Hibernate Simple Program Using Java Application with Eclipse? I wish to learn Hibernate using very popular Eclipse IDE. Share me the best tutorial link
Struts 2 Login Application
to make the login system for Struts2 based applications. Login application... will show you how to make the Struts2 Login application. Login Form...Examples of writing and testing Login Applications in Struts 2 framework
Downloading MyFaces and creating web application
we will learn how to create web application for our login and registration example program. Alternatively you can also download the integrated web application...Downloading MyFaces and creating web application  
Regarding Project
Regarding Project  sir, i am doing a project in java. my project is CITY GUIDE it is an web application. please give me documentation of my project
Regarding Project
Regarding Project  sir, i am doing a project in java. my project is CITY GUIDE it is an web application. please give me documentation of my project
Ajax Chat Application,Ajax Chat Application Program,Online Ajax Chat Application
Ajax chat Application Program Ajax chat application program request to server without refreshing the web page.  In this Session you will learn the how to display massage. This program call the method 'callchat()' for the massage
login
login  How to create login page in jsp
login
login  How to create login page in jsp
login
login  login page display an error showing failure to login even when the correct information is entered
Ajax Login Program
regarding project
regarding project  OBJECTIVES OF THIS PROJECT: -Ability to test... answers. -Ability of the programmer to definitely write a work program. -Deliver quality code, ie not just working program but also ensure that the program performs
regarding project
regarding project  OBJECTIVES OF THIS PROJECT: -Ability to test... the relevant answers. -Ability of the programmer to definitely write a work program. -Deliver quality code, ie not just working program but also ensure

Ads