Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Struts Regarding Login application program

Have Programming Question? Ask it here!
 
 
 


shiva
Regarding Login application program
1 Answer(s)      3 years and 10 months ago
Posted in : Struts


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(shivatwoshiva@gmail.com), Thanks&Regards, Shiva s


Advertisement
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... it is giving java.lang.NullPointerException exception. Please download the login form
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..., Please read it at: Login/Logout With Session Accessing Session Object Thanks
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
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
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
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
iframe application facebook login
iframe application facebook login  Create link to facebook from iFrame application
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
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
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
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
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
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
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
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: Field Description: Login Id
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
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
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
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
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
Remember Me Login Application In JSF
:view> <html> <head> <title>Remember Me Login... web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3// EN" "http
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
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
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
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
login
login  login page display an error showing failure to login even when the correct information is entered
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
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 Here 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
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
login
login  how to create login page in jsp   Here is a jsp code that creates the login page and check whether the user is valid or not. 1...;tr><td></td><td><input type="submit" value="Login">
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
login
login  i am doing the project by using netbeens.. it is easy to use the java swing for design i can drag and drop the buttons and labels etc.. now i want the code for login.. i created design it contains the field of user name
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
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
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
Advertisements
 

 

 

DMCA.com