This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Getting Undefined in Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting Undefined in Action" Watch "Getting Undefined in Action" New topic

Getting Undefined in Action

manoj parida

Joined: Feb 08, 2010
Posts: 5

I have written code like below in jsp and Action class.

i also tried this

Action class, i am just doing this.

In the logs I am getting:

Delete User Id undefined

Could someone let me know what is happening. I tried few more options but not working.

Joe Ess

Joined: Oct 29, 2001
Posts: 8843

I split up your code tags to make your post easier to read.
Your first code snippet obviously will not work because you are not setting a value for "id".
Did you check the HTML in the browser to see if your code is correctly getting the ID from the action?
Why are you checking the request for the parameter rather than using an action attribute? Also, why are you calling the attribute "userId" in one request then "id" in the next?

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Getting Undefined in Action
Similar Threads
editing a data in a datatable using a modal form
Checkbox Isuue
[solved] passing 3 times by default through action using struts 2
jQuery not working on page