I have an URL which will call a method my method in Java. It looks like this:
http://www.example.com/method?value=24
How can I retrieve value 24 and use it in my called method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am assuming here that you do create the number – the ’24’ – in your Java code, since you say you are using Wicket.
Thus, as seanizer already said, in 99% of the cases, you do not need to parse the request url to get the value, something like this should be sufficient:
or – with models – like this
If you really, really, REALLY-REALLY do need the parameter from the URL, I guess this is what you want:
Depending on how you configured your application, you might need to implement the other constructors accordingly.
Good luck.