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
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: 9190

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?

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Getting Undefined in Action
It's not a secret anymore!