Hello All,
I appreciate anyone's assistance. I wanted to validate user customizable
field values so I changed my JSP page so that the form action would post
existing form - action=<%= getRequestURI() %>. Upon form loading after
submit verify field values and if any are left empty a message would be
posted, and again form would be reposted until all field values were
confirmed not to be empty. If field values were not left blank then it would
automatically call a servlet to store the field values entered. The jsp page
and form worked perfectly until I tried to implement the field validation.
What happens is any object that I attempt to initialize after the form is
loaded for the second time (after action=<%= getRequestURI() %>) results in
a null pointer exception.
For instance the following works perfectly the first time around, but on the
2nd pass the second line of code draws a null pointer exception.
UserSelections us =
(UserSelections )request.getAtt ribute(Property Constants.USER_ SELECTIONS);
int selectedModelId = us.getModelId() ;
Any help would be greatful,
Mike 1 4344
"jennifer johnson" <mj********@ver izon.net> wrote in message
news:1A******** ***********@nwr dny03.gnilink.n et... Hello All,
I appreciate anyone's assistance. I wanted to validate user customizable field values so I changed my JSP page so that the form action would post existing form - action=<%= getRequestURI() %>. Upon form loading after submit verify field values and if any are left empty a message would be posted, and again form would be reposted until all field values were confirmed not to be empty. If field values were not left blank then it
would automatically call a servlet to store the field values entered. The jsp
page and form worked perfectly until I tried to implement the field validation. What happens is any object that I attempt to initialize after the form is loaded for the second time (after action=<%= getRequestURI() %>) results
in a null pointer exception.
For instance the following works perfectly the first time around, but on
the 2nd pass the second line of code draws a null pointer exception. UserSelections us = (UserSelections )request.getAtt ribute(Property Constants.USER_ SELECTIONS); int selectedModelId = us.getModelId() ;
Any help would be greatful, Mike
From the jumble of words provided, I'd say the variable "us" is null. Why
that is I couldn't really say, but that's your problem. If it works the
first time and not the second time, it's because you've stored an object
under the name specified by PropertyConstan ts.USER_SELECTI ONS the first time
but not the second. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Toufani |
last post by:
Hi everybody,
I want to retrieve information about objects in active directory
windows 2000 and their properties. I got some codes that don't work
absolutely. for example I can't retrieve users list and group list
separatedly.there is my code that downloaded from the internet :
public class LdapAuthentication
{
private string _path;
|
by: Aguilar, James |
last post by:
Hey guys. A new question:
I want to use an STL libarary to hold a bunch of objects I create.
Actually, it will hold references to the objects, but that's beside the
point, for the most part. Here's the question: I want to be able to change
the references (including deleting them). Is there any way to do that
besides using pointers rather than references for the STL library? I'd also
prefer to avoid using const_cast, if it is indeed...
|
by: sindre |
last post by:
Hi,
Some place I use links to submit forms instead of a submit button. The
way I have done this is: <a
href="javascript:document.getElementById('<?php print "delete$i"
;?>').submit()>Delete?</a>.
This method worked perfectly fine. But then I also wanted to add a confirm
box to the user where. A confirm("do you really want to delete?").
So I made the function:
function controll()
|
by: Tony Cheng |
last post by:
for (int i=0; i<_request.Form.Count; i++ )
{
string key = _request.Form.GetKey(i);
if ( !key.Equals("formCode")
&& !key.Equals("formLanguage")
&& !key.Equals("__VIEWSTATE")
&& !key.Equals("__EVENTARGUMENT")
&& !key.Equals("__EVENTTARGET")
&& key.IndexOf("sendButton")<0
&& key.IndexOf("clearButton")<0
|
by: RCS |
last post by:
So I have an ArrayList that gets populated with objects like:
myAL.Add(new CustomObject(parm1,parm2));
I'm consuming this ArrayList from an ObjectDataSource and would like to have
this support sorting (because it's ultimately being consumed in a GridView).
I can't simply sort the ArrayList (because it only knows it's holding a
bunch of objects). So I need a way to sort the ArrayList, based on the
data - that is within the objects that...
| |
by: Lüpher Cypher |
last post by:
Hi,
Suppose we have a hierarchical class structure that looks something like
this:
Object
|
+-- Main
|
+-- Object1
|
by: dcassar |
last post by:
I have had a lively discussion with some coworkers and decided to get
some general feedback on an issue that I could find very little
guidance on. Why is it considered bad practice to define a public
member with a return type that is derived from System.Exception? I
understand the importance of having clean, concise code that follows
widely-accepted patterns and practices, but in this case, I find it
hard to blindly follow a standard...
|
by: Yevgen Muntyan |
last post by:
6.2.4 of standard says:
"The value of a pointer becomes indeterminate when
the object it points to reaches the end of its lifetime."
Do I understand it right that value of pointer may
or may not change? What I am wondering about is this:
int a_func (void)
{
char *s = malloc (10);
|
by: MikeT |
last post by:
This may sound very elementary, but can you trap when your object is
set to null within the object?
I have created a class that registers an event from an object passed
in the constructor. When my object is destroyed, I want my object to
un-register this event. If I don't then the object would never be
destroyed until the object I passed in the constructor is destroyed.
I have implemented a Dispose(), Dispose(bool), and ~Finalize...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |