aspose file tools*
The moose likes Struts and the fly likes Help regarding getParameter-How to use servlet concept in Struts2 Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help regarding getParameter-How to use servlet concept in Struts2 Action" Watch "Help regarding getParameter-How to use servlet concept in Struts2 Action" New topic
Author

Help regarding getParameter-How to use servlet concept in Struts2 Action

ishan grover
Greenhorn

Joined: Feb 29, 2012
Posts: 6
Hi! all, I Have a problem regarding getparameter. How to access values of textfield through request.getParameter
Please consider the code of jsp as below :



Javascript code:


Java Code:

I am new in Struts2 and don't know how to use servlet concept in Action class.however, I am able to call Action class but not able to retrieve values through getParameter.
Please Help me regarding this.Thanks in Advance
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Try to small example first with struts2. Where is execute method in ActionClass? Why are you calling doGet method here? How to get the request object in Struts2?

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
ishan grover
Greenhorn

Joined: Feb 29, 2012
Posts: 6
Mohana Rao Sv wrote:Try to small example first with struts2. Where is execute method in ActionClass? Why are you calling doGet method here? How to get the request object in Struts2?


Actually i want to retrieve list of cities on the basis of dynamic value of textbox.I am trying to implement through ajax. The execute function id down below in action class. I have replaced doget method with execute method as follows
CityAction.java



Now I am getting values from:


The DAO class is as follows where i am fetching cities:
DAOcity.java


 
Don't get me started about those stupid light bulbs.
 
subject: Help regarding getParameter-How to use servlet concept in Struts2 Action