aspose file tools*
The moose likes Struts and the fly likes Unable to read the parameter in action class which was passed from the JSP in struts...please help?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to read the parameter in action class which was passed from the JSP in struts...please help??" Watch "Unable to read the parameter in action class which was passed from the JSP in struts...please help??" New topic
Author

Unable to read the parameter in action class which was passed from the JSP in struts...please help??

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
hi. what iam doing , there is a main JSP which shows the list of all the employees.
There is link on the emp_id of list. onClick of that, a popup comes for that specific emp_id, so that user can update the profile and calls the update action.
The problem is that , iam able to send the parameter because i can see the emp_id (passed parameter) on URL but iam not sure whether it is going into action or not.

for e.g. :-
http://localhost:8080/SpringSample1/pop.do?id=2342

in above url, id is passed as parameter.
In action class, iam not able to get the id.
UpdateAction.java:-


Please tell me what kind of issue is this?

Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Am I missing something here?? I don't see anywhere that you've taken out the id request parameter from the HttpServletRequest object or from the ActionForm object. Also the request parameter is id not emp_id ...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
galne vaibhav
Greenhorn

Joined: Nov 30, 2009
Posts: 9
you can do simple thing write onclick javascript function and assign value to hidden control and in action class write the getter setters for hidden control.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Galne, the [quote] [/quote] tags are for quoting what someone else writes. Don't put what you write in quote tags...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to read the parameter in action class which was passed from the JSP in struts...please help??