Skip to content Skip to sidebar Skip to footer

Linking Html To Jsp Page

I'm have problems linking my HTML and JSP. Just trying to make a simple html page to take a 'email' and 'password' then have the jsp display on the next page. But when i click subm

Solution 1:

You need to use the name attribute in the form fields .

<input type="text" name="email"></td>

The value of "email" can be retrieved in JSP as :

Stringemail= request.getParameter("email");

OR

${param.email}

OR

<c:out value="${param.email}"/> <%--(Using JSTL)--%>

Here are the complete list of attributes.

name = string #

The name part of the name/value pair associated with this element for the purposes of form submission.

Solution 2:

You should specify the input name attribute. Try this,

<formaction="form.jsp"method="get"><tablecellspacing="5"border="0"><tr><tdalign="right">Email:</td><td><inputtype="text"name="email"></td></tr><tr><tdalign="right">Password:</td><td><inputtype="text"name="password"></td></tr><tr><td></td><td><br><inputtype="submit"value="Submit"></td></tr></table></form>

For more info you can try this link

Post a Comment for "Linking Html To Jsp Page"