We help IT Professionals succeed at work.

EASY POINTS, I know you're not working!   JSP parameter passing using Post form

rpong
rpong asked
on
265 Views
Last Modified: 2010-04-01


--------------test.jsp-----------------------
<html>
  <form action="getValues.jsp" method="post">
                 <input disabled type="text" name="test" value="myTest" >
   </form>
</html>
---------------------------------------------


-------------getValues.jsp------------------
<html>

   <h1> <% request.getParameter("test"); %> </h1>

</html>
--------------------------------------------------

is that suppose to display "myTest" on the getValues.jsp page?
Comment
Watch Question

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
>       <input disabled type="text" name="test" value="myTest" >

try getting rid of disabled

does myTest show up in the text field in test.jsp

Author

Commented:
yes it does, it displays it as a disabled text field. Meaning, I will be unable to edit the field which is extremely necessary.
I will try your suggestion

Author

Commented:
oh yea, I forgot the submit button in the Test.jsp
 <input type="Submit" value="Submit">
Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
No beans,  it didn't work with removing the disabled

Author

Commented:
hey that worked, removing the ";"!

really quick, why do I do remove the ";" in <%= request.getParameter("test") %>  but keep it with

<%
 request.getParameter("test") ;
%>

per radarsh
https://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21738235.html

kidding. thanks objects.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
<% is for scriptlet, <%= is for evaluating expression and it doesn't require ;

Author

Commented:
thanks objects.

Author

Commented:
oh yea. btw,  your suggestion to remove the disabled did work too.

with the text field disabled it contains a Null value. that's very unfortunate.....
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.