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

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

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 Str

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

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

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 n

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 shou

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

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 p

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

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 num

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?

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

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

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

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

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

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

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

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 s

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. >

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 ma

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.

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 >

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/

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, J

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

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

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

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

Re: RE: loading Dropdown dynamically from database

2011-03-15 Thread jlmagc
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 a

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-Dr

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. ---

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 dyna

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-dy

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 N

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 unsubscrib

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. --

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 th

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.

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

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.

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.104572

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

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

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.NullPoin

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; > } > > Iv

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

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.nabbl

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 Th

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-tp3555885p35558