Regarding Login application program

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









Related Tutorials/Questions & Answers:
Regarding Login application program
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... the login form example from: http://roseindia.net/struts/struts-login
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
Advertisements
Login Program
Login Program  Login program in struts to set username & password in session. and this session is available in all screens for authentication...   Hi, Please read it at:ADS_TO_REPLACE_2 Login/Logout With Session
regarding connectivity program only - JDBC
regarding connectivity program only  can u give me code regarding .. that i had created student data base with his name and subject marks resp ... i use html in front end ...that there r options like 1.name---------- 2.sub1
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
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
regarding connectivity program only - JDBC
regarding connectivity program only  can u give me code regarding .. that i had created student data base with his name and subject marks resp ... i use html in front end ...that there r options like 1.name---------- 2.sub1
login application - Struts
login application  Can anyone give me complete code of user login application using struts and database?  Hello, Here is good example of Login and User Registration Application using Struts Hibernate and Spring
mobile banking login program
mobile banking login program  static Display dis; static Login destroy; public Login() { dis=Display .get Display(this); } public void startApp() { destroy=this; LoginScreen
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
iframe application facebook login
iframe application facebook login  Create link to facebook from iFrame application
Login Application
Login Application       This tutorial provides some simple steps for creating a website login application that can be used later in any big Struts Hibernate and Spring based
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
Struts 2 Login Application
Struts 2 Login Application       Developing Struts 2 Login Application In this section we are going to develop login application based on Struts 2 Framework. Our current login application
program code for login page in struts by using eclipse
program code for login page in struts by using eclipse  I want program code for login page in struts by using eclipse
Creating Midlet Application For Login in J2ME
Creating MIDlet Application For Login in J2ME  ... application for user login . All MIDlet applications for the MIDP ( Mobile Information... as a mediator between the application and the environment in which the application runs
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
JSF Simple Login Application
:view> <html> <head><title>JSF Simple Login Example<...;td><h:outputText value="Enter Login ID: " /></td> <... for the resultforfail.jsp file: Login Failed! Here is the code
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
JSF Validation In Login Application
:view> <html> <head><title>JSF Simple Login Example<...;td><h:outputText value="Enter Login ID: " /></td> <... for the resultforfail.jsp file: Login Failed! Here is the code
jsp/servlet login program - JSP-Servlet
jsp/servlet login program  hello sir, well i have a problem with some code(loginbean.jsp),which i actually got from ur site: i am trying to create a login program where a new user will be registered and his/her details stored
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
Login Screen of Application
Login Screen of Application       Login Screen our web application allows the user... to logged on the system.  Login Screen: ADS_TO_REPLACE_1 Field Description
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
login program
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
Remember Me Login Application In JSF
Remember Me Login Application In JSF     .... This section gives you an application which facilitates for login. But basically this is a different type of login application in which, you will get a two text
JSF Simple Login Application - Java Server Faces Questions
JSF Simple Login Application  Hi there, I have implemented all the things which you mentioned in " JSF Simple Login Application " . but as i insert USER_ID and PASSWORD then it is showing an exception which
How to program an application for? - Java Beginners
How to program an application for?   How do you write an application to count the number of both odd and even integers of several positive integerss? Then the final display is the total of how many odd numbers were entered
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
Login or Cancel Application Using Ajax
Login or Cancel Application Using Ajax     ... implementation of login application with features like submit and cancel buttons using... with features like submit and cancel buttons. This login application first
Integrating Login And Registration Application In JSF
Integrating Login And Registration Application In JSF...; This tutorial explains integration of login and registration modules into one application. In this application, if the user is valid
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
RichFaces: Login & Registration Application:
RichFaces: Login & Registration Application  ... the responsiveness of the application. In this application, Login page appears first... into the application for further actions. After successful user login, user can edit
Struts 2 Login Application
to make the login system for Struts2 based applications. Login application...Examples of writing and testing Login Applications in Struts 2 framework... will show you how to make the Struts2 Login application.ADS_TO_REPLACE_1
Session tracking in login jsp program - JSP-Interview Questions
Session tracking in login jsp program  I have using jsp technology in my project.I want to do session tracking in my login form.After logout when i press back button it should be show session is expired.Please help me. Send
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
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
login  how to login admin and user with the same fields(name & password) in single login page while the table for admin and user is seprate in database(mysql) please provide me solution
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
Ajax Login Program
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  
login
login  i want to now how i can write code for form login incolude user and password in Jcreator 4.50   Hello Friend, Visit HereADS_TO_REPLACE_1 Thanks
login
java.awt.event.*; class Login { JButton SUBMIT; JLabel label1,label2; final JTextField text1,text2; Login() { final JFrame f=new JFrame("Login Form...(); ResultSet rs=st.executeQuery("select * from login where username='"+value1

Ads