This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a search jsp which brings back a collection of results. the user selects a certain user and then clicks the link to edit this particular user. However the information is not getting sent to the action form and subsequently the action class throws a null pointer.
When i click on the link the actionClient mapping is called but the values from the jsp are not submitted through the form to the action class. How would I get the values into the form if I am using a link. The reason I am using a link is because this page will also have the option to delete a client and I want to append a request parameter to the URL so the action class will check the parameter then decide what to do.
If I use a submit button the values are passed through.
I am trying to do something similar in my application. I have a jsp page that displays a list of customers. In the page, I iterate through a collection of CustomerForm objects, and for each customer there is a link to take to another page where I want to display the customer details for editing. The link contains all the necessary parameters obtained from a Map (I have viewed the source of the page and the parameters are set correctly).
On the next page, how do I fetch the parameters without resorting to scriptlets? If you can fetch the parameters via the request object using scriptlets why can you not obtain them from the request object in the Action class? (I have tried using a forward in the link that forwards to an action that fetches the parameters from the request object but the paramaters appear to be null).
If you can fetch the parameters via the request object using scriptlets why can you not obtain them from the request object in the Action class? (I have tried using a forward in the link that forwards to an action that fetches the parameters from the request object but the paramaters appear to be null).
Well, I don't know the answer to your question. But using action instead of forward in the html:link tag will solve your problem of accessing the parameters in Action Class.
Yes. If you want to pass some values, always use submit in some sort of way.
Just to clarify one doubt of mine: the answer for this is the "submit" or the POST method? I mean, if I use a form/submit with a GET method instead, will parameters be sent too? I read once (don't remember where) that you can only send parameters to an ACTION using POST (which you can't do via links).