This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Groovy and the fly likes Retrieving HTTP parameters in Grails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Retrieving HTTP parameters in Grails" Watch "Retrieving HTTP parameters in Grails" New topic
Author

Retrieving HTTP parameters in Grails

Ajit Sethi
Greenhorn

Joined: Sep 17, 2012
Posts: 5
the request was sent from an HTML form, the request body contains the form data,how can i retrieve that data in my Grails application.Below is the URL from where i need to retrieve data.I'm a Rookie in Grails so please help me with this.

http//localhost:8080/copypolicyNumber/loginaction.jsp?fname=Roger&lname=wallace&city=Des+Moines&pnum=123456&submit=Submit
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Your question is slightly confusing because you have a URL with a JSP but Grails doesn't use JSPs. Can you possibly add some more details to your question? Generally, when a request comes into a Grails controller, you access the request parameters with the params variable.



GenRocket - Experts at Building Test Data
Ajit Sethi
Greenhorn

Joined: Sep 17, 2012
Posts: 5
i have an old login form and want to redirect this to my grails app, actually i need to make a POC(proof of concept). i can try making the old login page with HTML, actually they want to see if a user request from old page then the data can be retrieved in the new Grails login page
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

My answer remains the same then. Pull the request parameters out of the params variable.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Retrieving HTTP parameters in Grails
 
Similar Threads
Using Java with a web application without an API
Duplicate form submission - Synchronizer Token Pattern
servlet
Displaying Data
Scope in JSTL