jsp servlet question

H

hoho123

I know this question seems easy for all of you, but I am stuck.
I am new to JSP and the servlet, so please help me a bit.

in the JSP page, I have:

<input type=text name=date> So, in the servlet, what can I do to set a
value to the JSP page?

so I can get <input type=text name=date value="xxxxxx">
I read something like request.setAttribute("date", "xxxxx"); but it
doesn't work for me

Thanks in advance
 
A

Andrea Desole

hoho123 said:
I know this question seems easy for all of you, but I am stuck.
I am new to JSP and the servlet, so please help me a bit.

in the JSP page, I have:

<input type=text name=date> So, in the servlet, what can I do to set a
value to the JSP page?

so I can get <input type=text name=date value="xxxxxx">
I read something like request.setAttribute("date", "xxxxx"); but it
doesn't work for me

setting an attribute is not enough. You have to use a tag library to sho
w it (you can write directly Java code in the JSP, but it's not nice).
JSTL is probably the candidate number one. Please look at JSTL and the
"out" tag:

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL.html#wp74644
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,303
Latest member
Ketonara

Latest Threads

Top