Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


JSP input name

Posted on 2005-05-11
Medium Priority
Last Modified: 2008-02-26

I am new to JSP and I am trying to understand this piece of code.

<form name="firstform" action="default"><input name="one"
     type="hidden" value=""> <input name="two" type="hidden"

What are the two input names exactly?

I understand the form name but what do the input names do?
Question by:corduroy9
  • 3
LVL 29

Expert Comment

ID: 13979219
they are the names of the parameters that the form submits to the the action "default"

if the form were a "GET" you would see this in the url: <blah>/default?one=&two=

as they have no values
LVL 29

Accepted Solution

bloodredsun earned 1000 total points
ID: 13979252
Here's a slightly better example:

<form name="firstform" action="default.jsp" method="GET">
<input name="one"   type="hidden" value="valueOne">
<input name="two" type="hidden"   value="valueTwo">

you would see this in the url: <blah>/default.jsp?one=valueOne&two=valueTwo

In default.jsp, you could then recover these values with this code
String paramOne = request.getParameter("one") ; //now equals "valueOne"
String paramTwo = request.getParameter("two") ; //now equals "valueTwo"

Expert Comment

ID: 13979912
<input name="one" > means name of hidden type u are using
it can be useful when u are recovering this value
String One = request.getParameter("one") ;
it will give u the value of type hidden in above case it is null value
if it is something like this
<input name="one"   type="hidden" value="cord">
String One = request.getParameter("one") ;

then One  would be "cord"
LVL 29

Expert Comment

ID: 13980119
cheers :-)

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The deadly train derailment that occurred recently in DuPont, Washington, raises a lot of questions. It was a new route, the first trip tested with passengers, and the train was travelling at 50 mph over the zone’s speed limit. Could IoT play a role…
Are you a startup company? Being a startup, you may be using shared hosting, or maybe even dedicated hosting. But have you ever given a thought to using cloud computing now? Yes, don’t be surprised, it is possible for startups to opt for cloud compu…
Screencast - Getting to Know the Pipeline
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question