Meaningless Drivel is fun!*
The moose likes JSP and the fly likes getParameters names from jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "getParameters names from jsp?" Watch "getParameters names from jsp?" New topic
Author

getParameters names from jsp?

Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

Hi,

I am using this type of code in jsp and use in second jsp





How i can use the name of the radio button in
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

First, you should be doing this in a servlet not a JSP.

Second, you must use the full name of the element. The name isn't status so you can't use status. You'll need to reconstruct the suffixes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

Hi Bear,

Actually I am using this in another jsp not in servlet............


my qery is that I am passing the radio button name dynamically but when I need to it pass in parameter in second jsp page then how we pass parameter name in request.getParameterValues("???");

Thanks !
Subash Kshetri
Greenhorn

Joined: May 18, 2011
Posts: 23

Bear Bibeault is right, you can pass those parameters from your jsp page to a servlet and redirect to another jsp page from that servlet.
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

Ok You both are right........
but the difference is that i m using jsps.............
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

Rd Dari wrote:Ok You both are right........
but the difference is that i m using jsps.............

But the point is you are using them incorrectly. JSPs are not for data processing. They are for view generation.

Submit forms to servlets, not JSPs.

If you are going to ignore the advice of experienced people, you will find that they will not be willing to give that advice any more.
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

ok I agree with you I am new in Java........
but my question is that when I use radio button name dynamically then what we use because I am using dynamically name of radio button for mor than one radio select in present or absent column like:

then when I use it in for pass parameters I am confusing in this...so please help how I should use the name of radio in



Please help me I am facing these type of problems for 4-5 days................ my sir execepting from me very soon.........
rajiv jackz
Greenhorn

Joined: Jul 12, 2010
Posts: 29
i hope you know what will i value is

for example

for(int i=0;i<10;i++)
{
request.getparameter("status"+i);
}

bold is your need
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 91
Not a right way of using the scriplet <%%> in jsp and more over you are using the DB connection logic in JSP which discourages the nature of JSP which is view generation.
Move out the DB logic into DataAccess layer.
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

Ok I agree with you but now I have solved that problem but now one problem is that I am selecting more than values for present and absent but inserting only first data right radio button selection ....




please give me any suggestion....

Thanks in advanced!!
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

Hi all,

My query is starting again beacause I was outside from office.......


so that today I got a solution to add all values from the page(last table) but only the problem is that my radio button value is not inserting properly...........



my latest code is here............






second page.......



and the last and bean page here.........


and the tables here.......







please tell where I am wrong in this beause........my out put is




now the problem is that values are inserting properly as they increasing in last table but if I select radio button then it insert onl one for all not for perticular................

Thanks!
Alex Hurtt
Ranch Hand

Joined: Oct 26, 2010
Posts: 98
Don't you mean:

System.out.println("Query " + i + " is executing...." + pst1);

??
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 210

Hi Alex,

What do you mean by this ....


Its not effective on my query please suggest again .

Thanks for reply.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getParameters names from jsp?