wood burning stoves 2.0*
The moose likes JSP and the fly likes how to use <%=temp%> i retrieving data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to use <%=temp%> i retrieving data" Watch "how to use <%=temp%> i retrieving data" New topic
Author

how to use <%=temp%> i retrieving data

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Hi I have the below code in my jsp




alternatively i used EL as shown below.



and in my servlet I've the below code






here i'm unable to retrieve the data from the textboxes, when i tried to print the results it is printing null.
please help me with how to retrieve the data.
This code is working if there is only 1 row.
Thanks

Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

The parameter names aren't the same. You can see this by selecting "View Source" in your browser. You'll see that the parameters are NOT named things like "temp31" but rather are names like "1".

You also are susceptible to a SQL injection attack the way your putting the submitted answers directly into a database query.


A good workman is known by his tools.
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Thank you Marc for the reply. could you please help me how do i solve this.

Thanks
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

I'm not going to rewrite the entire thing for you. I want you to solve this problem.

Do you know what I meant when I said "View Source" in your browser? If so, have you tried it? What did you see?

Also, realize that you can put actual static text as part of a name to make it easier to retrieve the data:
name="upd${tempIndex}"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

Rakesh Keerthi,
Your post was moved to a new topic.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use <%=temp%> i retrieving data