RE: RE: loading Dropdown dynamically from database

2011-03-16 Thread Biesbrock, Kevin
I feel like this should be added to the documentation, too. ::snicker::

Sorry, OT.

Beez

-Original Message-
From: Dave Newton [mailto:davelnew...@gmail.com] 
Sent: Wednesday, March 16, 2011 9:43 AM
To: Struts Users Mailing List
Cc: JavaNoobie87
Subject: Re: RE: loading Dropdown dynamically from database

On Wed, Mar 16, 2011 at 8:35 AM, JavaNoobie87 wrote:
> I tried the same but  my drop down becomes empty when i run the jsp 
> and the source generated from the select tag is as follows
>
>    --Select--
> Please advise.

Please use plain-text messages.

"The pastebin" isn't an attached message, it's something on pastebin.
Please don't attach files--they don't work on the actual mailing list.

The bottom line is that you're new to programming, and new to Struts 2. This is 
going to make things very, /very/ difficult for you, and for us.

You keep posting tiny little pieces of the puzzle. If you don't understand why 
it's important to tell the details, please read the following two resources:

http://www.coderanch.com/how-to/java/TellTheDetails
http://catb.org/~esr/faqs/smart-questions.html

We don't know how you're retrieving the things to show in the dropdown--you can 
post just the code for that.

You can also help yourself out by putting in readable, meaningful log 
statements (like indicating how many items are in the list being sent to the 
view layer (the JSP)). You can put breakpoints on code to see if it's actually 
being executed. You can take the time to understand how the framework functions 
by turning on devMode and cranking the log level up to DEBUG (this will 
generate a lot of output; be patient).

In short, really try to think about what's going on, and recognize that we're 
not in front of your machine and do not have any way to work out your issues 
without you providing us a lot of information.
This is the nature of what we do: it's inherently complex, and communicating 
that complexity is one of the greatest challenges we face.

Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-16 Thread Dave Newton
On Wed, Mar 16, 2011 at 8:35 AM, JavaNoobie87 wrote:
> I tried the same but  my drop down becomes empty when i run the jsp and the
> source generated from the select tag is as follows
>
>    --Select--
> Please advise.

Please use plain-text messages.

"The pastebin" isn't an attached message, it's something on pastebin.
Please don't attach files--they don't work on the actual mailing list.

The bottom line is that you're new to programming, and new to Struts
2. This is going to make things very, /very/ difficult for you, and
for us.

You keep posting tiny little pieces of the puzzle. If you don't
understand why it's important to tell the details, please read the
following two resources:

http://www.coderanch.com/how-to/java/TellTheDetails
http://catb.org/~esr/faqs/smart-questions.html

We don't know how you're retrieving the things to show in the
dropdown--you can post just the code for that.

You can also help yourself out by putting in readable, meaningful log
statements (like indicating how many items are in the list being sent
to the view layer (the JSP)). You can put breakpoints on code to see
if it's actually being executed. You can take the time to understand
how the framework functions by turning on devMode and cranking the log
level up to DEBUG (this will generate a lot of output; be patient).

In short, really try to think about what's going on, and recognize
that we're not in front of your machine and do not have any way to
work out your issues without you providing us a lot of information.
This is the nature of what we do: it's inherently complex, and
communicating that complexity is one of the greatest challenges we
face.

Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-16 Thread JavaNoobie87
Guess that didnt load properly.
Heres the pastebin for that snippet.
http://struts.1045723.n5.nabble.com/file/n3779718/ajms2KeY.txt snippet.txt 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3779718.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-16 Thread JavaNoobie87

JOSE L MARTINEZ-AVIAL wrote:
> 
> Check the documentation for the tag
> 
> http://struts.apache.org/2.0.14/docs/select.html
> 
> I was referring to the attribute  'name', which indicates the name used to
> get the select value from the Action, and also to send the value back to
> the
> server. It should be something like this
> 
> .
> 
> 
>
> 
I tried the same but  my drop down becomes empty when i run the jsp and the
source generated from the select tag is as follows 

--Select--






.
Please advise.


--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3779623.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-16 Thread JOSE L MARTINEZ-AVIAL
Check the documentation for the tag

http://struts.apache.org/2.0.14/docs/select.html

I was referring to the attribute  'name', which indicates the name used to
get the select value from the Action, and also to send the value back to the
server. It should be something like this

.

With respect to the id, it's something outside this forum, but what you have
is basically this:
  boolean output=false;
  int result = 0;
  try {
[...]
  if (listbean.getObjid()!=null){
[do the update]
  }

  else{

  System.out.println("In ");
  String query= "INSERT INTO DOMAIN
(OBJECTID,ISACTIVE,CODE,DESCRIPTION,ISEDITABLE,DOMAINTYPE_OID) VALUES
(?,?,?,?,?,?)" ;
  stmt = con.prepareStatement(query);
  // Now you increment result, which was created with value 0,
and therefore after the increase will always be 1
  stmt.setInt(1,++result);
  // This trace does not make any sense at all. The objid,
whicheve value it has, it's completely lost.
  System.out.println("OBJECTID"+ listbean.getObjid());
  stmt.setBoolean(2, (listbean.getActive()));
  stmt.setString(3, listbean.getCode());
  stmt.setString(4, listbean.getDescription());
  stmt.setBoolean(5, (listbean.getEdit()));
  stmt.setInt(6,listbean.getDt_oid());
  stmt.executeUpdate();
  output= true;
  }

}



2011/3/16 JavaNoobie87 

>
> JOSE L MARTINEZ-AVIAL wrote:
> >
> > Well, the NPE is due to the fact that you are setting declaring dt_oid as
> > an
> > Integer(which can be null) but in the method listdomain is an int. The
> JVM
> > automatically tries to convert Integer to int, but if it's null, it will
> > throw a NPE, since an int can not be null. That's the first thing you
> > should
> > look at. Also, who and when is setting dt_oid? Because there is no such
> > field in the jsp, so it will always be empty. And you will always get
> that
> > exception.
> >
> > Second, if you want to fill the domaintype in the bean, as the rest of
> > fields, you will need to rename the select to listbean.domainType, as the
> > rest of fields in the form. Otherwise it will not be loaded in the bean.
> > Also, you should revise the logic used to create the ids in the DAO. As
> it
> > stands, the objectid will always be 1.
> >
> > Third, IMO your code is hard to read. If you create an object of class
> > DomainBean, do not call it listbean, because everybody that reads it will
> > be
> > puzzle why something that is not a list is called list.
> >
> >
> Well, first off I  sincerely apologize for using an improper naming
> technique I'm totally new to coding in itself  :s. As Suggested ,Ive
> changed
> the return value of  dt_oid  and objid across the code . And im trying to
> set it through the jsp  by modifying the select tag .
> as below.
> headerKey="-1" headerValue="--Select--"
>list="dtList"
>listValue="listbean.code"
>listValue="listbean.dt_oid"
>name="listbean.domainType"
> onchange="function1(this)"
> />.
> I'm not sure how far this is effective though as the drop down form the jsp
> is empty . Even though the source shows the various options.
> Also I dont understand what you mean by creating the ids,could you please
> explain?
>
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3766102.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-16 Thread JavaNoobie87

JOSE L MARTINEZ-AVIAL wrote:
> 
> Well, the NPE is due to the fact that you are setting declaring dt_oid as
> an
> Integer(which can be null) but in the method listdomain is an int. The JVM
> automatically tries to convert Integer to int, but if it's null, it will
> throw a NPE, since an int can not be null. That's the first thing you
> should
> look at. Also, who and when is setting dt_oid? Because there is no such
> field in the jsp, so it will always be empty. And you will always get that
> exception.
> 
> Second, if you want to fill the domaintype in the bean, as the rest of
> fields, you will need to rename the select to listbean.domainType, as the
> rest of fields in the form. Otherwise it will not be loaded in the bean.
> Also, you should revise the logic used to create the ids in the DAO. As it
> stands, the objectid will always be 1.
> 
> Third, IMO your code is hard to read. If you create an object of class
> DomainBean, do not call it listbean, because everybody that reads it will
> be
> puzzle why something that is not a list is called list.
> 
> 
Well, first off I  sincerely apologize for using an improper naming
technique I'm totally new to coding in itself  :s. As Suggested ,Ive changed
the return value of  dt_oid  and objid across the code . And im trying to
set it through the jsp  by modifying the select tag .
as below.
.
I'm not sure how far this is effective though as the drop down form the jsp
is empty . Even though the source shows the various options.
Also I dont understand what you mean by creating the ids,could you please
explain?


--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3766102.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
Well, the NPE is due to the fact that you are setting declaring dt_oid as an
Integer(which can be null) but in the method listdomain is an int. The JVM
automatically tries to convert Integer to int, but if it's null, it will
throw a NPE, since an int can not be null. That's the first thing you should
look at. Also, who and when is setting dt_oid? Because there is no such
field in the jsp, so it will always be empty. And you will always get that
exception.

Second, if you want to fill the domaintype in the bean, as the rest of
fields, you will need to rename the select to listbean.domainType, as the
rest of fields in the form. Otherwise it will not be loaded in the bean.
Also, you should revise the logic used to create the ids in the DAO. As it
stands, the objectid will always be 1.

Third, IMO your code is hard to read. If you create an object of class
DomainBean, do not call it listbean, because everybody that reads it will be
puzzle why something that is not a list is called list.




2011/3/16 JavaNoobie87 

>
> JOSE L MARTINEZ-AVIAL wrote:
> >
> > Struts does not know that yo want to should map that domainType to your
> > bean. It wil try to map the parameters received from the request to the
> > action. So for each parameter it founds in the request received from the
> > user, it is gonna look in the action for a set.
> >
> > If I remember correctly, if the parameter name has a dot, it will
> > understand
> > that is a setter in an bean, so if you put a parameter name called
> > "myBean.myValue", it will try to look for a setMyBean, which receives an
> > object that has a setMyValue, and it will try to instantiate the bean and
> > do
> > both sets. But that's not the case in your jsp, since the parameter name
> > is
> > just domainType.
> >
> > But I'm still missing something. From your code I suppouse you want to
> > show
> > the user a list of domains, then he selects one, and then your
> application
> > load the data, and return to the user with the same jsp, where he can
> > change
> > some values, and press save, who will send the form to the server, and
> > save
> > it in the database, is that right?
> >
> >
> Are you saying that  I should try to use "listbean.domainType" instead of
> just domainType?
> Also your description of my project is almost exact. I intend to show the
> user a list of domains from which he may select one, my application will
> load the data corresponding to that domain from another table , containing
> all records of that particular domain(hence the iterator tag ). I also
> intend to be able to edit ,update and save the individual records in a
> domain .Thanks for replying
>
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3760331.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87

JOSE L MARTINEZ-AVIAL wrote:
> 
> Struts does not know that yo want to should map that domainType to your
> bean. It wil try to map the parameters received from the request to the
> action. So for each parameter it founds in the request received from the
> user, it is gonna look in the action for a set.
> 
> If I remember correctly, if the parameter name has a dot, it will
> understand
> that is a setter in an bean, so if you put a parameter name called
> "myBean.myValue", it will try to look for a setMyBean, which receives an
> object that has a setMyValue, and it will try to instantiate the bean and
> do
> both sets. But that's not the case in your jsp, since the parameter name
> is
> just domainType.
> 
> But I'm still missing something. From your code I suppouse you want to
> show
> the user a list of domains, then he selects one, and then your application
> load the data, and return to the user with the same jsp, where he can
> change
> some values, and press save, who will send the form to the server, and
> save
> it in the database, is that right?
> 
> 
Are you saying that  I should try to use "listbean.domainType" instead of
just domainType?
Also your description of my project is almost exact. I intend to show the
user a list of domains from which he may select one, my application will
load the data corresponding to that domain from another table , containing
all records of that particular domain(hence the iterator tag ). I also
intend to be able to edit ,update and save the individual records in a
domain .Thanks for replying


--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3760331.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
Struts does not know that yo want to should map that domainType to your
bean. It wil try to map the parameters received from the request to the
action. So for each parameter it founds in the request received from the
user, it is gonna look in the action for a set.

If I remember correctly, if the parameter name has a dot, it will understand
that is a setter in an bean, so if you put a parameter name called
"myBean.myValue", it will try to look for a setMyBean, which receives an
object that has a setMyValue, and it will try to instantiate the bean and do
both sets. But that's not the case in your jsp, since the parameter name is
just domainType.

But I'm still missing something. From your code I suppouse you want to show
the user a list of domains, then he selects one, and then your application
load the data, and return to the user with the same jsp, where he can change
some values, and press save, who will send the form to the server, and save
it in the database, is that right?

2011/3/16 JavaNoobie87 

> No its not present in the action class. That snippet was taken from the
> bean
> class, that im using to set the values. Pardon my ignorance , but should i
> set it in the action class too? (because i dont use it in the action class
> directly ).
> The bean class is just a set of getters and setters that im using to
> populate values. Ive placed the latest code for all my classes below for
> reference .
> http://struts.1045723.n5.nabble.com/file/n3758519/J07uQBr5.txt Action.txt
> http://struts.1045723.n5.nabble.com/file/n3758519/VtZEa16s.txt DAO.txt
> http://struts.1045723.n5.nabble.com/file/n3758519/XK3DkNCG.txt Bean.txt
> http://struts.1045723.n5.nabble.com/file/n3758519/jWjVuV7W.txt jspfile.txt
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3758519.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
No its not present in the action class. That snippet was taken from the bean
class, that im using to set the values. Pardon my ignorance , but should i
set it in the action class too? (because i dont use it in the action class
directly ).
The bean class is just a set of getters and setters that im using to
populate values. Ive placed the latest code for all my classes below for
reference .
http://struts.1045723.n5.nabble.com/file/n3758519/J07uQBr5.txt Action.txt 
http://struts.1045723.n5.nabble.com/file/n3758519/VtZEa16s.txt DAO.txt 
http://struts.1045723.n5.nabble.com/file/n3758519/XK3DkNCG.txt Bean.txt 
http://struts.1045723.n5.nabble.com/file/n3758519/jWjVuV7W.txt jspfile.txt 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3758519.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
humm, that snippet is not in the Action you gave before. Can you provide the
current version of the Action ?

2011/3/16 JavaNoobie87 

>
> Dave Newton-6 wrote:
> >
> > The snippet doesn't actually help, and can't you just include small
> > samples in the email itself?
> >
> > The headerKey is a number, what are the ones filled by the tag? What
> > does the setDomainType method take as a parameter? Have you defined
> > any custom type converters?
> >
> > Dave
> >
> Well , Sorry I thought code had to be pasted using pastebin . I'm not sure
> if this is the answer to the question you are asking , but the tag (if you
> meant the drop down) is being used to populate a dropdown box from the
> database . setDomainType takes a string as a parameter. The snippet for the
> same is below.
>
>public void setDomainType(String domainType) {
>this.domainType = domainType;   }
>
>public String getDomainType() {
>return domainType;
> }
> And no I havent defined any cutom type converters
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3757953.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87

Dave Newton-6 wrote:
> 
> The snippet doesn't actually help, and can't you just include small
> samples in the email itself?
> 
> The headerKey is a number, what are the ones filled by the tag? What
> does the setDomainType method take as a parameter? Have you defined
> any custom type converters?
> 
> Dave
> 
Well , Sorry I thought code had to be pasted using pastebin . I'm not sure
if this is the answer to the question you are asking , but the tag (if you
meant the drop down) is being used to populate a dropdown box from the
database . setDomainType takes a string as a parameter. The snippet for the
same is below.

public void setDomainType(String domainType) {
this.domainType = domainType;   }

public String getDomainType() {
return domainType;
}
And no I havent defined any cutom type converters

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3757953.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87

JOSE L MARTINEZ-AVIAL wrote:
> 
> Well, you are right, but I didn't say that that was the error :D. I just
> pointed to that because AFAIK a setter is needed for the
> parameterinterceptor to work, right?. Any case, and looking at the error
> '[Ljava.lang.String;@aea710', is it possible that it's receving an array?
> to
> what should it try to convert it?
> 
> 
> 
The point is that I think im just trying to use domainType to store the
value of the selected value from the dropdown, and hence I  used as a string
type

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3757633.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread Dave Newton
The snippet doesn't actually help, and can't you just include small
samples in the email itself?

The headerKey is a number, what are the ones filled by the tag? What
does the setDomainType method take as a parameter? Have you defined
any custom type converters?

Dave

On Wed, Mar 16, 2011 at 12:42 AM, JavaNoobie87  wrote:
> The domaintype is of type string .Im using it to store the domain type that
> is selected from the master table (domain table) obtained through the jsp
> (ie from the user ) after he selects values from the dropdown . The jsp
> snippet for the same is placed below
> http://struts.1045723.n5.nabble.com/file/n3757371/YeMgN74D.txt JSP
> SNIPPET.txt
>
> --
> View this message in context: 
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3757371.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
The domaintype is of type string .Im using it to store the domain type that
is selected from the master table (domain table) obtained through the jsp
(ie from the user ) after he selects values from the dropdown . The jsp
snippet for the same is placed below
http://struts.1045723.n5.nabble.com/file/n3757371/YeMgN74D.txt JSP
SNIPPET.txt 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3757371.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
Well, you are right, but I didn't say that that was the error :D. I just
pointed to that because AFAIK a setter is needed for the
parameterinterceptor to work, right?. Any case, and looking at the error
'[Ljava.lang.String;@aea710', is it possible that it's receving an array? to
what should it try to convert it?

2011/3/16 Dave Newton 

> On Wed, Mar 16, 2011 at 12:27 AM, JOSE L MARTINEZ-AVIAL wrote:
> > In the action there is no setDomainType.
>
> (Just for completeness, that's not necessarily correct; this error may
> occur under some type conversion conditions.)
>
> Dave
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread Dave Newton
On Wed, Mar 16, 2011 at 12:27 AM, JOSE L MARTINEZ-AVIAL wrote:
> In the action there is no setDomainType.

(Just for completeness, that's not necessarily correct; this error may
occur under some type conversion conditions.)

Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
In the action there is no setDomainType. Is it suppoused to be a parameter
received from the user? where is it used?

2011/3/16 Dave Newton 

> On Wed, Mar 16, 2011 at 12:12 AM, mv wrote:
> > SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught
> > setting 'domainType' on 'class com.vivek.struts2.action.DomainAction1:
> Error
> > setting expression 'domainType' with value '[Ljava.lang.String;@aea710'
>
> I'd say you're trying to pass in something in to domainType that the
> default type converters don't understand.
>
> What Java type is domainType? What are you trying to pass in?
>
> (Then you get a SQL error.)
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread Dave Newton
On Wed, Mar 16, 2011 at 12:12 AM, mv wrote:
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught
> setting 'domainType' on 'class com.vivek.struts2.action.DomainAction1: Error
> setting expression 'domainType' with value '[Ljava.lang.String;@aea710'

I'd say you're trying to pass in something in to domainType that the
default type converters don't understand.

What Java type is domainType? What are you trying to pass in?

(Then you get a SQL error.)

Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
As Suggested ive set the devmode to true and as hinted the error is being
thrown by the Parameters interceptor , as im new to coding im not being able
to figure out where I'm going wrong .Ive put logging into the action ,dao
classes and attached them here . The stack trace is as below.
my logging statement
Inside loaddomaintype
loadDomaintype DAO
loadDomaintype DAO try block
Connected
inside loadDomainType
I am setting the value as 1
MARITALSTATUS
The Objectid(D.T) is 1
Code of added bean MARITALSTATUS
 dtoid is 1
I am setting the value as 2
GENDER
The Objectid(D.T) is 2
Code of added bean GENDER
 dtoid is 2
I am setting the value as 3
EMPGROUP
The Objectid(D.T) is 3
Code of added bean EMPGROUP
 dtoid is 3
I am setting the value as 4
UserType
The Objectid(D.T) is 4
Code of added bean UserType
 dtoid is 4
The size of the list is4
Inside AddDomain
Inside add try
Mar 16, 2011 9:29:43 AM
com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'domainType' on 'class com.vivek.struts2.action.DomainAction1: Error
setting expression 'domainType' with value '[Ljava.lang.String;@aea710'
Connected
In 
OBJECTIDnull
org.postgresql.util.PSQLException: ERROR: insert or update on table "domain"
violates foreign key constraint "domain_domaintype_oid_fkey"

at
org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:154)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:101)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:515)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
at
org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:271)
at com.vivek.struts2.dao.DomainDAO.addupDomain(DomainDAO.java:169)
at
com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:67)...
Not being able to acesss addupDomain
Listing records
java.lang.NullPointerException
at
com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:103)
at
com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
at com.opensymphon..
http://struts.1045723.n5.nabble.com/file/n3756079/d6XF5wUN.txt Action
Class.txt 
http://struts.1045723.n5.nabble.com/file/n3756079/VtZEa16s.txt DAO.txt 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3756079.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
It will take the parameter from the request and call the setter in your
action, so you will have the parameter available in you action.

2011/3/15 JavaNoobie87 

> Im aware of the documentation .My question was how parameters interceptor
> would be of use to me , for this particular application.
>
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710504.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
Im aware of the documentation .My question was how parameters interceptor
would be of use to me , for this particular application.


--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710504.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
Dave is right as usual. I was writing from memory.

2011/3/15 Dave Newton 

> Are you aware there is Struts 2 documentation?
>
> http://struts.apache.org/2.x/docs/parameters-interceptor.html
>
> But I think the interceptor in question is the parameter filter
> interceptor:
>
> http://struts.apache.org/2.x/docs/parameter-filter-interceptor.html
>
> Dave
>
> On Tue, Mar 15, 2011 at 12:57 PM, JavaNoobie87 
> wrote:
> > devmode is disabled (I have never used it before) and how do I implement
> the
> > ParamsInterceptor and whats the use of the same ?
> >
> > --
> > View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710199.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
Sorry, you need to put


2011/3/15 JOSE L MARTINEZ-AVIAL 

> You can activate devMode putting this in you struts.xml
>
> 
>
> 
>
> [...]
> 
>
> The ParameterInterceptor is in the default stack of Struts2. If you are
> using the default stack, it should work automatically. If not, you need to
> add it to your interceptor stack.
>
>
> http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html
>
>
> 2011/3/15 JavaNoobie87 
>
>> devmode is disabled (I have never used it before) and how do I implement
>> the
>> ParamsInterceptor and whats the use of the same ?
>>
>> --
>> View this message in context:
>> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710199.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
You can activate devMode putting this in you struts.xml





[...]


The ParameterInterceptor is in the default stack of Struts2. If you are
using the default stack, it should work automatically. If not, you need to
add it to your interceptor stack.

http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html


2011/3/15 JavaNoobie87 

> devmode is disabled (I have never used it before) and how do I implement
> the
> ParamsInterceptor and whats the use of the same ?
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710199.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread Dave Newton
Are you aware there is Struts 2 documentation?

http://struts.apache.org/2.x/docs/parameters-interceptor.html

But I think the interceptor in question is the parameter filter interceptor:

http://struts.apache.org/2.x/docs/parameter-filter-interceptor.html

Dave

On Tue, Mar 15, 2011 at 12:57 PM, JavaNoobie87  wrote:
> devmode is disabled (I have never used it before) and how do I implement the
> ParamsInterceptor and whats the use of the same ?
>
> --
> View this message in context: 
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710199.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
devmode is disabled (I have never used it before) and how do I implement the
ParamsInterceptor and whats the use of the same ?

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3710199.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JOSE L MARTINEZ-AVIAL
Well, ParametersInterceptor should take care of that. Do you have devMode
enable? check the logs, you should find there if it is been used, and if it
is working.

2011/3/15 JavaNoobie87 

> I am submitting a form in the page and trying to store the value in a bean
> (in the action class )and trying to use that bean to insert a  row( but the
> values from the form aren't being reflected onto the bean and hence the
> NPE)
> , however I dont know how the values i submit from the form can be  put
> into
> the bean im passing to the action method.. addupdomain ??
> Ive attached source code below.
> http://struts.1045723.n5.nabble.com/file/n3690012/DomainAction1.txt Action
> class.txt
> http://struts.1045723.n5.nabble.com/file/n3690012/DomainBean.txt
> Bean  http://struts.1045723.n5.nabble.com/file/n3690012/DomainDAO.txt
> DAOClass.txt
>
> http://struts.1045723.n5.nabble.com/file/n3690012/interfacejsp.txt JSP
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3690012.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
I am submitting a form in the page and trying to store the value in a bean
(in the action class )and trying to use that bean to insert a  row( but the
values from the form aren't being reflected onto the bean and hence the NPE)
, however I dont know how the values i submit from the form can be  put into
the bean im passing to the action method.. addupdomain ??
Ive attached source code below.
http://struts.1045723.n5.nabble.com/file/n3690012/DomainAction1.txt Action
class.txt  http://struts.1045723.n5.nabble.com/file/n3690012/DomainBean.txt
Bean  http://struts.1045723.n5.nabble.com/file/n3690012/DomainDAO.txt
DAOClass.txt 

http://struts.1045723.n5.nabble.com/file/n3690012/interfacejsp.txt JSP 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3690012.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread jlmagc
Just to comment that Struts2 will populate the parameter from the request if 
you aure using the corresponding interceptor, or the default stack.
--Mensaje original--
De: Yo
Para: Struts Users Mailing List
Responder a: Yo
Asunto: Re: RE: loading Dropdown dynamically from database
Enviado: 15 Mar, 2011 04:24

Humm, I think you need to be far more clear in your problem/request. I assume 
you are navigating from one JSP to that Action, right? And in that navigation 
you have a value that you need to put in the Action to load the list. If that 
is the case, Struts will populate automatically any parameter 'X' received 
from the client to a method setX. So you just need top create the internal 
variable and the setter.

At any case, you need to be more clear. A NPE at that point in the code you 
sent does not make sense, even if the parameter is null. And after you ask for 
the NPE, your next mail says that you need to get the parameter from the 
client. We can not help if you don't explain clearly the problem. Is it the 
NPE, or how to put the parameter in the Action? Explain the situation clearly, 
where everything is going and how the parameters are obtained and how the 
action is called and maybe we can help you.
--Mensaje original--
De: JavaNoobie87
Para: user@struts.apache.org
Responder a: Struts Users Mailing List
Asunto: RE: RE: loading Dropdown dynamically from database
Enviado: 15 Mar, 2011 03:10

Is there any way that i can set the value of one attribute that i obtain from
the database in this case objid as given in the loaddomaintype ()method  DAO
class , to dt_oid , through the jsp
Please advise

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3679412.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Sent via BlackBerry from T-Mobile

Sent via BlackBerry from T-Mobile

Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread jlmagc
Humm, I think you need to be far more clear in your problem/request. I assume 
you are navigating from one JSP to that Action, right? And in that navigation 
you have a value that you need to put in the Action to load the list. If that 
is the case, Struts will populate automatically any parameter 'X' received 
from the client to a method setX. So you just need top create the internal 
variable and the setter.

At any case, you need to be more clear. A NPE at that point in the code you 
sent does not make sense, even if the parameter is null. And after you ask for 
the NPE, your next mail says that you need to get the parameter from the 
client. We can not help if you don't explain clearly the problem. Is it the 
NPE, or how to put the parameter in the Action? Explain the situation clearly, 
where everything is going and how the parameters are obtained and how the 
action is called and maybe we can help you.
--Mensaje original--
De: JavaNoobie87
Para: user@struts.apache.org
Responder a: Struts Users Mailing List
Asunto: RE: RE: loading Dropdown dynamically from database
Enviado: 15 Mar, 2011 03:10

Is there any way that i can set the value of one attribute that i obtain from
the database in this case objid as given in the loaddomaintype ()method  DAO
class , to dt_oid , through the jsp
Please advise

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3679412.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Sent via BlackBerry from T-Mobile

Re: loading Dropdown dynamically from database

2011-03-15 Thread Brian Thompson
Oh, nevermind -- I replied before I saw that you'd solved that part of it :/

-Brian

On Tue, Mar 15, 2011 at 2:40 AM, JavaNoobie87 wrote:

> Following changes? I didnt get what you meant. i dont see any code :S
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3683230.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
Following changes? I didnt get what you meant. i dont see any code :S

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3683230.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: loading Dropdown dynamically from database

2011-03-15 Thread Brian Thompson
Try making the following changes to your Java code -- the output should give
you some clues about what's going wrong.

-Brian

On Sun, Mar 13, 2011 at 11:52 PM, JavaNoobie87 wrote:

> Hi All,
> Im developing a Crud example using Struts 2 where im in the need to load
> values for a dropdown box dynamically from a database . However im just
> getting a empty dropdown now .
> The JSP code snippet is as below.
>DomainType
>
>
>
> The action class and DAO for the same function are as below.
>
> Action.
> public String loadDomainType(){
>// Class used to get the domaintype from domaintype table
>System.out.println("my logging statement");
>String result=SUCCESS;
>try {
>System.out.println("Inside loaddomaintype");
>List loadDomainType = DomainDAO.loadDomainType();
>dtList=loadDomainType;
>
System.out.println("dtList length: " + dtList.length);

>} catch (Exception e) {
>// TODO Auto-generated catch block;
>result=ERROR;
>e.printStackTrace();
>}
>
> DAO Class--
> public static List loadDomainType() throws Exception {
>Connection con = null;
>PreparedStatement stmt = null;
>ResultSet rs = null;
>System.out.println("loadDomaintype DAO");
>DomainBean bean = new DomainBean();
>ArrayList dtList = new ArrayList();
>
>try {
>con= DBConnector.getConnection();
>if (con != null){
>System.out.println("Connected");
>String query= " SELECT
> CODE,DESCRIPTION,OBJECTID FROM DOMAINTYPE " ;
>stmt = con.prepareStatement(query);
>rs = stmt.executeQuery();
>System.out.println("inside loadDomainType");
>while (rs.next()){
>
bean = new DomainBean();

>bean.setCode(rs.getString("CODE"));
>
>  bean.setDescription(rs.getString("DESCRIPTION"));
>
>  bean.setObjid(rs.getInt("OBJECTID"));
>dtList.add(bean);
>
System.out.println("Adding bean to list: " + bean.getDescription());

>
>
>}
>
>}
>} catch (SQLException sqe) {
>sqe.printStackTrace();
>
>} finally {
>DBConnector.closeResultSet(rs);
>DBConnector.closeStatement(stmt);
>DBConnector.closeConnection(con);
>}
>
>return dtList;
>}
>
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555884p3555884.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


RE: RE: loading Dropdown dynamically from database

2011-03-15 Thread JavaNoobie87
Is there any way that i can set the value of one attribute that i obtain from
the database in this case objid as given in the loaddomaintype ()method  DAO
class , to dt_oid , through the jsp
Please advise

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3679412.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: RE: loading Dropdown dynamically from database

2011-03-14 Thread JavaNoobie87
Yes the value of dt_oid is null at that point. Im trying to figure out how i
can populate it at that point .

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3672845.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: RE: loading Dropdown dynamically from database

2011-03-14 Thread Lee Clemens
I think Eclipse auto-compiles by default.

What is this? DomainDAO.listDomain(dt_oid)

Is dt_oid null at this point? (Add a debugging statement)

Have you posted code for DomainDAO? I apologize if I've missed it.



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread JavaNoobie87
Ive cleaned the project and restarted eclipse 
Yet it still throws the NPE

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3669127.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread Maurizio Cucchiara
I meant that perhaps (and if you're using eclipse is more likely than
perhaps) your ide is not running the code that contains your latest changes

Maurizio Cucchiara

Il giorno 15/mar/2011 06.15, "JavaNoobie87"  ha
scritto:
Yes, very much .In fact, I copied the code directly from my IDE

--
View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3666711.html

Sent from the Struts - User mailing list archive at Nabble.com.

---...


Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread JavaNoobie87
Yes, very much .In fact, I copied the code directly from my IDE 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3666711.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread Maurizio Cucchiara
I'll try to reformulate the question: are your sure that your IDE is running
the code you posted?

Maurizio Cucchiara

Il giorno 15/mar/2011 05.53, "JavaNoobie87"  ha
scritto:
> Im using the same version , as ive pasted for the DAO class.
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3664225.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>


Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread JavaNoobie87
Im using the same version , as ive pasted for the DAO class.

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3664225.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread Maurizio Cucchiara
I was refering to the dao's method invocation

Maurizio Cucchiara

Il giorno 15/mar/2011 05.46, "JavaNoobie87"  ha
scritto:
Yes very much the same code.But the method that leads to the NPE is not
static in the action class.
Im placing the action class below again
 Action Class
 http://struts.1045723.n5.nabble.com/file/n3663281/2vG8DAsH.txt
2vG8DAsH.txt

--
View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3663281.html

Sent from the Struts - User mailing list archive at Nabble.com.

---...


Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread JavaNoobie87
Yes very much the same code.But the method that leads to the NPE is not
static in the action class.
Im placing the action class below again
 Action Class
  http://struts.1045723.n5.nabble.com/file/n3663281/2vG8DAsH.txt
2vG8DAsH.txt 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3663281.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread Maurizio Cucchiara
Are you sure that you are running that version of code?
A static method invocation, even with null value as argument, should not
thrown a NPE

Maurizio Cucchiara

Il giorno 15/mar/2011 05.26, "JavaNoobie87"  ha
scritto:
> I solved the issue , but right now im facing a Null pointer exception,
which
> Im trying to solve . Ive attached the pastebin links to the action and dao
> class , and the stacktrace below. (This is on running the addupdomain
> action.)
>
>
>
> Inside AddDomain
> Unknown else
> Listing records
> java.lang.NullPointerException
> at
com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:98)
> at
> com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:87)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
> at
>
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
> at
>
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> at
>
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> at
>
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
> at
>
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
> at
>
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> at
>
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> at
>
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> at com.opensymphony.x
> http://http://pastebin.com/zKRb7va6 Action Class
> http://struts.1045723.n5.nabble.com/file/n3661499/m1pbXyiJ.txtm1pbXyiJ.txt
> DAO class
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3661499.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>


Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread JavaNoobie87
I solved the issue , but right now im facing a Null pointer exception, which
Im trying to solve . Ive attached the pastebin  links to the action and dao
class , and the stacktrace below. (This is on running the addupdomain
action.)



Inside AddDomain
Unknown else
Listing records
java.lang.NullPointerException
at 
com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:98)
at
com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.x
http://http://pastebin.com/zKRb7va6 Action Class 
http://struts.1045723.n5.nabble.com/file/n3661499/m1pbXyiJ.txt m1pbXyiJ.txt
DAO class

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3661499.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: RE: loading Dropdown dynamically from database

2011-03-14 Thread Maurizio Cucchiara
Are there any errors in the stacktrace?

Maurizio Cucchiara

Il giorno 14/mar/2011 07.59, "JavaNoobie87"  ha
scritto:
> Yes there is a method doing that.Here is the snippet .
> public void setDtList(List dtList) {
> this.dtList = dtList;
> }
>
> public List getDtList() {
> return dtList;
> }
>
> Ive also uploaded the entire action class.
> http://struts.1045723.n5.nabble.com/file/n3555946/DomainAction1.txt
> DomainAction1.txt
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3555946.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>


RE: loading Dropdown dynamically from database

2011-03-14 Thread Jose Luis Martinez Avial
Can you put the chunck of your struts.xml in which the action is
defined?

-Original Message-
From: JavaNoobie87 [mailto:vivek...@enzentech.com] 
Sent: Monday, March 14, 2011 2:59 AM
To: user@struts.apache.org
Subject: RE: loading Dropdown dynamically from database

Yes there is a method doing that.Here is the snippet .
public void setDtList(List dtList) {
this.dtList = dtList;
}

public List getDtList() {
return dtList;
}

Ive also uploaded the entire action class. 
http://struts.1045723.n5.nabble.com/file/n3555946/DomainAction1.txt
DomainAction1.txt  

--
View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-da
tabase-tp3555885p3555946.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: loading Dropdown dynamically from database

2011-03-13 Thread JavaNoobie87
Yes there is a method doing that.Here is the snippet .
public void setDtList(List dtList) {
this.dtList = dtList;
}

public List getDtList() {
return dtList;
}

Ive also uploaded the entire action class. 
http://struts.1045723.n5.nabble.com/file/n3555946/DomainAction1.txt
DomainAction1.txt  

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3555946.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: loading Dropdown dynamically from database

2011-03-13 Thread Jose Luis Martinez Avial
Is there a public List getDtList in the Action? You didn't put it in the
code.

-Original Message-
From: JavaNoobie87 [mailto:vivek...@enzentech.com] 
Sent: Monday, March 14, 2011 12:57 AM
To: user@struts.apache.org
Subject: Re: loading Dropdown dynamically from database

The jsp corresponding to the dropdown didnt show up im attaching it to
the below file.
http://struts.1045723.n5.nabble.com/file/n3555886/jsp_snippet.txt
jsp_snippet.txt 

--
View this message in context:
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-da
tabase-tp3555885p3555886.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


Internet communications are not secure and therefore Banco
Santander International does not accept legal responsibility for
the contents of this message. Any views or opinions presented
are solely those of the author and do not necessarily represent
those of Banco Santander International unless otherwise
specifically stated.

Las comunicaciones v'ia Internet no son seguras y, por lo tanto,
Banco Santander International no asume responsabilidad legal
ni de ning'un otro tipo por el contenido de este mensaje.
Cualquier opini'on transmitida pertenece 'unicamente al autor y
no necesariamente representa la opini'on de Banco Santander
International, a no ser que est'e expresamente detallado.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: loading Dropdown dynamically from database

2011-03-13 Thread JavaNoobie87
The jsp corresponding to the dropdown didnt show up im attaching it to the
below file.
http://struts.1045723.n5.nabble.com/file/n3555886/jsp_snippet.txt
jsp_snippet.txt 

--
View this message in context: 
http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3555886.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org