in my application i have JSP and a Java class(not servlet) ,if user clicks on the JSP it has to pass the value to the Java class , how to get the values from JSP ?

7 Years
Discussion Span
Last Post by stultuske

Try posting some code to help clarify your question.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<form action="SendEmail" method="post" >

Name: &nbsp;&nbsp;&nbsp;<input type="text" name="name" ><br><br>
Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email"><br><br>
Subject: &nbsp;<input type="text" name="subject"><br><br>
Enquiry: <textarea name="enquiy" rows=3> </textarea>
<input type= "submit" value="submit" name="submit">

after user clicks on submit button ,it has to go SendEmail.java which is a Java class ,on SendEmail.java how can i get values of User entered in Jsp ?


and ... what exactly do you mean, "isn't a servlet"?
first, look up the basics on webapps.

what you want to do, is pass the values stored in name, email, ... to your java class (which sounds pretty much like a servlet to me).

ever used HttpSession before? if not, make sure to look it up, I think you'll find this can help you getting what you need

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.