java - How to dynamically create a form based on submitting the first form -
for eg: 1) have 1 text box , submit button if person adds value , select submit button text box value sent java program internal calculations made , returned jsp page based on values new form should dynamically created on same page , form should have value of text box created before , if submit should send values java program...
please post me sample code of jsp , java program asap
if i'm understanding correctly how data flow like?
html form data --> java servlet --> html data ?
the approach would, using java beans populate data. normal java class private fields, getters , setters store value. refer here more information
form
<form action"yourservlet"> <!-- input e.g username , submit button --> </form>
servlet
//request data //do calculation //populate bean //dispatch jsp
bean
//private field correspond form data value e.g username //constructor no arg //getters , setters //other methods
jsp
<body> <jsp:usebean id="bean" class="package.beanclass" scope="session"/> value: <jsp:getproperty name="bean's id" property="property name"/> </body>
Comments
Post a Comment