A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Servlets
Author
Send data from jsp to a class using a form
Angus Ferguson
Ranch Hand
Joined: Jun 22, 2012
Posts: 240
posted
Sep 15, 2012 15:16:16
0
Hi,
I am trying to send data using a form to a class, not a
Servlet
.
This way:
<body bgcolor="#999966"> <p> </p> <form method="GET" action="ClassName"> <p> <font color="#800000" size="5"> Enter your name:</font><input type="text" name="name" size="20"> </p> <p> <font color="#800000" size="5"> Enter your password:</font><input type="text" name="password" size="20"> </p> <p> <font color="#800000" size="5"> From date:</font><input type="text" name="startDate" size="20"> </p> <p> <font color="#800000" size="5"> To date:</font><input type="text" name="endDate" size="20"> </p> <p> <input type="submit" value="Submit" name="B1"> </p> </form>
Is it a correct approach, do you think I could do it in other better way?
Many Thanks,
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56151
13
I like...
posted
Sep 15, 2012 17:51:46
0
Angus Ferguson wrote:
Is it a correct approach
Nope. You can't just submit to any old class -- it has to be a servlet.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Send data from jsp to a class using a form
Similar Threads
Automatic flushing of response
404 file not found error
how can i compare a session parameter value with variable value?
Login Servlet
problem with jsp for reset() method
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter