Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / May 2004

Tip: Looking for answers? Try searching our database.

help with Jtext fields on JSP page?

Thread view: 
vivienne wykes - 07 May 2004 22:28 GMT
Hi All,

Looking to have a  JTextField on a JSP page that gets an int from the users.
We would then like to use this value as a multiplier later in the JSP page.
Any ideas and help  would be welcome.

regards

Jim Ascroft
Christophe Vanfleteren - 07 May 2004 22:37 GMT
> Hi All,
>
[quoted text clipped - 6 lines]
>
> Jim Ascroft

You *really* need to learn some basic HTML first.

There are no JTextFields on webpages (how could there be, JTextField is for
Swing), only input fields.

W3schools has some nice tutorials for (X)HTML:
http://www.w3schools.com/xhtml/

You need the <input> tag:
http://www.w3schools.com/tags/tag_input.asp

Signature

Kind regards,
Christophe Vanfleteren

vivienne wykes - 08 May 2004 10:53 GMT
Hi Christophe and group,

I propbably didnt put my questions all that well.
They are....

1.How can I collect an integer on a JSP page from user input?
I am looking to vallidate the user input.  I thought about vallidating using
HTML then passing/casting the input to a Java variable for further
manipulation on the page.
I cannot use response.encodeUrl for this.

2.I understand that my Java helper classes are compiled into .class files
and then used by the JSP page as required. Also the Java code within the <%
%> Java tags is recognised and runs .
So if the java between the <% %>  tags can be compiled and used why can
other Java components eg Swing or AWT not be used in the same way?

Effectively what I would like to do is replicate what a JTextField with an
action listener would do to retrieve user input in a desktop Java
application.

Any ideas and help would be welcome.

regards

Jim Ascroft

> > Hi All,
> >
[quoted text clipped - 17 lines]
> You need the <input> tag:
> http://www.w3schools.com/tags/tag_input.asp
Tony Morris - 08 May 2004 11:20 GMT
> Hi Christophe and group,
>
[quoted text clipped - 16 lines]
> action listener would do to retrieve user input in a desktop Java
> application.

I apologise for having a laugh at your expense, but these kind of queries
have a tendency to amuse me somewhat.

Good luck!

Signature

Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)

VisionSet - 08 May 2004 11:58 GMT
> 2.I understand that my Java helper classes are compiled into .class files
> and then used by the JSP page as required. Also the Java code within the <%
> %> Java tags is recognised and runs .
> So if the java between the <% %>  tags can be compiled and used why can
> other Java components eg Swing or AWT not be used in the same way?

Because the code is compiled and run on the server!!
The only thing the client sees is HTML or JavaScript and the like, if you
choose to render that.  Applets are different most browsers recognise those
as an object and the classes downloaded for that purpose, but this must be
explicit in the HTML as an instruction to the browser so it knows what to
do.  If you want Swing in a browser you must use an applet and ensure your
client has the neccessary JRE to run it.

--
Mike W


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.