Forums Register Login

How to bind data to a textbox in servlet?

+Pie Number of slices to send: Send
Hi,
I have three textfields in one jsp page. In runtime user will put 2 values in the two textfields and in third textfield data from database. I have retrieved from database using a servlet and request dispatches to the same page. But how to bind the data to textfield.

Please help me out.

Regards from

Soumyaranjan
+Pie Number of slices to send: Send
you can use this type by maintaing sessions between pages
by request.setattribute or by request.getattribute
bind value with setattribute
retrieve value where you want by getattribute
+Pie Number of slices to send: Send
I know that, But how to assign that value to a textfield of that jsp page.
+Pie Number of slices to send: Send
 

karamjeet singh wrote:you can use this type by maintaing sessions between pages
by request.setattribute or by request.getattribute
bind value with setattribute
retrieve value where you want by getattribute



sorry boss i don't understand your question please ignore previous post
for binding you can use this method
not sure for retrieval from database
+Pie Number of slices to send: Send
you should put this like
<input type="text" value="<%=request.getAttribute("stringvalue")%>"/>
1
+Pie Number of slices to send: Send
Yes, that can be done.
thank you dude.
+Pie Number of slices to send: Send
It would be better to use JSTL rather than JSP scriptlets. With JSTL you can write the same line as:
No scriptlet.

Best Regards,
+Pie Number of slices to send: Send
 

Mark E Hansen wrote:It would be better to use JSTL rather than JSP scriptlets. With JSTL you can write the same line as:
No scriptlet.

Best Regards,




That's not JSTL. That's the Express Language (EL).
+Pie Number of slices to send: Send
 

Gregg Bolinger wrote:That's not JSTL. That's the Express Language (EL).



Uhhh, right :embarrassed: - sorry.
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 4816 times.
Similar Threads
Tapestry-request loses parameters passed after page is rendered
how to hide the button after submit the data
Jsp code for retrieving dsts in s text field
Help help
j2me - RMS & appending textfield
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:50:04.