I write a programm that pass parameter from jsp to servlet and than according to the parameter the servlet get pass back a parameter to the servlet. I think that the first stage work but the second stage does not work. I attach my code hopefully somebody will tell me what wrong with my code.explain to my programm in the first jsp(I dont attach) I have a radio button with value fruit that choose one fruit . the servlet get the kind of fruit we choose and for example if the fruit is an apple the servlet sent us to applestore.jsp with attribute to the jsp of appleshop. but it doesnt pass the parameter appleshop from the jsp to the servlrt.please somebody can help me String fruit = request.getParameter("fruit"); PrintWriter out = response.getWriter(); System.out.println(" your choice "+fruit);
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the .
Sorry, but you'll have to be more explicit about what is happening incorrectly.
Joined: Sep 09, 2008
what is happening incorrectly is that the jsp page show me :your choice: org.apache.catalina.core.ApplicationHttpRequest@269997 instead of show your choice: appleshop (the parameter I send via request). I will read what you send me about how to send my prorgamm and try again more clearly.
Maybe I should not have thrown expression language (EL) usage into this, but after using EL I just can't seem to force myself to use server-side script any more. But if you want to sure server-side script, I think this is what it would look like for the JSP to get the results you want (based on the servlet code I posted previously):
[ September 09, 2008: Message edited by: Peter Johnson ]
Joined: Sep 09, 2008
I thank you .
I try to make the code you suggest me but still it doesnt work your choice: null