Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > jsp servlet question

Reply
Thread Tools

jsp servlet question

 
 
hoho123
Guest
Posts: n/a
 
      07-07-2006
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

 
Reply With Quote
 
 
 
 
Andrea Desole
Guest
Posts: n/a
 
      07-07-2006
hoho123 wrote:
> 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/tu...L.html#wp74644
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening new child window - Running servlet (JSP and Servlet) agapitolw@yahoo.es Java 4 08-27-2007 12:57 PM
Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getOutputStream() has already been called for this response javadev Java 5 11-16-2006 11:22 AM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
servlet/jsp question: tomcat 4 and login (about session, forward and get/set attribute) Mladen Adamovic Java 3 11-16-2003 04:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57