File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes jsp stay with text fields Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

jsp stay with text fields

ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60
hi,

if enter some text box fields in jsp after submitting button then these fields going and store in data base. but the jsp page must stay with the text fields on the browser..

how is it possible ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61429
    
  67

It's not. You need to restore the values using the value attribute on the form elements


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60

How it will do that...

please provide sample code for that
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61429
    
  67

You write the code -- then get help with it.

Use the EL and/or the JSTL to set a value into the value attribute of the form elements.
ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60
this is my code...

i want restore barcode value only in my page after submitting...


<BODY>

 

<h1>RECEIPT INFORMATION</h1>


<%
session.setAttribute("bar",request.getParameter("bar"));
%>
<form name="f1" method="POST" >

IRefNum:       <input type="text" size="40" name="irefnum"/>


RefNum:        <input type="text" size="40" name="refnum"/>


FromDept:     <select type="hidden" id="frm" name="fdep" onchange="fun1(this)">
<option>select</option>
<option value="Management">Management</option>
<option value="Technical Affairs" >Technical Affairs</option>
</select>



FromSEC:     <select type="hidden" name="fsec">
<option value="-1">select</option>
</select>



TODept:       <select type="hidden" id="to" name="todep" onchange="fun3(this)" >
<option>select</option>
<option value="Management">Management</option>
<option value="Technical Affairs"> TECHNICALAFFAIRS</option>
</select>


TOSEC :      <select type="hidden" name="tosec">
<option value=""> -select - </option>
</select>


SUBJECT:   <input type="text" size="40" name="sub"/>


NOTES:     
<input type="text" size="40" name="notes"/>



<input type="button" name="save" value="SUBMIT" onclick="submitForm()"/>    
<input type="button" name="View" value="VIEW" onclick="viewData()"/>    
<input type="button" name="Delete" value="DELETE" onclick="deleteData()"/>    
</form>



</body>


i am putting code tags please find it...
Tarun Bolla
Ranch Hand

Joined: Jun 20, 2011
Posts: 89
Requirement is not clear...but my understanding is that
1)You have a form in jsp page
2)You submit it
3)Generate the bar code
4)Show it in browser in previous jsp page
If that is it...
You could have a check in jsp like...

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61429
    
  67

As you started a new topic on this same question, this topic is closed. Please do not do that in the future.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: jsp stay with text fields